From 1ebceab85a004011c9a8865139100961c1e9ef1d Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sat, 9 Nov 2024 10:10:16 +0000 Subject: [PATCH] Bundled output for commit dd45d75cd8b9c1789b093562eb312db1ad333c9c Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- extensions/embed/js/dist/forum.js | 2 +- extensions/embed/js/dist/forum.js.map | 2 +- extensions/emoji/js/dist/forum.js | 2 +- extensions/emoji/js/dist/forum.js.map | 2 +- extensions/messages/js/dist/forum.js | 2 +- extensions/messages/js/dist/forum.js.map | 2 +- extensions/package-manager/js/dist/admin.js | 2 +- extensions/package-manager/js/dist/admin.js.map | 2 +- extensions/statistics/js/dist/admin.js | 2 +- extensions/statistics/js/dist/admin.js.map | 2 +- extensions/suspend/js/dist/forum.js | 2 +- extensions/suspend/js/dist/forum.js.map | 2 +- extensions/tags/js/dist/admin.js | 2 +- extensions/tags/js/dist/admin.js.map | 2 +- extensions/tags/js/dist/forum.js | 2 +- extensions/tags/js/dist/forum.js.map | 2 +- framework/core/js/dist-typings/common/ExportRegistry.d.ts | 1 + framework/core/js/dist/admin.js | 2 +- framework/core/js/dist/admin.js.map | 2 +- framework/core/js/dist/forum.js | 2 +- framework/core/js/dist/forum.js.map | 2 +- 21 files changed, 21 insertions(+), 20 deletions(-) diff --git a/extensions/embed/js/dist/forum.js b/extensions/embed/js/dist/forum.js index 2bf677a3a5..9aacdec54e 100644 --- a/extensions/embed/js/dist/forum.js +++ b/extensions/embed/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var e={424:e=>{!function(t){if("undefined"!=typeof window){var n=!0,o="",i=0,r="",a=null,c="",s=!1,u={resize:1,click:1},d=128,l=!0,m=1,f="bodyOffset",p=f,g=!0,h="",v={},y=32,w=null,b=!1,T=!1,E="[iFrameSizer]",O="",S={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",I=window.parent,N="*",x=0,A=!1,C=null,k=16,z=1,R="scroll",P=R,F=window,L=function(){ie("onMessage function not defined")},D=function(){},j=function(){},q={height:function(){return ie("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return ie("Custom width calculation function not defined"),document.body.scrollWidth}},H={},W=!1;try{var B=Object.create({},{passive:{get:function(){W=!0}}});window.addEventListener("test",Z,B),window.removeEventListener("test",Z,B)}catch(e){}var J,U,V,X,Y,_,K,Q={bodyOffset:function(){return document.body.offsetHeight+ge("marginTop")+ge("marginBottom")},offset:function(){return Q.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return q.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,ve(Q))},min:function(){return Math.min.apply(null,ve(Q))},grow:function(){return Q.max()},lowestElement:function(){return Math.max(Q.bodyOffset()||Q.documentElementOffset(),he("bottom",we()))},taggedElement:function(){return ye("bottom","data-iframe-height")}},$={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return q.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max($.bodyScroll(),$.documentElementScroll())},max:function(){return Math.max.apply(null,ve($))},min:function(){return Math.min.apply(null,ve($))},rightMostElement:function(){return he("right",we())},taggedElement:function(){return ye("right","data-iframe-width")}},G=(J=be,Y=null,_=0,K=function(){_=Date.now(),Y=null,X=J.apply(U,V),Y||(U=V=null)},function(){var e=Date.now();_||(_=e);var t=k-(e-_);return U=this,V=arguments,t<=0||t>k?(Y&&(clearTimeout(Y),Y=null),_=e,X=J.apply(U,V),Y||(U=V=null)):Y||(Y=setTimeout(K,t)),X});"iframeResizer"in window||(window.iframeChildListener=function(e){Ie({data:e,sameDomian:!0})},ee(window,"message",Ie),ee(window,"readystatechange",Ne),Ne())}function Z(){}function ee(e,t,n,o){e.addEventListener(t,n,!!W&&(o||{}))}function te(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ne(e){return E+"["+O+"] "+e}function oe(e){b&&"object"==typeof window.console&&console.log(ne(e))}function ie(e){"object"==typeof window.console&&console.warn(ne(e))}function re(){var e,u;!function(){function e(e){return"true"===e}var a=h.slice(13).split(":");O=a[0],i=t===a[1]?i:Number(a[1]),s=t===a[2]?s:e(a[2]),b=t===a[3]?b:e(a[3]),y=t===a[4]?y:Number(a[4]),n=t===a[6]?n:e(a[6]),r=a[7],p=t===a[8]?p:a[8],o=a[9],c=a[10],x=t===a[11]?x:Number(a[11]),v.enable=t!==a[12]&&e(a[12]),M=t===a[13]?M:a[13],P=t===a[14]?P:a[14],T=t===a[15]?T:e(a[15])}(),oe("Initialising iFrame ("+window.location.href+")"),function(){function e(e,t){return"function"==typeof e&&(oe("Setup custom "+t+"CalcMethod"),q[t]=e,e="custom"),e}var t;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(t=window.iFrameResizer,oe("Reading data from page: "+JSON.stringify(t)),Object.keys(t).forEach(ae,t),L="onMessage"in t?t.onMessage:L,D="onReady"in t?t.onReady:D,N="targetOrigin"in t?t.targetOrigin:N,p="heightCalculationMethod"in t?t.heightCalculationMethod:p,P="widthCalculationMethod"in t?t.widthCalculationMethod:P,p=e(p,"height"),P=e(P,"width")),oe("TargetOrigin for parent set to: "+N)}(),t===r&&(r=i+"px"),ce("margin",(-1!==(u=r).indexOf("-")&&(ie("Negative CSS value ignored for margin"),u=""),u)),ce("background",o),ce("padding",c),(e=document.createElement("div")).style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e),le(),me(),document.documentElement.style.height="",document.body.style.height="",oe('HTML & body height set to "auto"'),oe("Enable public methods"),F.parentIFrame={autoResize:function(e){return!0===e&&!1===n?(n=!0,fe()):!1===e&&!0===n&&(n=!1,ue("remove"),null!==a&&a.disconnect(),clearInterval(w)),Me(0,0,"autoResize",JSON.stringify(n)),n},close:function(){Me(0,0,"close")},getId:function(){return O},getPageInfo:function(e){"function"==typeof e?(j=e,Me(0,0,"pageInfo")):(j=function(){},Me(0,0,"pageInfoStop"))},moveToAnchor:function(e){v.findTarget(e)},reset:function(){Se("parentIFrame.reset")},scrollTo:function(e,t){Me(t,e,"scrollTo")},scrollToOffset:function(e,t){Me(t,e,"scrollToOffset")},sendMessage:function(e,t){Me(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){p=e,le()},setWidthCalculationMethod:function(e){P=e,me()},setTargetOrigin:function(e){oe("Set targetOrigin: "+e),N=e},size:function(e,t){Te("size","parentIFrame.size("+(e||"")+(t?","+t:"")+")",e,t)}},function(){function e(e){Me(0,0,e.type,e.screenY+":"+e.screenX)}function t(t,n){oe("Add event listener: "+n),ee(window.document,t,e)}!0===T&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),fe(),v=function(){function e(e){var n=e.getBoundingClientRect(),o={x:window.pageXOffset===t?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===t?document.documentElement.scrollTop:window.pageYOffset};return{x:parseInt(n.left,10)+parseInt(o.x,10),y:parseInt(n.top,10)+parseInt(o.y,10)}}function n(n){var o=n.split("#")[1]||n,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];t===r?(oe("In page link (#"+o+") not found in iFrame, so sending to parent"),Me(0,0,"inPageLink","#"+o)):function(t){var n=e(t);oe("Moving to in page link (#"+o+") at x: "+n.x+" y: "+n.y),Me(n.y,n.x,"scrollToOffset")}(r)}function o(){var e=window.location.hash,t=window.location.href;""!==e&&"#"!==e&&n(t)}return v.enable?Array.prototype.forEach&&document.querySelectorAll?(oe("Setting up location.hash handlers"),Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),(function(e){"#"!==e.getAttribute("href")&&ee(e,"click",(function(e){e.preventDefault(),n(this.getAttribute("href"))}))})),ee(window,"hashchange",o),setTimeout(o,d)):ie("In page linking not fully supported in this browser! (See README.md for IE8 workaround)"):oe("In page linking not enabled"),{findTarget:n}}(),Te("init","Init message from host page"),D()}function ae(e){var t=e.split("Callback");if(2===t.length){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],ie("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function ce(e,n){t!==n&&""!==n&&"null"!==n&&(document.body.style[e]=n,oe("Body "+e+' set to "'+n+'"'))}function se(e){var t={add:function(t){function n(){Te(e.eventName,e.eventType)}H[t]=n,ee(window,t,n,{passive:!0})},remove:function(e){var t,n,o=H[e];delete H[e],t=e,n=o,window.removeEventListener(t,n,!1)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),oe(te(e.method)+" event listener: "+e.eventType)}function ue(e){se({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),se({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),se({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),se({method:e,eventType:"Input",eventName:"input"}),se({method:e,eventType:"Mouse Up",eventName:"mouseup"}),se({method:e,eventType:"Mouse Down",eventName:"mousedown"}),se({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),se({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),se({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),se({method:e,eventType:"Touch Start",eventName:"touchstart"}),se({method:e,eventType:"Touch End",eventName:"touchend"}),se({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),se({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),se({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),se({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),"child"===M&&se({method:e,eventType:"IFrame Resized",eventName:"resize"})}function de(e,t,n,o){return t!==e&&(e in n||(ie(e+" is not a valid option for "+o+"CalculationMethod."),e=t),oe(o+' calculation method set to "'+e+'"')),e}function le(){p=de(p,f,Q,"height")}function me(){P=de(P,R,$,"width")}function fe(){var e;!0===n?(ue("add"),e=0>y,window.MutationObserver||window.WebKitMutationObserver?e?pe():a=function(){function e(e){function t(e){!1===e.complete&&(oe("Attach listeners to "+e.src),e.addEventListener("load",o,!1),e.addEventListener("error",i,!1),a.push(e))}"attributes"===e.type&&"src"===e.attributeName?t(e.target):"childList"===e.type&&Array.prototype.forEach.call(e.target.querySelectorAll("img"),t)}function t(e){oe("Remove listeners from "+e.src),e.removeEventListener("load",o,!1),e.removeEventListener("error",i,!1),function(e){a.splice(a.indexOf(e),1)}(e)}function n(e,n,o){t(e.target),Te(n,o+": "+e.target.src)}function o(e){n(e,"imageLoad","Image loaded")}function i(e){n(e,"imageLoadFailed","Image load failed")}function r(t){Te("mutationObserver","mutationObserver: "+t[0].target+" "+t[0].type),t.forEach(e)}var a=[],c=window.MutationObserver||window.WebKitMutationObserver,s=function(){var e=document.querySelector("body");return s=new c(r),oe("Create body MutationObserver"),s.observe(e,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),s}();return{disconnect:function(){"disconnect"in s&&(oe("Disconnect body MutationObserver"),s.disconnect(),a.forEach(t))}}}():(oe("MutationObserver not supported in this browser!"),pe())):oe("Auto Resize disabled")}function pe(){0!==y&&(oe("setInterval: "+y+"ms"),w=setInterval((function(){Te("interval","setInterval: "+y)}),Math.abs(y)))}function ge(e,t){var n=0;return t=t||document.body,n=null===(n=document.defaultView.getComputedStyle(t,null))?0:n[e],parseInt(n,10)}function he(e,t){for(var n=t.length,o=0,i=0,r=te(e),a=Date.now(),c=0;ci&&(i=o);return a=Date.now()-a,oe("Parsed "+n+" HTML elements"),oe("Element position calculated in "+a+"ms"),function(e){e>k/2&&oe("Event throttle increased to "+(k=2*e)+"ms")}(a),i}function ve(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function ye(e,t){var n=document.querySelectorAll("["+t+"]");return 0===n.length&&(ie("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")),he(e,n)}function we(){return document.querySelectorAll("body *")}function be(e,n,o,i){var r,a;!function(){function e(e,t){return!(Math.abs(e-t)<=x)}return r=t===o?Q[p]():o,a=t===i?$[P]():i,e(m,r)||s&&e(z,a)}()&&"init"!==e?!(e in{init:1,interval:1,size:1})&&(p in S||s&&P in S)?Se(n):e in{interval:1}||oe("No change in size detected"):(Ee(),Me(m=r,z=a,e))}function Te(e,t,n,o){A&&e in u?oe("Trigger event cancelled: "+e):(e in{reset:1,resetPage:1,init:1}||oe("Trigger event: "+t),"init"===e?be(e,t,n,o):G(e,t,n,o))}function Ee(){A||(A=!0,oe("Trigger event lock on")),clearTimeout(C),C=setTimeout((function(){A=!1,oe("Trigger event lock off"),oe("--")}),d)}function Oe(e){m=Q[p](),z=$[P](),Me(m,z,e)}function Se(e){var t=p;p=f,oe("Reset trigger event: "+e),Ee(),Oe("reset"),p=t}function Me(e,n,o,i,r){var a;t===r?r=N:oe("Message targetOrigin: "+r),oe("Sending message to host page ("+(a=O+":"+e+":"+n+":"+o+(t===i?"":":"+i))+")"),I.postMessage(E+a,r)}function Ie(n){var o,i={init:function(){h=n.data,I=n.source,re(),l=!1,setTimeout((function(){g=!1}),d)},reset:function(){g?oe("Page reset ignored by init"):(oe("Page size reset by host page"),Oe("resetPage"))},resize:function(){Te("resizeParent","Parent window requested size check")},moveToAnchor:function(){v.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var e=a();oe("PageInfoFromParent called from parent: "+e),j(JSON.parse(e)),oe(" --")},message:function(){var e=a();oe("onMessage called from parent: "+e),L(JSON.parse(e)),oe(" --")}};function r(){return n.data.split("]")[1].split(":")[0]}function a(){return n.data.slice(n.data.indexOf(":")+1)}function c(){return n.data.split(":")[2]in{true:1,false:1}}E===(""+n.data).slice(0,13)&&(!1===l?(o=r())in i?i[o]():!e.exports&&"iFrameResize"in window||window.jQuery!==t&&"iFrameResize"in window.jQuery.prototype||c()||ie("Unexpected message ("+n.data+")"):c()?i.init():oe('Ignored message of type "'+r()+'". Received before initialization.'))}function Ne(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}}()}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(424);const e=flarum.reg.get("core","common/extend"),t=flarum.reg.get("core","forum/app");var o=n.n(t);const i=flarum.reg.get("core","common/utils/Stream");var r=n.n(i);const a=flarum.reg.get("core","forum/ForumApplication");var c=n.n(a);const s=flarum.reg.get("core","common/components/ModalManager");var u=n.n(s);const d=flarum.reg.get("core","forum/components/PostMeta");var l=n.n(d);const f=flarum.reg.get("core","forum/components/DiscussionPage");var p=n.n(f);(0,e.extend)(c().prototype,"mount",(function(){m.route.param("hideFirstPost")&&(0,e.extend)("flarum/forum/components/PostStream","view",(e=>{1===e.children[0].attrs["data-number"]&&e.children.splice(0,1)}))})),(0,e.override)(m.route.Link,"view",(function(e,t){return t.attrs.href=t.attrs.href.replace("/embed","/d"),t.attrs.target="_blank",e(t)})),(0,e.override)(l().prototype,"getPermalink",((e,t)=>e(t).replace("/embed","/d"))),o().pageInfo=r()({});const g=function(){const e=o().pageInfo();this.$().css("top",Math.max(0,e.scrollTop-e.offsetTop))};(0,e.extend)(u().prototype,"show",g),(0,e.extend)("flarum/forum/components/Composer","show",g),window.iFrameResizer={readyCallback:function(){window.parentIFrame.getPageInfo(o().pageInfo)}},(0,e.extend)("flarum/forum/components/PostStream","goToNumber",(function(e,t){if("reply"===t&&"parentIFrame"in window&&o().composer.isFullScreen()){const e=this.$(".PostStream-item:last").offset().top;window.parentIFrame.scrollToOffset(0,e)}})),(0,e.extend)(p().prototype,"sidebarItems",(function(e){e.remove("scrubber");const t=this.discussion.replyCount();e.add("replies",m("h3",null,m("a",{route:o().route.discussion(this.discussion).replace("/embed","/d")},t," comment",1==t?"":"s")),100);const n=e.get("controls").attrs;n.className=n.className.replace("App-primaryControl","")})),o().routes.discussion={path:"/embed/:id",component:p()},o().routes["discussion.near"]={path:"/embed/:id/:near",component:p()}})(),module.exports={}})(); +(()=>{var e={424:e=>{!function(t){if("undefined"!=typeof window){var n=!0,o="",i=0,r="",a=null,c="",s=!1,u={resize:1,click:1},d=128,l=!0,m=1,f="bodyOffset",p=f,g=!0,h="",v={},y=32,w=null,b=!1,T=!1,E="[iFrameSizer]",O="",S={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",I=window.parent,N="*",x=0,A=!1,C=null,k=16,z=1,R="scroll",P=R,F=window,L=function(){ie("onMessage function not defined")},D=function(){},j=function(){},q={height:function(){return ie("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return ie("Custom width calculation function not defined"),document.body.scrollWidth}},H={},W=!1;try{var B=Object.create({},{passive:{get:function(){W=!0}}});window.addEventListener("test",Z,B),window.removeEventListener("test",Z,B)}catch(e){}var J,U,_,V,X,Y,K,Q={bodyOffset:function(){return document.body.offsetHeight+ge("marginTop")+ge("marginBottom")},offset:function(){return Q.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return q.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,ve(Q))},min:function(){return Math.min.apply(null,ve(Q))},grow:function(){return Q.max()},lowestElement:function(){return Math.max(Q.bodyOffset()||Q.documentElementOffset(),he("bottom",we()))},taggedElement:function(){return ye("bottom","data-iframe-height")}},$={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return q.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max($.bodyScroll(),$.documentElementScroll())},max:function(){return Math.max.apply(null,ve($))},min:function(){return Math.min.apply(null,ve($))},rightMostElement:function(){return he("right",we())},taggedElement:function(){return ye("right","data-iframe-width")}},G=(J=be,X=null,Y=0,K=function(){Y=Date.now(),X=null,V=J.apply(U,_),X||(U=_=null)},function(){var e=Date.now();Y||(Y=e);var t=k-(e-Y);return U=this,_=arguments,t<=0||t>k?(X&&(clearTimeout(X),X=null),Y=e,V=J.apply(U,_),X||(U=_=null)):X||(X=setTimeout(K,t)),V});"iframeResizer"in window||(window.iframeChildListener=function(e){Ie({data:e,sameDomian:!0})},ee(window,"message",Ie),ee(window,"readystatechange",Ne),Ne())}function Z(){}function ee(e,t,n,o){e.addEventListener(t,n,!!W&&(o||{}))}function te(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ne(e){return E+"["+O+"] "+e}function oe(e){b&&"object"==typeof window.console&&console.log(ne(e))}function ie(e){"object"==typeof window.console&&console.warn(ne(e))}function re(){var e,u;!function(){function e(e){return"true"===e}var a=h.slice(13).split(":");O=a[0],i=t===a[1]?i:Number(a[1]),s=t===a[2]?s:e(a[2]),b=t===a[3]?b:e(a[3]),y=t===a[4]?y:Number(a[4]),n=t===a[6]?n:e(a[6]),r=a[7],p=t===a[8]?p:a[8],o=a[9],c=a[10],x=t===a[11]?x:Number(a[11]),v.enable=t!==a[12]&&e(a[12]),M=t===a[13]?M:a[13],P=t===a[14]?P:a[14],T=t===a[15]?T:e(a[15])}(),oe("Initialising iFrame ("+window.location.href+")"),function(){function e(e,t){return"function"==typeof e&&(oe("Setup custom "+t+"CalcMethod"),q[t]=e,e="custom"),e}var t;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(t=window.iFrameResizer,oe("Reading data from page: "+JSON.stringify(t)),Object.keys(t).forEach(ae,t),L="onMessage"in t?t.onMessage:L,D="onReady"in t?t.onReady:D,N="targetOrigin"in t?t.targetOrigin:N,p="heightCalculationMethod"in t?t.heightCalculationMethod:p,P="widthCalculationMethod"in t?t.widthCalculationMethod:P,p=e(p,"height"),P=e(P,"width")),oe("TargetOrigin for parent set to: "+N)}(),t===r&&(r=i+"px"),ce("margin",(-1!==(u=r).indexOf("-")&&(ie("Negative CSS value ignored for margin"),u=""),u)),ce("background",o),ce("padding",c),(e=document.createElement("div")).style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e),le(),me(),document.documentElement.style.height="",document.body.style.height="",oe('HTML & body height set to "auto"'),oe("Enable public methods"),F.parentIFrame={autoResize:function(e){return!0===e&&!1===n?(n=!0,fe()):!1===e&&!0===n&&(n=!1,ue("remove"),null!==a&&a.disconnect(),clearInterval(w)),Me(0,0,"autoResize",JSON.stringify(n)),n},close:function(){Me(0,0,"close")},getId:function(){return O},getPageInfo:function(e){"function"==typeof e?(j=e,Me(0,0,"pageInfo")):(j=function(){},Me(0,0,"pageInfoStop"))},moveToAnchor:function(e){v.findTarget(e)},reset:function(){Se("parentIFrame.reset")},scrollTo:function(e,t){Me(t,e,"scrollTo")},scrollToOffset:function(e,t){Me(t,e,"scrollToOffset")},sendMessage:function(e,t){Me(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){p=e,le()},setWidthCalculationMethod:function(e){P=e,me()},setTargetOrigin:function(e){oe("Set targetOrigin: "+e),N=e},size:function(e,t){Te("size","parentIFrame.size("+(e||"")+(t?","+t:"")+")",e,t)}},function(){function e(e){Me(0,0,e.type,e.screenY+":"+e.screenX)}function t(t,n){oe("Add event listener: "+n),ee(window.document,t,e)}!0===T&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),fe(),v=function(){function e(e){var n=e.getBoundingClientRect(),o={x:window.pageXOffset===t?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===t?document.documentElement.scrollTop:window.pageYOffset};return{x:parseInt(n.left,10)+parseInt(o.x,10),y:parseInt(n.top,10)+parseInt(o.y,10)}}function n(n){var o=n.split("#")[1]||n,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];t===r?(oe("In page link (#"+o+") not found in iFrame, so sending to parent"),Me(0,0,"inPageLink","#"+o)):function(t){var n=e(t);oe("Moving to in page link (#"+o+") at x: "+n.x+" y: "+n.y),Me(n.y,n.x,"scrollToOffset")}(r)}function o(){var e=window.location.hash,t=window.location.href;""!==e&&"#"!==e&&n(t)}return v.enable?Array.prototype.forEach&&document.querySelectorAll?(oe("Setting up location.hash handlers"),Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),(function(e){"#"!==e.getAttribute("href")&&ee(e,"click",(function(e){e.preventDefault(),n(this.getAttribute("href"))}))})),ee(window,"hashchange",o),setTimeout(o,d)):ie("In page linking not fully supported in this browser! (See README.md for IE8 workaround)"):oe("In page linking not enabled"),{findTarget:n}}(),Te("init","Init message from host page"),D()}function ae(e){var t=e.split("Callback");if(2===t.length){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],ie("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function ce(e,n){t!==n&&""!==n&&"null"!==n&&(document.body.style[e]=n,oe("Body "+e+' set to "'+n+'"'))}function se(e){var t={add:function(t){function n(){Te(e.eventName,e.eventType)}H[t]=n,ee(window,t,n,{passive:!0})},remove:function(e){var t,n,o=H[e];delete H[e],t=e,n=o,window.removeEventListener(t,n,!1)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),oe(te(e.method)+" event listener: "+e.eventType)}function ue(e){se({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),se({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),se({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),se({method:e,eventType:"Input",eventName:"input"}),se({method:e,eventType:"Mouse Up",eventName:"mouseup"}),se({method:e,eventType:"Mouse Down",eventName:"mousedown"}),se({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),se({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),se({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),se({method:e,eventType:"Touch Start",eventName:"touchstart"}),se({method:e,eventType:"Touch End",eventName:"touchend"}),se({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),se({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),se({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),se({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),"child"===M&&se({method:e,eventType:"IFrame Resized",eventName:"resize"})}function de(e,t,n,o){return t!==e&&(e in n||(ie(e+" is not a valid option for "+o+"CalculationMethod."),e=t),oe(o+' calculation method set to "'+e+'"')),e}function le(){p=de(p,f,Q,"height")}function me(){P=de(P,R,$,"width")}function fe(){var e;!0===n?(ue("add"),e=0>y,window.MutationObserver||window.WebKitMutationObserver?e?pe():a=function(){function e(e){function t(e){!1===e.complete&&(oe("Attach listeners to "+e.src),e.addEventListener("load",o,!1),e.addEventListener("error",i,!1),a.push(e))}"attributes"===e.type&&"src"===e.attributeName?t(e.target):"childList"===e.type&&Array.prototype.forEach.call(e.target.querySelectorAll("img"),t)}function t(e){oe("Remove listeners from "+e.src),e.removeEventListener("load",o,!1),e.removeEventListener("error",i,!1),function(e){a.splice(a.indexOf(e),1)}(e)}function n(e,n,o){t(e.target),Te(n,o+": "+e.target.src)}function o(e){n(e,"imageLoad","Image loaded")}function i(e){n(e,"imageLoadFailed","Image load failed")}function r(t){Te("mutationObserver","mutationObserver: "+t[0].target+" "+t[0].type),t.forEach(e)}var a=[],c=window.MutationObserver||window.WebKitMutationObserver,s=function(){var e=document.querySelector("body");return s=new c(r),oe("Create body MutationObserver"),s.observe(e,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),s}();return{disconnect:function(){"disconnect"in s&&(oe("Disconnect body MutationObserver"),s.disconnect(),a.forEach(t))}}}():(oe("MutationObserver not supported in this browser!"),pe())):oe("Auto Resize disabled")}function pe(){0!==y&&(oe("setInterval: "+y+"ms"),w=setInterval((function(){Te("interval","setInterval: "+y)}),Math.abs(y)))}function ge(e,t){var n=0;return t=t||document.body,n=null===(n=document.defaultView.getComputedStyle(t,null))?0:n[e],parseInt(n,10)}function he(e,t){for(var n=t.length,o=0,i=0,r=te(e),a=Date.now(),c=0;ci&&(i=o);return a=Date.now()-a,oe("Parsed "+n+" HTML elements"),oe("Element position calculated in "+a+"ms"),function(e){e>k/2&&oe("Event throttle increased to "+(k=2*e)+"ms")}(a),i}function ve(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function ye(e,t){var n=document.querySelectorAll("["+t+"]");return 0===n.length&&(ie("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")),he(e,n)}function we(){return document.querySelectorAll("body *")}function be(e,n,o,i){var r,a;!function(){function e(e,t){return!(Math.abs(e-t)<=x)}return r=t===o?Q[p]():o,a=t===i?$[P]():i,e(m,r)||s&&e(z,a)}()&&"init"!==e?!(e in{init:1,interval:1,size:1})&&(p in S||s&&P in S)?Se(n):e in{interval:1}||oe("No change in size detected"):(Ee(),Me(m=r,z=a,e))}function Te(e,t,n,o){A&&e in u?oe("Trigger event cancelled: "+e):(e in{reset:1,resetPage:1,init:1}||oe("Trigger event: "+t),"init"===e?be(e,t,n,o):G(e,t,n,o))}function Ee(){A||(A=!0,oe("Trigger event lock on")),clearTimeout(C),C=setTimeout((function(){A=!1,oe("Trigger event lock off"),oe("--")}),d)}function Oe(e){m=Q[p](),z=$[P](),Me(m,z,e)}function Se(e){var t=p;p=f,oe("Reset trigger event: "+e),Ee(),Oe("reset"),p=t}function Me(e,n,o,i,r){var a;t===r?r=N:oe("Message targetOrigin: "+r),oe("Sending message to host page ("+(a=O+":"+e+":"+n+":"+o+(t===i?"":":"+i))+")"),I.postMessage(E+a,r)}function Ie(n){var o,i={init:function(){h=n.data,I=n.source,re(),l=!1,setTimeout((function(){g=!1}),d)},reset:function(){g?oe("Page reset ignored by init"):(oe("Page size reset by host page"),Oe("resetPage"))},resize:function(){Te("resizeParent","Parent window requested size check")},moveToAnchor:function(){v.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var e=a();oe("PageInfoFromParent called from parent: "+e),j(JSON.parse(e)),oe(" --")},message:function(){var e=a();oe("onMessage called from parent: "+e),L(JSON.parse(e)),oe(" --")}};function r(){return n.data.split("]")[1].split(":")[0]}function a(){return n.data.slice(n.data.indexOf(":")+1)}function c(){return n.data.split(":")[2]in{true:1,false:1}}E===(""+n.data).slice(0,13)&&(!1===l?(o=r())in i?i[o]():!e.exports&&"iFrameResize"in window||window.jQuery!==t&&"iFrameResize"in window.jQuery.prototype||c()||ie("Unexpected message ("+n.data+")"):c()?i.init():oe('Ignored message of type "'+r()+'". Received before initialization.'))}function Ne(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}}()}},t={};function n(o){flarum.reg._webpack_runtimes["flarum-embed"]||=n;var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(424);const e=flarum.reg.get("core","common/extend"),t=flarum.reg.get("core","forum/app");var o=n.n(t);const i=flarum.reg.get("core","common/utils/Stream");var r=n.n(i);const a=flarum.reg.get("core","forum/ForumApplication");var c=n.n(a);const s=flarum.reg.get("core","common/components/ModalManager");var u=n.n(s);const d=flarum.reg.get("core","forum/components/PostMeta");var l=n.n(d);const f=flarum.reg.get("core","forum/components/DiscussionPage");var p=n.n(f);(0,e.extend)(c().prototype,"mount",(function(){m.route.param("hideFirstPost")&&(0,e.extend)("flarum/forum/components/PostStream","view",(e=>{1===e.children[0].attrs["data-number"]&&e.children.splice(0,1)}))})),(0,e.override)(m.route.Link,"view",(function(e,t){return t.attrs.href=t.attrs.href.replace("/embed","/d"),t.attrs.target="_blank",e(t)})),(0,e.override)(l().prototype,"getPermalink",((e,t)=>e(t).replace("/embed","/d"))),o().pageInfo=r()({});const g=function(){const e=o().pageInfo();this.$().css("top",Math.max(0,e.scrollTop-e.offsetTop))};(0,e.extend)(u().prototype,"show",g),(0,e.extend)("flarum/forum/components/Composer","show",g),window.iFrameResizer={readyCallback:function(){window.parentIFrame.getPageInfo(o().pageInfo)}},(0,e.extend)("flarum/forum/components/PostStream","goToNumber",(function(e,t){if("reply"===t&&"parentIFrame"in window&&o().composer.isFullScreen()){const e=this.$(".PostStream-item:last").offset().top;window.parentIFrame.scrollToOffset(0,e)}})),(0,e.extend)(p().prototype,"sidebarItems",(function(e){e.remove("scrubber");const t=this.discussion.replyCount();e.add("replies",m("h3",null,m("a",{route:o().route.discussion(this.discussion).replace("/embed","/d")},t," comment",1==t?"":"s")),100);const n=e.get("controls").attrs;n.className=n.className.replace("App-primaryControl","")})),o().routes.discussion={path:"/embed/:id",component:p()},o().routes["discussion.near"]={path:"/embed/:id/:near",component:p()}})(),module.exports={}})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/embed/js/dist/forum.js.map b/extensions/embed/js/dist/forum.js.map index 770be9c6ec..11af5e6417 100644 --- a/extensions/embed/js/dist/forum.js.map +++ b/extensions/embed/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"sBAWC,SAAWA,GACV,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AAe,EAAGiL,EACxC,CACF,KACA,IAAAtB,QAAO,cAA0B,gBAAgB,SAAUuB,GACzDA,EAAM9H,OAAO,YACb,MAAM+H,EAAQ3P,KAAK4P,WAAWC,aAC9BH,EAAMlI,IAAI,UAAW4G,EAAE,KAAM,KAAMA,EAAE,IAAK,CACxCC,MAAO,UAAUuB,WAAW5P,KAAK4P,YAAYd,QAAQ,SAAU,OAC9Da,EAAO,WAAqB,GAATA,EAAa,GAAK,MAAO,KAC/C,MAAMlB,EAAQiB,EAAM/R,IAAI,YAAY8Q,MACpCA,EAAMqB,UAAYrB,EAAMqB,UAAUhB,QAAQ,qBAAsB,GAClE,IACA,WAAuB,WAAI,CACzBiB,KAAM,aACNC,UAAW,KAEb,WAAW,mBAAqB,CAC9BD,KAAM,mBACNC,UAAW,I","sources":["webpack://@flarum/embed/../../../node_modules/iframe-resizer/js/iframeResizer.contentWindow.js","webpack://@flarum/embed/webpack/bootstrap","webpack://@flarum/embed/webpack/runtime/compat get default export","webpack://@flarum/embed/webpack/runtime/define property getters","webpack://@flarum/embed/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/ForumApplication')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'common/components/ModalManager')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/components/PostMeta')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/embed/./src/forum/index.js"],"sourcesContent":["/*\n * File: iframeResizer.contentWindow.js\n * Desc: Include this file in any page being loaded into an iframe\n * to force the iframe to resize to the content size.\n * Requires: iframeResizer.js on host page.\n * Doc: https://iframe-resizer.com\n * Author: David J. Bradshaw - info@iframe-resizer.com\n *\n */\n\n// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names\n;(function (undefined) {\n if (typeof window === 'undefined') return // don't run for server side render\n\n var autoResize = true,\n base = 10,\n bodyBackground = '',\n bodyMargin = 0,\n bodyMarginStr = '',\n bodyObserver = null,\n bodyPadding = '',\n calculateWidth = false,\n doubleEventList = { resize: 1, click: 1 },\n eventCancelTimer = 128,\n firstRun = true,\n height = 1,\n heightCalcModeDefault = 'bodyOffset',\n heightCalcMode = heightCalcModeDefault,\n initLock = true,\n initMsg = '',\n inPageLinks = {},\n interval = 32,\n intervalTimer = null,\n logging = false,\n mouseEvents = false,\n msgID = '[iFrameSizer]', // Must match host page msg ID\n msgIdLen = msgID.length,\n myID = '',\n resetRequiredMethods = {\n max: 1,\n min: 1,\n bodyScroll: 1,\n documentElementScroll: 1\n },\n resizeFrom = 'child',\n sendPermit = true,\n target = window.parent,\n targetOriginDefault = '*',\n tolerance = 0,\n triggerLocked = false,\n triggerLockedTimer = null,\n throttledTimer = 16,\n width = 1,\n widthCalcModeDefault = 'scroll',\n widthCalcMode = widthCalcModeDefault,\n win = window,\n onMessage = function () {\n warn('onMessage function not defined')\n },\n onReady = function () {},\n onPageInfo = function () {},\n customCalcMethods = {\n height: function () {\n warn('Custom height calculation function not defined')\n return document.documentElement.offsetHeight\n },\n width: function () {\n warn('Custom width calculation function not defined')\n return document.body.scrollWidth\n }\n },\n eventHandlersByName = {},\n passiveSupported = false\n\n function noop() {}\n\n try {\n var options = Object.create(\n {},\n {\n passive: {\n // eslint-disable-next-line getter-return\n get: function () {\n passiveSupported = true\n }\n }\n }\n )\n window.addEventListener('test', noop, options)\n window.removeEventListener('test', noop, options)\n } catch (error) {\n /* */\n }\n\n function addEventListener(el, evt, func, options) {\n el.addEventListener(evt, func, passiveSupported ? options || {} : false)\n }\n\n function removeEventListener(el, evt, func) {\n el.removeEventListener(evt, func, false)\n }\n\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1)\n }\n\n // Based on underscore.js\n function throttle(func) {\n var context,\n args,\n result,\n timeout = null,\n previous = 0,\n later = function () {\n previous = Date.now()\n timeout = null\n result = func.apply(context, args)\n if (!timeout) {\n // eslint-disable-next-line no-multi-assign\n context = args = null\n }\n }\n\n return function () {\n var now = Date.now()\n\n if (!previous) {\n previous = now\n }\n\n var remaining = throttledTimer - (now - previous)\n\n context = this\n args = arguments\n\n if (remaining <= 0 || remaining > throttledTimer) {\n if (timeout) {\n clearTimeout(timeout)\n timeout = null\n }\n\n previous = now\n result = func.apply(context, args)\n\n if (!timeout) {\n // eslint-disable-next-line no-multi-assign\n context = args = null\n }\n } else if (!timeout) {\n timeout = setTimeout(later, remaining)\n }\n\n return result\n }\n }\n\n function formatLogMsg(msg) {\n return msgID + '[' + myID + '] ' + msg\n }\n\n function log(msg) {\n if (logging && 'object' === typeof window.console) {\n // eslint-disable-next-line no-console\n console.log(formatLogMsg(msg))\n }\n }\n\n function warn(msg) {\n if ('object' === typeof window.console) {\n // eslint-disable-next-line no-console\n console.warn(formatLogMsg(msg))\n }\n }\n\n function init() {\n readDataFromParent()\n log('Initialising iFrame (' + window.location.href + ')')\n readDataFromPage()\n setMargin()\n setBodyStyle('background', bodyBackground)\n setBodyStyle('padding', bodyPadding)\n injectClearFixIntoBodyElement()\n checkHeightMode()\n checkWidthMode()\n stopInfiniteResizingOfIFrame()\n setupPublicMethods()\n setupMouseEvents()\n startEventListeners()\n inPageLinks = setupInPageLinks()\n sendSize('init', 'Init message from host page')\n onReady()\n }\n\n function readDataFromParent() {\n function strBool(str) {\n return 'true' === str\n }\n\n var data = initMsg.slice(msgIdLen).split(':')\n\n myID = data[0]\n bodyMargin = undefined === data[1] ? bodyMargin : Number(data[1]) // For V1 compatibility\n calculateWidth = undefined === data[2] ? calculateWidth : strBool(data[2])\n logging = undefined === data[3] ? logging : strBool(data[3])\n interval = undefined === data[4] ? interval : Number(data[4])\n autoResize = undefined === data[6] ? autoResize : strBool(data[6])\n bodyMarginStr = data[7]\n heightCalcMode = undefined === data[8] ? heightCalcMode : data[8]\n bodyBackground = data[9]\n bodyPadding = data[10]\n tolerance = undefined === data[11] ? tolerance : Number(data[11])\n inPageLinks.enable = undefined === data[12] ? false : strBool(data[12])\n resizeFrom = undefined === data[13] ? resizeFrom : data[13]\n widthCalcMode = undefined === data[14] ? widthCalcMode : data[14]\n mouseEvents = undefined === data[15] ? mouseEvents : strBool(data[15])\n }\n\n function depricate(key) {\n var splitName = key.split('Callback')\n\n if (splitName.length === 2) {\n var name =\n 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1)\n this[name] = this[key]\n delete this[key]\n warn(\n \"Deprecated: '\" +\n key +\n \"' has been renamed '\" +\n name +\n \"'. The old method will be removed in the next major version.\"\n )\n }\n }\n\n function readDataFromPage() {\n function readData() {\n var data = window.iFrameResizer\n\n log('Reading data from page: ' + JSON.stringify(data))\n Object.keys(data).forEach(depricate, data)\n\n onMessage = 'onMessage' in data ? data.onMessage : onMessage\n onReady = 'onReady' in data ? data.onReady : onReady\n targetOriginDefault =\n 'targetOrigin' in data ? data.targetOrigin : targetOriginDefault\n heightCalcMode =\n 'heightCalculationMethod' in data\n ? data.heightCalculationMethod\n : heightCalcMode\n widthCalcMode =\n 'widthCalculationMethod' in data\n ? data.widthCalculationMethod\n : widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if ('function' === typeof calcMode) {\n log('Setup custom ' + calcFunc + 'CalcMethod')\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (\n 'iFrameResizer' in window &&\n Object === window.iFrameResizer.constructor\n ) {\n readData()\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n }\n\n log('TargetOrigin for parent set to: ' + targetOriginDefault)\n }\n\n function chkCSS(attr, value) {\n if (-1 !== value.indexOf('-')) {\n warn('Negative CSS value ignored for ' + attr)\n value = ''\n }\n return value\n }\n\n function setBodyStyle(attr, value) {\n if (undefined !== value && '' !== value && 'null' !== value) {\n document.body.style[attr] = value\n log('Body ' + attr + ' set to \"' + value + '\"')\n }\n }\n\n function setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = bodyMargin + 'px'\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n }\n\n function stopInfiniteResizingOfIFrame() {\n document.documentElement.style.height = ''\n document.body.style.height = ''\n log('HTML & body height set to \"auto\"')\n }\n\n function manageTriggerEvent(options) {\n var listener = {\n add: function (eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove: function (eventName) {\n var handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n }\n }\n\n if (options.eventNames && Array.prototype.map) {\n options.eventName = options.eventNames[0]\n options.eventNames.map(listener[options.method])\n } else {\n listener[options.method](options.eventName)\n }\n\n log(\n capitalizeFirstLetter(options.method) +\n ' event listener: ' +\n options.eventType\n )\n }\n\n function manageEventListeners(method) {\n manageTriggerEvent({\n method: method,\n eventType: 'Animation Start',\n eventNames: ['animationstart', 'webkitAnimationStart']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Animation Iteration',\n eventNames: ['animationiteration', 'webkitAnimationIteration']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Animation End',\n eventNames: ['animationend', 'webkitAnimationEnd']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Input',\n eventName: 'input'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Mouse Up',\n eventName: 'mouseup'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Mouse Down',\n eventName: 'mousedown'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Orientation Change',\n eventName: 'orientationchange'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Print',\n eventNames: ['afterprint', 'beforeprint']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch Start',\n eventName: 'touchstart'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch End',\n eventName: 'touchend'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch Cancel',\n eventName: 'touchcancel'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition Start',\n eventNames: [\n 'transitionstart',\n 'webkitTransitionStart',\n 'MSTransitionStart',\n 'oTransitionStart',\n 'otransitionstart'\n ]\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition Iteration',\n eventNames: [\n 'transitioniteration',\n 'webkitTransitionIteration',\n 'MSTransitionIteration',\n 'oTransitionIteration',\n 'otransitioniteration'\n ]\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition End',\n eventNames: [\n 'transitionend',\n 'webkitTransitionEnd',\n 'MSTransitionEnd',\n 'oTransitionEnd',\n 'otransitionend'\n ]\n })\n if ('child' === resizeFrom) {\n manageTriggerEvent({\n method: method,\n eventType: 'IFrame Resized',\n eventName: 'resize'\n })\n }\n }\n\n function checkCalcMode(calcMode, calcModeDefault, modes, type) {\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(\n calcMode + ' is not a valid option for ' + type + 'CalculationMethod.'\n )\n calcMode = calcModeDefault\n }\n log(type + ' calculation method set to \"' + calcMode + '\"')\n }\n\n return calcMode\n }\n\n function checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n 'height'\n )\n }\n\n function checkWidthMode() {\n widthCalcMode = checkCalcMode(\n widthCalcMode,\n widthCalcModeDefault,\n getWidth,\n 'width'\n )\n }\n\n function startEventListeners() {\n if (true === autoResize) {\n manageEventListeners('add')\n setupMutationObserver()\n } else {\n log('Auto Resize disabled')\n }\n }\n\n // function stopMsgsToParent() {\n // log('Disable outgoing messages')\n // sendPermit = false\n // }\n\n // function removeMsgListener() {\n // log('Remove event listener: Message')\n // removeEventListener(window, 'message', receiver)\n // }\n\n function disconnectMutationObserver() {\n if (null !== bodyObserver) {\n /* istanbul ignore next */ // Not testable in PhantonJS\n bodyObserver.disconnect()\n }\n }\n\n function stopEventListeners() {\n manageEventListeners('remove')\n disconnectMutationObserver()\n clearInterval(intervalTimer)\n }\n\n // function teardown() {\n // stopMsgsToParent()\n // removeMsgListener()\n // if (true === autoResize) stopEventListeners()\n // }\n\n function injectClearFixIntoBodyElement() {\n var clearFix = document.createElement('div')\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n document.body.appendChild(clearFix)\n }\n\n function setupInPageLinks() {\n function getPagePosition() {\n return {\n x:\n window.pageXOffset === undefined\n ? document.documentElement.scrollLeft\n : window.pageXOffset,\n y:\n window.pageYOffset === undefined\n ? document.documentElement.scrollTop\n : window.pageYOffset\n }\n }\n\n function getElementPosition(el) {\n var elPosition = el.getBoundingClientRect(),\n pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, 10) + parseInt(pagePosition.x, 10),\n y: parseInt(elPosition.top, 10) + parseInt(pagePosition.y, 10)\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n var jumpPosition = getElementPosition(target)\n\n log(\n 'Moving to in page link (#' +\n hash +\n ') at x: ' +\n jumpPosition.x +\n ' y: ' +\n jumpPosition.y\n )\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n }\n\n var hash = location.split('#')[1] || location, // Remove # if present\n hashData = decodeURIComponent(hash),\n target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (undefined === target) {\n log(\n 'In page link (#' +\n hash +\n ') not found in iFrame, so sending to parent'\n )\n sendMsg(0, 0, 'inPageLink', '#' + hash)\n } else {\n jumpToTarget(target)\n }\n }\n\n function checkLocationHash() {\n var hash = window.location.hash\n var href = window.location.href\n\n if ('' !== hash && '#' !== hash) {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n function setupLink(el) {\n function linkClicked(e) {\n e.preventDefault()\n\n /* jshint validthis:true */\n findTarget(this.getAttribute('href'))\n }\n\n if ('#' !== el.getAttribute('href')) {\n addEventListener(el, 'click', linkClicked)\n }\n }\n\n Array.prototype.forEach.call(\n document.querySelectorAll('a[href^=\"#\"]'),\n setupLink\n )\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n /* istanbul ignore else */ // Not testable in phantonJS\n if (Array.prototype.forEach && document.querySelectorAll) {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n } else {\n warn(\n 'In page linking not fully supported in this browser! (See README.md for IE8 workaround)'\n )\n }\n }\n\n if (inPageLinks.enable) {\n enableInPageLinks()\n } else {\n log('In page linking not enabled')\n }\n\n return {\n findTarget: findTarget\n }\n }\n\n function setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMsg(0, 0, e.type, e.screenY + ':' + e.screenX)\n }\n\n function addMouseListener(evt, name) {\n log('Add event listener: ' + name)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n }\n\n function setupPublicMethods() {\n log('Enable public methods')\n\n win.parentIFrame = {\n autoResize: function autoResizeF(resize) {\n if (true === resize && false === autoResize) {\n autoResize = true\n startEventListeners()\n } else if (false === resize && true === autoResize) {\n autoResize = false\n stopEventListeners()\n }\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n return autoResize\n },\n\n close: function closeF() {\n sendMsg(0, 0, 'close')\n // teardown()\n },\n\n getId: function getIdF() {\n return myID\n },\n\n getPageInfo: function getPageInfoF(callback) {\n if ('function' === typeof callback) {\n onPageInfo = callback\n sendMsg(0, 0, 'pageInfo')\n } else {\n onPageInfo = function () {}\n sendMsg(0, 0, 'pageInfoStop')\n }\n },\n\n moveToAnchor: function moveToAnchorF(hash) {\n inPageLinks.findTarget(hash)\n },\n\n reset: function resetF() {\n resetIFrame('parentIFrame.reset')\n },\n\n scrollTo: function scrollToF(x, y) {\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollToOffset: function scrollToF(x, y) {\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n },\n\n sendMessage: function sendMessageF(msg, targetOrigin) {\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod: function setHeightCalculationMethodF(\n heightCalculationMethod\n ) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod: function setWidthCalculationMethodF(\n widthCalculationMethod\n ) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin: function setTargetOriginF(targetOrigin) {\n log('Set targetOrigin: ' + targetOrigin)\n targetOriginDefault = targetOrigin\n },\n\n size: function sizeF(customHeight, customWidth) {\n var valString =\n '' + (customHeight || '') + (customWidth ? ',' + customWidth : '')\n sendSize(\n 'size',\n 'parentIFrame.size(' + valString + ')',\n customHeight,\n customWidth\n )\n }\n }\n }\n\n function initInterval() {\n if (0 !== interval) {\n log('setInterval: ' + interval + 'ms')\n intervalTimer = setInterval(function () {\n sendSize('interval', 'setInterval: ' + interval)\n }, Math.abs(interval))\n }\n }\n\n // Not testable in PhantomJS\n /* istanbul ignore next */\n function setupBodyMutationObserver() {\n function addImageLoadListners(mutation) {\n function addImageLoadListener(element) {\n if (false === element.complete) {\n log('Attach listeners to ' + element.src)\n element.addEventListener('load', imageLoaded, false)\n element.addEventListener('error', imageError, false)\n elements.push(element)\n }\n }\n\n if (mutation.type === 'attributes' && mutation.attributeName === 'src') {\n addImageLoadListener(mutation.target)\n } else if (mutation.type === 'childList') {\n Array.prototype.forEach.call(\n mutation.target.querySelectorAll('img'),\n addImageLoadListener\n )\n }\n }\n\n function removeFromArray(element) {\n elements.splice(elements.indexOf(element), 1)\n }\n\n function removeImageLoadListener(element) {\n log('Remove listeners from ' + element.src)\n element.removeEventListener('load', imageLoaded, false)\n element.removeEventListener('error', imageError, false)\n removeFromArray(element)\n }\n\n function imageEventTriggered(event, type, typeDesc) {\n removeImageLoadListener(event.target)\n sendSize(type, typeDesc + ': ' + event.target.src)\n }\n\n function imageLoaded(event) {\n imageEventTriggered(event, 'imageLoad', 'Image loaded')\n }\n\n function imageError(event) {\n imageEventTriggered(event, 'imageLoadFailed', 'Image load failed')\n }\n\n function mutationObserved(mutations) {\n sendSize(\n 'mutationObserver',\n 'mutationObserver: ' + mutations[0].target + ' ' + mutations[0].type\n )\n\n // Deal with WebKit / Blink asyncing image loading when tags are injected into the page\n mutations.forEach(addImageLoadListners)\n }\n\n function createMutationObserver() {\n var target = document.querySelector('body'),\n config = {\n attributes: true,\n attributeOldValue: false,\n characterData: true,\n characterDataOldValue: false,\n childList: true,\n subtree: true\n }\n\n observer = new MutationObserver(mutationObserved)\n\n log('Create body MutationObserver')\n observer.observe(target, config)\n\n return observer\n }\n\n var elements = [],\n MutationObserver =\n window.MutationObserver || window.WebKitMutationObserver,\n observer = createMutationObserver()\n\n return {\n disconnect: function () {\n if ('disconnect' in observer) {\n log('Disconnect body MutationObserver')\n observer.disconnect()\n elements.forEach(removeImageLoadListener)\n }\n }\n }\n }\n\n function setupMutationObserver() {\n var forceIntervalTimer = 0 > interval\n\n // Not testable in PhantomJS\n /* istanbul ignore if */ if (\n window.MutationObserver ||\n window.WebKitMutationObserver\n ) {\n if (forceIntervalTimer) {\n initInterval()\n } else {\n bodyObserver = setupBodyMutationObserver()\n }\n } else {\n log('MutationObserver not supported in this browser!')\n initInterval()\n }\n }\n\n // document.documentElement.offsetHeight is not reliable, so\n // we have to jump through hoops to get a better value.\n function getComputedStyle(prop, el) {\n var retVal = 0\n el = el || document.body // Not testable in phantonJS\n\n retVal = document.defaultView.getComputedStyle(el, null)\n retVal = null === retVal ? 0 : retVal[prop]\n\n return parseInt(retVal, base)\n }\n\n function chkEventThottle(timer) {\n if (timer > throttledTimer / 2) {\n throttledTimer = 2 * timer\n log('Event throttle increased to ' + throttledTimer + 'ms')\n }\n }\n\n // Idea from https://github.com/guardian/iframe-messenger\n function getMaxElement(side, elements) {\n var elementsLength = elements.length,\n elVal = 0,\n maxVal = 0,\n Side = capitalizeFirstLetter(side),\n timer = Date.now()\n\n for (var i = 0; i < elementsLength; i++) {\n elVal =\n elements[i].getBoundingClientRect()[side] +\n getComputedStyle('margin' + Side, elements[i])\n if (elVal > maxVal) {\n maxVal = elVal\n }\n }\n\n timer = Date.now() - timer\n\n log('Parsed ' + elementsLength + ' HTML elements')\n log('Element position calculated in ' + timer + 'ms')\n\n chkEventThottle(timer)\n\n return maxVal\n }\n\n function getAllMeasurements(dimensions) {\n return [\n dimensions.bodyOffset(),\n dimensions.bodyScroll(),\n dimensions.documentElementOffset(),\n dimensions.documentElementScroll()\n ]\n }\n\n function getTaggedElements(side, tag) {\n function noTaggedElementsFound() {\n warn('No tagged elements (' + tag + ') found on page')\n return document.querySelectorAll('body *')\n }\n\n var elements = document.querySelectorAll('[' + tag + ']')\n\n if (elements.length === 0) noTaggedElementsFound()\n\n return getMaxElement(side, elements)\n }\n\n function getAllElements() {\n return document.querySelectorAll('body *')\n }\n\n var getHeight = {\n bodyOffset: function getBodyOffsetHeight() {\n return (\n document.body.offsetHeight +\n getComputedStyle('marginTop') +\n getComputedStyle('marginBottom')\n )\n },\n\n offset: function () {\n return getHeight.bodyOffset() // Backwards compatibility\n },\n\n bodyScroll: function getBodyScrollHeight() {\n return document.body.scrollHeight\n },\n\n custom: function getCustomWidth() {\n return customCalcMethods.height()\n },\n\n documentElementOffset: function getDEOffsetHeight() {\n return document.documentElement.offsetHeight\n },\n\n documentElementScroll: function getDEScrollHeight() {\n return document.documentElement.scrollHeight\n },\n\n max: function getMaxHeight() {\n return Math.max.apply(null, getAllMeasurements(getHeight))\n },\n\n min: function getMinHeight() {\n return Math.min.apply(null, getAllMeasurements(getHeight))\n },\n\n grow: function growHeight() {\n return getHeight.max() // Run max without the forced downsizing\n },\n\n lowestElement: function getBestHeight() {\n return Math.max(\n getHeight.bodyOffset() || getHeight.documentElementOffset(),\n getMaxElement('bottom', getAllElements())\n )\n },\n\n taggedElement: function getTaggedElementsHeight() {\n return getTaggedElements('bottom', 'data-iframe-height')\n }\n },\n getWidth = {\n bodyScroll: function getBodyScrollWidth() {\n return document.body.scrollWidth\n },\n\n bodyOffset: function getBodyOffsetWidth() {\n return document.body.offsetWidth\n },\n\n custom: function getCustomWidth() {\n return customCalcMethods.width()\n },\n\n documentElementScroll: function getDEScrollWidth() {\n return document.documentElement.scrollWidth\n },\n\n documentElementOffset: function getDEOffsetWidth() {\n return document.documentElement.offsetWidth\n },\n\n scroll: function getMaxWidth() {\n return Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll())\n },\n\n max: function getMaxWidth() {\n return Math.max.apply(null, getAllMeasurements(getWidth))\n },\n\n min: function getMinWidth() {\n return Math.min.apply(null, getAllMeasurements(getWidth))\n },\n\n rightMostElement: function rightMostElement() {\n return getMaxElement('right', getAllElements())\n },\n\n taggedElement: function getTaggedElementsWidth() {\n return getTaggedElements('right', 'data-iframe-width')\n }\n }\n\n function sizeIFrame(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth\n ) {\n function resizeIFrame() {\n height = currentHeight\n width = currentWidth\n\n sendMsg(height, width, triggerEvent)\n }\n\n function isSizeChangeDetected() {\n function checkTolarance(a, b) {\n var retVal = Math.abs(a - b) <= tolerance\n return !retVal\n }\n\n currentHeight =\n undefined === customHeight ? getHeight[heightCalcMode]() : customHeight\n currentWidth =\n undefined === customWidth ? getWidth[widthCalcMode]() : customWidth\n\n return (\n checkTolarance(height, currentHeight) ||\n (calculateWidth && checkTolarance(width, currentWidth))\n )\n }\n\n function isForceResizableEvent() {\n return !(triggerEvent in { init: 1, interval: 1, size: 1 })\n }\n\n function isForceResizableCalcMode() {\n return (\n heightCalcMode in resetRequiredMethods ||\n (calculateWidth && widthCalcMode in resetRequiredMethods)\n )\n }\n\n function logIgnored() {\n log('No change in size detected')\n }\n\n function checkDownSizing() {\n if (isForceResizableEvent() && isForceResizableCalcMode()) {\n resetIFrame(triggerEventDesc)\n } else if (!(triggerEvent in { interval: 1 })) {\n logIgnored()\n }\n }\n\n var currentHeight, currentWidth\n\n if (isSizeChangeDetected() || 'init' === triggerEvent) {\n lockTrigger()\n resizeIFrame()\n } else {\n checkDownSizing()\n }\n }\n\n var sizeIFrameThrottled = throttle(sizeIFrame)\n\n function sendSize(triggerEvent, triggerEventDesc, customHeight, customWidth) {\n function recordTrigger() {\n if (!(triggerEvent in { reset: 1, resetPage: 1, init: 1 })) {\n log('Trigger event: ' + triggerEventDesc)\n }\n }\n\n function isDoubleFiredEvent() {\n return triggerLocked && triggerEvent in doubleEventList\n }\n\n if (isDoubleFiredEvent()) {\n log('Trigger event cancelled: ' + triggerEvent)\n } else {\n recordTrigger()\n if (triggerEvent === 'init') {\n sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth)\n } else {\n sizeIFrameThrottled(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth\n )\n }\n }\n }\n\n function lockTrigger() {\n if (!triggerLocked) {\n triggerLocked = true\n log('Trigger event lock on')\n }\n clearTimeout(triggerLockedTimer)\n triggerLockedTimer = setTimeout(function () {\n triggerLocked = false\n log('Trigger event lock off')\n log('--')\n }, eventCancelTimer)\n }\n\n function triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMsg(height, width, triggerEvent)\n }\n\n function resetIFrame(triggerEventDesc) {\n var hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log('Reset trigger event: ' + triggerEventDesc)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n }\n\n function sendMsg(height, width, triggerEvent, msg, targetOrigin) {\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n } else {\n log('Message targetOrigin: ' + targetOrigin)\n }\n }\n\n function sendToParent() {\n var size = height + ':' + width,\n message =\n myID +\n ':' +\n size +\n ':' +\n triggerEvent +\n (undefined === msg ? '' : ':' + msg)\n\n log('Sending message to host page (' + message + ')')\n target.postMessage(msgID + message, targetOrigin)\n }\n\n if (true === sendPermit) {\n setTargetOrigin()\n sendToParent()\n }\n }\n\n function receiver(event) {\n var processRequestFromParent = {\n init: function initFromParent() {\n initMsg = event.data\n target = event.source\n\n init()\n firstRun = false\n setTimeout(function () {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset: function resetFromParent() {\n if (initLock) {\n log('Page reset ignored by init')\n } else {\n log('Page size reset by host page')\n triggerReset('resetPage')\n }\n },\n\n resize: function resizeFromParent() {\n sendSize('resizeParent', 'Parent window requested size check')\n },\n\n moveToAnchor: function moveToAnchorF() {\n inPageLinks.findTarget(getData())\n },\n inPageLink: function inPageLinkF() {\n this.moveToAnchor()\n }, // Backward compatibility\n\n pageInfo: function pageInfoFromParent() {\n var msgBody = getData()\n log('PageInfoFromParent called from parent: ' + msgBody)\n onPageInfo(JSON.parse(msgBody))\n log(' --')\n },\n\n message: function messageFromParent() {\n var msgBody = getData()\n\n log('onMessage called from parent: ' + msgBody)\n // eslint-disable-next-line sonarjs/no-extra-arguments\n onMessage(JSON.parse(msgBody))\n log(' --')\n }\n }\n\n function isMessageForUs() {\n return msgID === ('' + event.data).slice(0, msgIdLen) // ''+ Protects against non-string messages\n }\n\n function getMessageType() {\n return event.data.split(']')[1].split(':')[0]\n }\n\n function getData() {\n return event.data.slice(event.data.indexOf(':') + 1)\n }\n\n function isMiddleTier() {\n return (\n (!(typeof module !== 'undefined' && module.exports) &&\n 'iFrameResize' in window) ||\n (window.jQuery !== undefined &&\n 'iFrameResize' in window.jQuery.prototype)\n )\n }\n\n function isInitMsg() {\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibility.\n return event.data.split(':')[2] in { true: 1, false: 1 }\n }\n\n function callFromParent() {\n var messageType = getMessageType()\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n } else if (!isMiddleTier() && !isInitMsg()) {\n warn('Unexpected message (' + event.data + ')')\n }\n }\n\n function processMessage() {\n if (false === firstRun) {\n callFromParent()\n } else if (isInitMsg()) {\n processRequestFromParent.init()\n } else {\n log(\n 'Ignored message of type \"' +\n getMessageType() +\n '\". Received before initialization.'\n )\n }\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n }\n\n // Normally the parent kicks things off when it detects the iFrame has loaded.\n // If this script is async-loaded, then tell parent page to retry init.\n function chkLateLoaded() {\n if ('loading' !== document.readyState) {\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\n }\n }\n\n // Setup if not already running\n if (!('iframeResizer' in window)) {\n window.iframeChildListener = function (data) {\n receiver({ data, sameDomian: true })\n }\n addEventListener(window, 'message', receiver)\n addEventListener(window, 'readystatechange', chkLateLoaded)\n chkLateLoaded()\n }\n\n \n})()\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/ForumApplication');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ModalManager');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostMeta');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionPage');","import 'iframe-resizer/js/iframeResizer.contentWindow.js';\nimport { override, extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Stream from 'flarum/common/utils/Stream';\nimport ForumApplication from 'flarum/forum/ForumApplication';\nimport ModalManager from 'flarum/common/components/ModalManager';\nimport PostMeta from 'flarum/forum/components/PostMeta';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nextend(ForumApplication.prototype, 'mount', function () {\n if (m.route.param('hideFirstPost')) {\n extend('flarum/forum/components/PostStream', 'view', vdom => {\n if (vdom.children[0].attrs['data-number'] === 1) {\n vdom.children.splice(0, 1);\n }\n });\n }\n});\noverride(m.route.Link, 'view', function (original, vnode) {\n vnode.attrs.href = vnode.attrs.href.replace('/embed', '/d');\n vnode.attrs.target = '_blank';\n // TODO: If href leads to a post within this discussion that we have\n // already loaded, then scroll to it?\n return original(vnode);\n});\n\n// Trim the /embed prefix off of post permalinks\noverride(PostMeta.prototype, 'getPermalink', (original, post) => {\n return original(post).replace('/embed', '/d');\n});\napp.pageInfo = Stream({});\nconst reposition = function () {\n const info = app.pageInfo();\n this.$().css('top', Math.max(0, info.scrollTop - info.offsetTop));\n};\nextend(ModalManager.prototype, 'show', reposition);\nextend('flarum/forum/components/Composer', 'show', reposition);\nwindow.iFrameResizer = {\n readyCallback: function () {\n window.parentIFrame.getPageInfo(app.pageInfo);\n }\n};\nextend('flarum/forum/components/PostStream', 'goToNumber', function (promise, number) {\n if (number === 'reply' && 'parentIFrame' in window && app.composer.isFullScreen()) {\n const itemTop = this.$('.PostStream-item:last').offset().top;\n window.parentIFrame.scrollToOffset(0, itemTop);\n }\n});\nextend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n items.remove('scrubber');\n const count = this.discussion.replyCount();\n items.add('replies', m(\"h3\", null, m(\"a\", {\n route: app.route.discussion(this.discussion).replace('/embed', '/d')\n }, count, \" comment\", count == 1 ? '' : 's')), 100);\n const attrs = items.get('controls').attrs;\n attrs.className = attrs.className.replace('App-primaryControl', '');\n});\napp.routes['discussion'] = {\n path: '/embed/:id',\n component: DiscussionPage\n};\napp.routes['discussion.near'] = {\n path: '/embed/:id/:near',\n component: DiscussionPage\n};"],"names":["undefined","window","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateWidth","doubleEventList","resize","click","eventCancelTimer","firstRun","height","heightCalcModeDefault","heightCalcMode","initLock","initMsg","inPageLinks","interval","intervalTimer","logging","mouseEvents","msgID","myID","resetRequiredMethods","max","min","bodyScroll","documentElementScroll","resizeFrom","target","parent","targetOriginDefault","tolerance","triggerLocked","triggerLockedTimer","throttledTimer","width","widthCalcModeDefault","widthCalcMode","win","onMessage","warn","onReady","onPageInfo","customCalcMethods","document","documentElement","offsetHeight","body","scrollWidth","eventHandlersByName","passiveSupported","options","Object","create","passive","get","addEventListener","noop","removeEventListener","error","func","context","args","result","timeout","previous","later","getHeight","bodyOffset","getComputedStyle","offset","scrollHeight","custom","documentElementOffset","Math","apply","getAllMeasurements","grow","lowestElement","getMaxElement","getAllElements","taggedElement","getTaggedElements","getWidth","offsetWidth","scroll","rightMostElement","sizeIFrameThrottled","sizeIFrame","Date","now","remaining","this","arguments","clearTimeout","setTimeout","iframeChildListener","data","receiver","sameDomian","chkLateLoaded","el","evt","capitalizeFirstLetter","string","charAt","toUpperCase","slice","formatLogMsg","msg","log","console","init","clearFix","value","strBool","str","split","Number","enable","readDataFromParent","location","href","setupCustomCalcMethods","calcMode","calcFunc","iFrameResizer","constructor","JSON","stringify","keys","forEach","depricate","targetOrigin","heightCalculationMethod","widthCalculationMethod","readDataFromPage","setBodyStyle","indexOf","createElement","style","clear","display","appendChild","checkHeightMode","checkWidthMode","parentIFrame","startEventListeners","manageEventListeners","disconnect","clearInterval","sendMsg","close","getId","getPageInfo","callback","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollTo","x","y","scrollToOffset","sendMessage","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","size","customHeight","customWidth","sendSize","sendMouse","e","type","screenY","screenX","addMouseListener","name","setupMouseEvents","getElementPosition","elPosition","getBoundingClientRect","pagePosition","pageXOffset","scrollLeft","pageYOffset","scrollTop","parseInt","left","top","hashData","decodeURIComponent","getElementById","getElementsByName","jumpPosition","jumpToTarget","checkLocationHash","Array","prototype","querySelectorAll","call","getAttribute","preventDefault","setupInPageLinks","key","splitName","length","attr","manageTriggerEvent","listener","add","eventName","handleEvent","eventType","remove","eventNames","map","method","checkCalcMode","calcModeDefault","modes","forceIntervalTimer","MutationObserver","WebKitMutationObserver","initInterval","addImageLoadListners","mutation","addImageLoadListener","element","complete","src","imageLoaded","imageError","elements","push","attributeName","removeImageLoadListener","splice","removeFromArray","imageEventTriggered","event","typeDesc","mutationObserved","mutations","observer","querySelector","observe","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","createMutationObserver","setupBodyMutationObserver","setInterval","abs","prop","retVal","defaultView","side","elementsLength","elVal","maxVal","Side","timer","i","chkEventThottle","dimensions","tag","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolarance","a","b","isSizeChangeDetected","lockTrigger","resetPage","triggerReset","hcm","message","postMessage","messageType","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parse","getMessageType","isInitMsg","true","false","module","exports","jQuery","readyState","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","defineProperty","enumerable","obj","hasOwnProperty","flarum","reg","extend","m","route","param","vdom","children","attrs","override","Link","original","vnode","replace","post","reposition","info","$","css","offsetTop","readyCallback","promise","number","isFullScreen","itemTop","items","count","discussion","replyCount","className","path","component"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"sBAWC,SAAWA,GACV,GAAsB,oBAAXC,OAAX,CAEA,IAAIC,GAAa,EAEfC,EAAiB,GACjBC,EAAa,EACbC,EAAgB,GAChBC,EAAe,KACfC,EAAc,GACdC,GAAiB,EACjBC,EAAkB,CAAEC,OAAQ,EAAGC,MAAO,GACtCC,EAAmB,IACnBC,GAAW,EACXC,EAAS,EACTC,EAAwB,aACxBC,EAAiBD,EACjBE,GAAW,EACXC,EAAU,GACVC,EAAc,CAAC,EACfC,EAAW,GACXC,EAAgB,KAChBC,GAAU,EACVC,GAAc,EACdC,EAAQ,gBAERC,EAAO,GACPC,EAAuB,CACrBC,IAAK,EACLC,IAAK,EACLC,WAAY,EACZC,sBAAuB,GAEzBC,EAAa,QAEbC,EAAS/B,OAAOgC,OAChBC,EAAsB,IACtBC,EAAY,EACZC,GAAgB,EAChBC,EAAqB,KACrBC,EAAiB,GACjBC,EAAQ,EACRC,EAAuB,SACvBC,EAAgBD,EAChBE,EAAMzC,OACN0C,EAAY,WACVC,GAAK,iCACP,EACAC,EAAU,WAAa,EACvBC,EAAa,WAAa,EAC1BC,EAAoB,CAClBjC,OAAQ,WAEN,OAD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IAAAH,UAAS,cAAoB,gBAAgB,CAACE,EAAUG,IAC/CH,EAASG,GAAMD,QAAQ,SAAU,QAE1C,aAAe,IAAO,CAAC,GACvB,MAAME,EAAa,WACjB,MAAMC,EAAO,eACblP,KAAKmP,IAAIC,IAAI,MAAOtQ,KAAKnD,IAAI,EAAGuT,EAAKlJ,UAAYkJ,EAAKG,WACxD,GACA,IAAAjB,QAAO,cAAwB,OAAQa,IACvC,IAAAb,QAAO,mCAAoC,OAAQa,GACnDhV,OAAOiI,cAAgB,CACrBoN,cAAe,WACbrV,OAAOqJ,aAAaQ,YAAY,aAClC,IAEF,IAAAsK,QAAO,qCAAsC,cAAc,SAAUmB,EAASC,GAC5E,GAAe,UAAXA,GAAsB,iBAAkBvV,QAAU,aAAawV,eAAgB,CACjF,MAAMC,EAAU1P,KAAKmP,EAAE,yBAAyBzQ,SAASyH,IACzDlM,OAAOqJ,aAAakB,eAAe,EAAGkL,EACxC,CACF,KACA,IAAAtB,QAAO,cAA0B,gBAAgB,SAAUuB,GACzDA,EAAM/H,OAAO,YACb,MAAMgI,EAAQ5P,KAAK6P,WAAWC,aAC9BH,EAAMnI,IAAI,UAAW6G,EAAE,KAAM,KAAMA,EAAE,IAAK,CACxCC,MAAO,UAAUuB,WAAW7P,KAAK6P,YAAYd,QAAQ,SAAU,OAC9Da,EAAO,WAAqB,GAATA,EAAa,GAAK,MAAO,KAC/C,MAAMlB,EAAQiB,EAAMhS,IAAI,YAAY+Q,MACpCA,EAAMqB,UAAYrB,EAAMqB,UAAUhB,QAAQ,qBAAsB,GAClE,IACA,WAAuB,WAAI,CACzBiB,KAAM,aACNC,UAAW,KAEb,WAAW,mBAAqB,CAC9BD,KAAM,mBACNC,UAAW,I","sources":["webpack://@flarum/embed/../../../node_modules/iframe-resizer/js/iframeResizer.contentWindow.js","webpack://@flarum/embed/webpack/bootstrap","webpack://@flarum/embed/webpack/runtime/compat get default export","webpack://@flarum/embed/webpack/runtime/define property getters","webpack://@flarum/embed/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/ForumApplication')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'common/components/ModalManager')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/components/PostMeta')\"","webpack://@flarum/embed/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/embed/./src/forum/index.js"],"sourcesContent":["/*\n * File: iframeResizer.contentWindow.js\n * Desc: Include this file in any page being loaded into an iframe\n * to force the iframe to resize to the content size.\n * Requires: iframeResizer.js on host page.\n * Doc: https://iframe-resizer.com\n * Author: David J. Bradshaw - info@iframe-resizer.com\n *\n */\n\n// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names\n;(function (undefined) {\n if (typeof window === 'undefined') return // don't run for server side render\n\n var autoResize = true,\n base = 10,\n bodyBackground = '',\n bodyMargin = 0,\n bodyMarginStr = '',\n bodyObserver = null,\n bodyPadding = '',\n calculateWidth = false,\n doubleEventList = { resize: 1, click: 1 },\n eventCancelTimer = 128,\n firstRun = true,\n height = 1,\n heightCalcModeDefault = 'bodyOffset',\n heightCalcMode = heightCalcModeDefault,\n initLock = true,\n initMsg = '',\n inPageLinks = {},\n interval = 32,\n intervalTimer = null,\n logging = false,\n mouseEvents = false,\n msgID = '[iFrameSizer]', // Must match host page msg ID\n msgIdLen = msgID.length,\n myID = '',\n resetRequiredMethods = {\n max: 1,\n min: 1,\n bodyScroll: 1,\n documentElementScroll: 1\n },\n resizeFrom = 'child',\n sendPermit = true,\n target = window.parent,\n targetOriginDefault = '*',\n tolerance = 0,\n triggerLocked = false,\n triggerLockedTimer = null,\n throttledTimer = 16,\n width = 1,\n widthCalcModeDefault = 'scroll',\n widthCalcMode = widthCalcModeDefault,\n win = window,\n onMessage = function () {\n warn('onMessage function not defined')\n },\n onReady = function () {},\n onPageInfo = function () {},\n customCalcMethods = {\n height: function () {\n warn('Custom height calculation function not defined')\n return document.documentElement.offsetHeight\n },\n width: function () {\n warn('Custom width calculation function not defined')\n return document.body.scrollWidth\n }\n },\n eventHandlersByName = {},\n passiveSupported = false\n\n function noop() {}\n\n try {\n var options = Object.create(\n {},\n {\n passive: {\n // eslint-disable-next-line getter-return\n get: function () {\n passiveSupported = true\n }\n }\n }\n )\n window.addEventListener('test', noop, options)\n window.removeEventListener('test', noop, options)\n } catch (error) {\n /* */\n }\n\n function addEventListener(el, evt, func, options) {\n el.addEventListener(evt, func, passiveSupported ? options || {} : false)\n }\n\n function removeEventListener(el, evt, func) {\n el.removeEventListener(evt, func, false)\n }\n\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1)\n }\n\n // Based on underscore.js\n function throttle(func) {\n var context,\n args,\n result,\n timeout = null,\n previous = 0,\n later = function () {\n previous = Date.now()\n timeout = null\n result = func.apply(context, args)\n if (!timeout) {\n // eslint-disable-next-line no-multi-assign\n context = args = null\n }\n }\n\n return function () {\n var now = Date.now()\n\n if (!previous) {\n previous = now\n }\n\n var remaining = throttledTimer - (now - previous)\n\n context = this\n args = arguments\n\n if (remaining <= 0 || remaining > throttledTimer) {\n if (timeout) {\n clearTimeout(timeout)\n timeout = null\n }\n\n previous = now\n result = func.apply(context, args)\n\n if (!timeout) {\n // eslint-disable-next-line no-multi-assign\n context = args = null\n }\n } else if (!timeout) {\n timeout = setTimeout(later, remaining)\n }\n\n return result\n }\n }\n\n function formatLogMsg(msg) {\n return msgID + '[' + myID + '] ' + msg\n }\n\n function log(msg) {\n if (logging && 'object' === typeof window.console) {\n // eslint-disable-next-line no-console\n console.log(formatLogMsg(msg))\n }\n }\n\n function warn(msg) {\n if ('object' === typeof window.console) {\n // eslint-disable-next-line no-console\n console.warn(formatLogMsg(msg))\n }\n }\n\n function init() {\n readDataFromParent()\n log('Initialising iFrame (' + window.location.href + ')')\n readDataFromPage()\n setMargin()\n setBodyStyle('background', bodyBackground)\n setBodyStyle('padding', bodyPadding)\n injectClearFixIntoBodyElement()\n checkHeightMode()\n checkWidthMode()\n stopInfiniteResizingOfIFrame()\n setupPublicMethods()\n setupMouseEvents()\n startEventListeners()\n inPageLinks = setupInPageLinks()\n sendSize('init', 'Init message from host page')\n onReady()\n }\n\n function readDataFromParent() {\n function strBool(str) {\n return 'true' === str\n }\n\n var data = initMsg.slice(msgIdLen).split(':')\n\n myID = data[0]\n bodyMargin = undefined === data[1] ? bodyMargin : Number(data[1]) // For V1 compatibility\n calculateWidth = undefined === data[2] ? calculateWidth : strBool(data[2])\n logging = undefined === data[3] ? logging : strBool(data[3])\n interval = undefined === data[4] ? interval : Number(data[4])\n autoResize = undefined === data[6] ? autoResize : strBool(data[6])\n bodyMarginStr = data[7]\n heightCalcMode = undefined === data[8] ? heightCalcMode : data[8]\n bodyBackground = data[9]\n bodyPadding = data[10]\n tolerance = undefined === data[11] ? tolerance : Number(data[11])\n inPageLinks.enable = undefined === data[12] ? false : strBool(data[12])\n resizeFrom = undefined === data[13] ? resizeFrom : data[13]\n widthCalcMode = undefined === data[14] ? widthCalcMode : data[14]\n mouseEvents = undefined === data[15] ? mouseEvents : strBool(data[15])\n }\n\n function depricate(key) {\n var splitName = key.split('Callback')\n\n if (splitName.length === 2) {\n var name =\n 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1)\n this[name] = this[key]\n delete this[key]\n warn(\n \"Deprecated: '\" +\n key +\n \"' has been renamed '\" +\n name +\n \"'. The old method will be removed in the next major version.\"\n )\n }\n }\n\n function readDataFromPage() {\n function readData() {\n var data = window.iFrameResizer\n\n log('Reading data from page: ' + JSON.stringify(data))\n Object.keys(data).forEach(depricate, data)\n\n onMessage = 'onMessage' in data ? data.onMessage : onMessage\n onReady = 'onReady' in data ? data.onReady : onReady\n targetOriginDefault =\n 'targetOrigin' in data ? data.targetOrigin : targetOriginDefault\n heightCalcMode =\n 'heightCalculationMethod' in data\n ? data.heightCalculationMethod\n : heightCalcMode\n widthCalcMode =\n 'widthCalculationMethod' in data\n ? data.widthCalculationMethod\n : widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if ('function' === typeof calcMode) {\n log('Setup custom ' + calcFunc + 'CalcMethod')\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (\n 'iFrameResizer' in window &&\n Object === window.iFrameResizer.constructor\n ) {\n readData()\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n }\n\n log('TargetOrigin for parent set to: ' + targetOriginDefault)\n }\n\n function chkCSS(attr, value) {\n if (-1 !== value.indexOf('-')) {\n warn('Negative CSS value ignored for ' + attr)\n value = ''\n }\n return value\n }\n\n function setBodyStyle(attr, value) {\n if (undefined !== value && '' !== value && 'null' !== value) {\n document.body.style[attr] = value\n log('Body ' + attr + ' set to \"' + value + '\"')\n }\n }\n\n function setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = bodyMargin + 'px'\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n }\n\n function stopInfiniteResizingOfIFrame() {\n document.documentElement.style.height = ''\n document.body.style.height = ''\n log('HTML & body height set to \"auto\"')\n }\n\n function manageTriggerEvent(options) {\n var listener = {\n add: function (eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove: function (eventName) {\n var handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n }\n }\n\n if (options.eventNames && Array.prototype.map) {\n options.eventName = options.eventNames[0]\n options.eventNames.map(listener[options.method])\n } else {\n listener[options.method](options.eventName)\n }\n\n log(\n capitalizeFirstLetter(options.method) +\n ' event listener: ' +\n options.eventType\n )\n }\n\n function manageEventListeners(method) {\n manageTriggerEvent({\n method: method,\n eventType: 'Animation Start',\n eventNames: ['animationstart', 'webkitAnimationStart']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Animation Iteration',\n eventNames: ['animationiteration', 'webkitAnimationIteration']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Animation End',\n eventNames: ['animationend', 'webkitAnimationEnd']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Input',\n eventName: 'input'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Mouse Up',\n eventName: 'mouseup'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Mouse Down',\n eventName: 'mousedown'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Orientation Change',\n eventName: 'orientationchange'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Print',\n eventNames: ['afterprint', 'beforeprint']\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch Start',\n eventName: 'touchstart'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch End',\n eventName: 'touchend'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Touch Cancel',\n eventName: 'touchcancel'\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition Start',\n eventNames: [\n 'transitionstart',\n 'webkitTransitionStart',\n 'MSTransitionStart',\n 'oTransitionStart',\n 'otransitionstart'\n ]\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition Iteration',\n eventNames: [\n 'transitioniteration',\n 'webkitTransitionIteration',\n 'MSTransitionIteration',\n 'oTransitionIteration',\n 'otransitioniteration'\n ]\n })\n manageTriggerEvent({\n method: method,\n eventType: 'Transition End',\n eventNames: [\n 'transitionend',\n 'webkitTransitionEnd',\n 'MSTransitionEnd',\n 'oTransitionEnd',\n 'otransitionend'\n ]\n })\n if ('child' === resizeFrom) {\n manageTriggerEvent({\n method: method,\n eventType: 'IFrame Resized',\n eventName: 'resize'\n })\n }\n }\n\n function checkCalcMode(calcMode, calcModeDefault, modes, type) {\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(\n calcMode + ' is not a valid option for ' + type + 'CalculationMethod.'\n )\n calcMode = calcModeDefault\n }\n log(type + ' calculation method set to \"' + calcMode + '\"')\n }\n\n return calcMode\n }\n\n function checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n 'height'\n )\n }\n\n function checkWidthMode() {\n widthCalcMode = checkCalcMode(\n widthCalcMode,\n widthCalcModeDefault,\n getWidth,\n 'width'\n )\n }\n\n function startEventListeners() {\n if (true === autoResize) {\n manageEventListeners('add')\n setupMutationObserver()\n } else {\n log('Auto Resize disabled')\n }\n }\n\n // function stopMsgsToParent() {\n // log('Disable outgoing messages')\n // sendPermit = false\n // }\n\n // function removeMsgListener() {\n // log('Remove event listener: Message')\n // removeEventListener(window, 'message', receiver)\n // }\n\n function disconnectMutationObserver() {\n if (null !== bodyObserver) {\n /* istanbul ignore next */ // Not testable in PhantonJS\n bodyObserver.disconnect()\n }\n }\n\n function stopEventListeners() {\n manageEventListeners('remove')\n disconnectMutationObserver()\n clearInterval(intervalTimer)\n }\n\n // function teardown() {\n // stopMsgsToParent()\n // removeMsgListener()\n // if (true === autoResize) stopEventListeners()\n // }\n\n function injectClearFixIntoBodyElement() {\n var clearFix = document.createElement('div')\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n document.body.appendChild(clearFix)\n }\n\n function setupInPageLinks() {\n function getPagePosition() {\n return {\n x:\n window.pageXOffset === undefined\n ? document.documentElement.scrollLeft\n : window.pageXOffset,\n y:\n window.pageYOffset === undefined\n ? document.documentElement.scrollTop\n : window.pageYOffset\n }\n }\n\n function getElementPosition(el) {\n var elPosition = el.getBoundingClientRect(),\n pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, 10) + parseInt(pagePosition.x, 10),\n y: parseInt(elPosition.top, 10) + parseInt(pagePosition.y, 10)\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n var jumpPosition = getElementPosition(target)\n\n log(\n 'Moving to in page link (#' +\n hash +\n ') at x: ' +\n jumpPosition.x +\n ' y: ' +\n jumpPosition.y\n )\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n }\n\n var hash = location.split('#')[1] || location, // Remove # if present\n hashData = decodeURIComponent(hash),\n target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (undefined === target) {\n log(\n 'In page link (#' +\n hash +\n ') not found in iFrame, so sending to parent'\n )\n sendMsg(0, 0, 'inPageLink', '#' + hash)\n } else {\n jumpToTarget(target)\n }\n }\n\n function checkLocationHash() {\n var hash = window.location.hash\n var href = window.location.href\n\n if ('' !== hash && '#' !== hash) {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n function setupLink(el) {\n function linkClicked(e) {\n e.preventDefault()\n\n /* jshint validthis:true */\n findTarget(this.getAttribute('href'))\n }\n\n if ('#' !== el.getAttribute('href')) {\n addEventListener(el, 'click', linkClicked)\n }\n }\n\n Array.prototype.forEach.call(\n document.querySelectorAll('a[href^=\"#\"]'),\n setupLink\n )\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n /* istanbul ignore else */ // Not testable in phantonJS\n if (Array.prototype.forEach && document.querySelectorAll) {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n } else {\n warn(\n 'In page linking not fully supported in this browser! (See README.md for IE8 workaround)'\n )\n }\n }\n\n if (inPageLinks.enable) {\n enableInPageLinks()\n } else {\n log('In page linking not enabled')\n }\n\n return {\n findTarget: findTarget\n }\n }\n\n function setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMsg(0, 0, e.type, e.screenY + ':' + e.screenX)\n }\n\n function addMouseListener(evt, name) {\n log('Add event listener: ' + name)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n }\n\n function setupPublicMethods() {\n log('Enable public methods')\n\n win.parentIFrame = {\n autoResize: function autoResizeF(resize) {\n if (true === resize && false === autoResize) {\n autoResize = true\n startEventListeners()\n } else if (false === resize && true === autoResize) {\n autoResize = false\n stopEventListeners()\n }\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n return autoResize\n },\n\n close: function closeF() {\n sendMsg(0, 0, 'close')\n // teardown()\n },\n\n getId: function getIdF() {\n return myID\n },\n\n getPageInfo: function getPageInfoF(callback) {\n if ('function' === typeof callback) {\n onPageInfo = callback\n sendMsg(0, 0, 'pageInfo')\n } else {\n onPageInfo = function () {}\n sendMsg(0, 0, 'pageInfoStop')\n }\n },\n\n moveToAnchor: function moveToAnchorF(hash) {\n inPageLinks.findTarget(hash)\n },\n\n reset: function resetF() {\n resetIFrame('parentIFrame.reset')\n },\n\n scrollTo: function scrollToF(x, y) {\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollToOffset: function scrollToF(x, y) {\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n },\n\n sendMessage: function sendMessageF(msg, targetOrigin) {\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod: function setHeightCalculationMethodF(\n heightCalculationMethod\n ) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod: function setWidthCalculationMethodF(\n widthCalculationMethod\n ) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin: function setTargetOriginF(targetOrigin) {\n log('Set targetOrigin: ' + targetOrigin)\n targetOriginDefault = targetOrigin\n },\n\n size: function sizeF(customHeight, customWidth) {\n var valString =\n '' + (customHeight || '') + (customWidth ? ',' + customWidth : '')\n sendSize(\n 'size',\n 'parentIFrame.size(' + valString + ')',\n customHeight,\n customWidth\n )\n }\n }\n }\n\n function initInterval() {\n if (0 !== interval) {\n log('setInterval: ' + interval + 'ms')\n intervalTimer = setInterval(function () {\n sendSize('interval', 'setInterval: ' + interval)\n }, Math.abs(interval))\n }\n }\n\n // Not testable in PhantomJS\n /* istanbul ignore next */\n function setupBodyMutationObserver() {\n function addImageLoadListners(mutation) {\n function addImageLoadListener(element) {\n if (false === element.complete) {\n log('Attach listeners to ' + element.src)\n element.addEventListener('load', imageLoaded, false)\n element.addEventListener('error', imageError, false)\n elements.push(element)\n }\n }\n\n if (mutation.type === 'attributes' && mutation.attributeName === 'src') {\n addImageLoadListener(mutation.target)\n } else if (mutation.type === 'childList') {\n Array.prototype.forEach.call(\n mutation.target.querySelectorAll('img'),\n addImageLoadListener\n )\n }\n }\n\n function removeFromArray(element) {\n elements.splice(elements.indexOf(element), 1)\n }\n\n function removeImageLoadListener(element) {\n log('Remove listeners from ' + element.src)\n element.removeEventListener('load', imageLoaded, false)\n element.removeEventListener('error', imageError, false)\n removeFromArray(element)\n }\n\n function imageEventTriggered(event, type, typeDesc) {\n removeImageLoadListener(event.target)\n sendSize(type, typeDesc + ': ' + event.target.src)\n }\n\n function imageLoaded(event) {\n imageEventTriggered(event, 'imageLoad', 'Image loaded')\n }\n\n function imageError(event) {\n imageEventTriggered(event, 'imageLoadFailed', 'Image load failed')\n }\n\n function mutationObserved(mutations) {\n sendSize(\n 'mutationObserver',\n 'mutationObserver: ' + mutations[0].target + ' ' + mutations[0].type\n )\n\n // Deal with WebKit / Blink asyncing image loading when tags are injected into the page\n mutations.forEach(addImageLoadListners)\n }\n\n function createMutationObserver() {\n var target = document.querySelector('body'),\n config = {\n attributes: true,\n attributeOldValue: false,\n characterData: true,\n characterDataOldValue: false,\n childList: true,\n subtree: true\n }\n\n observer = new MutationObserver(mutationObserved)\n\n log('Create body MutationObserver')\n observer.observe(target, config)\n\n return observer\n }\n\n var elements = [],\n MutationObserver =\n window.MutationObserver || window.WebKitMutationObserver,\n observer = createMutationObserver()\n\n return {\n disconnect: function () {\n if ('disconnect' in observer) {\n log('Disconnect body MutationObserver')\n observer.disconnect()\n elements.forEach(removeImageLoadListener)\n }\n }\n }\n }\n\n function setupMutationObserver() {\n var forceIntervalTimer = 0 > interval\n\n // Not testable in PhantomJS\n /* istanbul ignore if */ if (\n window.MutationObserver ||\n window.WebKitMutationObserver\n ) {\n if (forceIntervalTimer) {\n initInterval()\n } else {\n bodyObserver = setupBodyMutationObserver()\n }\n } else {\n log('MutationObserver not supported in this browser!')\n initInterval()\n }\n }\n\n // document.documentElement.offsetHeight is not reliable, so\n // we have to jump through hoops to get a better value.\n function getComputedStyle(prop, el) {\n var retVal = 0\n el = el || document.body // Not testable in phantonJS\n\n retVal = document.defaultView.getComputedStyle(el, null)\n retVal = null === retVal ? 0 : retVal[prop]\n\n return parseInt(retVal, base)\n }\n\n function chkEventThottle(timer) {\n if (timer > throttledTimer / 2) {\n throttledTimer = 2 * timer\n log('Event throttle increased to ' + throttledTimer + 'ms')\n }\n }\n\n // Idea from https://github.com/guardian/iframe-messenger\n function getMaxElement(side, elements) {\n var elementsLength = elements.length,\n elVal = 0,\n maxVal = 0,\n Side = capitalizeFirstLetter(side),\n timer = Date.now()\n\n for (var i = 0; i < elementsLength; i++) {\n elVal =\n elements[i].getBoundingClientRect()[side] +\n getComputedStyle('margin' + Side, elements[i])\n if (elVal > maxVal) {\n maxVal = elVal\n }\n }\n\n timer = Date.now() - timer\n\n log('Parsed ' + elementsLength + ' HTML elements')\n log('Element position calculated in ' + timer + 'ms')\n\n chkEventThottle(timer)\n\n return maxVal\n }\n\n function getAllMeasurements(dimensions) {\n return [\n dimensions.bodyOffset(),\n dimensions.bodyScroll(),\n dimensions.documentElementOffset(),\n dimensions.documentElementScroll()\n ]\n }\n\n function getTaggedElements(side, tag) {\n function noTaggedElementsFound() {\n warn('No tagged elements (' + tag + ') found on page')\n return document.querySelectorAll('body *')\n }\n\n var elements = document.querySelectorAll('[' + tag + ']')\n\n if (elements.length === 0) noTaggedElementsFound()\n\n return getMaxElement(side, elements)\n }\n\n function getAllElements() {\n return document.querySelectorAll('body *')\n }\n\n var getHeight = {\n bodyOffset: function getBodyOffsetHeight() {\n return (\n document.body.offsetHeight +\n getComputedStyle('marginTop') +\n getComputedStyle('marginBottom')\n )\n },\n\n offset: function () {\n return getHeight.bodyOffset() // Backwards compatibility\n },\n\n bodyScroll: function getBodyScrollHeight() {\n return document.body.scrollHeight\n },\n\n custom: function getCustomWidth() {\n return customCalcMethods.height()\n },\n\n documentElementOffset: function getDEOffsetHeight() {\n return document.documentElement.offsetHeight\n },\n\n documentElementScroll: function getDEScrollHeight() {\n return document.documentElement.scrollHeight\n },\n\n max: function getMaxHeight() {\n return Math.max.apply(null, getAllMeasurements(getHeight))\n },\n\n min: function getMinHeight() {\n return Math.min.apply(null, getAllMeasurements(getHeight))\n },\n\n grow: function growHeight() {\n return getHeight.max() // Run max without the forced downsizing\n },\n\n lowestElement: function getBestHeight() {\n return Math.max(\n getHeight.bodyOffset() || getHeight.documentElementOffset(),\n getMaxElement('bottom', getAllElements())\n )\n },\n\n taggedElement: function getTaggedElementsHeight() {\n return getTaggedElements('bottom', 'data-iframe-height')\n }\n },\n getWidth = {\n bodyScroll: function getBodyScrollWidth() {\n return document.body.scrollWidth\n },\n\n bodyOffset: function getBodyOffsetWidth() {\n return document.body.offsetWidth\n },\n\n custom: function getCustomWidth() {\n return customCalcMethods.width()\n },\n\n documentElementScroll: function getDEScrollWidth() {\n return document.documentElement.scrollWidth\n },\n\n documentElementOffset: function getDEOffsetWidth() {\n return document.documentElement.offsetWidth\n },\n\n scroll: function getMaxWidth() {\n return Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll())\n },\n\n max: function getMaxWidth() {\n return Math.max.apply(null, getAllMeasurements(getWidth))\n },\n\n min: function getMinWidth() {\n return Math.min.apply(null, getAllMeasurements(getWidth))\n },\n\n rightMostElement: function rightMostElement() {\n return getMaxElement('right', getAllElements())\n },\n\n taggedElement: function getTaggedElementsWidth() {\n return getTaggedElements('right', 'data-iframe-width')\n }\n }\n\n function sizeIFrame(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth\n ) {\n function resizeIFrame() {\n height = currentHeight\n width = currentWidth\n\n sendMsg(height, width, triggerEvent)\n }\n\n function isSizeChangeDetected() {\n function checkTolarance(a, b) {\n var retVal = Math.abs(a - b) <= tolerance\n return !retVal\n }\n\n currentHeight =\n undefined === customHeight ? getHeight[heightCalcMode]() : customHeight\n currentWidth =\n undefined === customWidth ? getWidth[widthCalcMode]() : customWidth\n\n return (\n checkTolarance(height, currentHeight) ||\n (calculateWidth && checkTolarance(width, currentWidth))\n )\n }\n\n function isForceResizableEvent() {\n return !(triggerEvent in { init: 1, interval: 1, size: 1 })\n }\n\n function isForceResizableCalcMode() {\n return (\n heightCalcMode in resetRequiredMethods ||\n (calculateWidth && widthCalcMode in resetRequiredMethods)\n )\n }\n\n function logIgnored() {\n log('No change in size detected')\n }\n\n function checkDownSizing() {\n if (isForceResizableEvent() && isForceResizableCalcMode()) {\n resetIFrame(triggerEventDesc)\n } else if (!(triggerEvent in { interval: 1 })) {\n logIgnored()\n }\n }\n\n var currentHeight, currentWidth\n\n if (isSizeChangeDetected() || 'init' === triggerEvent) {\n lockTrigger()\n resizeIFrame()\n } else {\n checkDownSizing()\n }\n }\n\n var sizeIFrameThrottled = throttle(sizeIFrame)\n\n function sendSize(triggerEvent, triggerEventDesc, customHeight, customWidth) {\n function recordTrigger() {\n if (!(triggerEvent in { reset: 1, resetPage: 1, init: 1 })) {\n log('Trigger event: ' + triggerEventDesc)\n }\n }\n\n function isDoubleFiredEvent() {\n return triggerLocked && triggerEvent in doubleEventList\n }\n\n if (isDoubleFiredEvent()) {\n log('Trigger event cancelled: ' + triggerEvent)\n } else {\n recordTrigger()\n if (triggerEvent === 'init') {\n sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth)\n } else {\n sizeIFrameThrottled(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth\n )\n }\n }\n }\n\n function lockTrigger() {\n if (!triggerLocked) {\n triggerLocked = true\n log('Trigger event lock on')\n }\n clearTimeout(triggerLockedTimer)\n triggerLockedTimer = setTimeout(function () {\n triggerLocked = false\n log('Trigger event lock off')\n log('--')\n }, eventCancelTimer)\n }\n\n function triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMsg(height, width, triggerEvent)\n }\n\n function resetIFrame(triggerEventDesc) {\n var hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log('Reset trigger event: ' + triggerEventDesc)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n }\n\n function sendMsg(height, width, triggerEvent, msg, targetOrigin) {\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n } else {\n log('Message targetOrigin: ' + targetOrigin)\n }\n }\n\n function sendToParent() {\n var size = height + ':' + width,\n message =\n myID +\n ':' +\n size +\n ':' +\n triggerEvent +\n (undefined === msg ? '' : ':' + msg)\n\n log('Sending message to host page (' + message + ')')\n target.postMessage(msgID + message, targetOrigin)\n }\n\n if (true === sendPermit) {\n setTargetOrigin()\n sendToParent()\n }\n }\n\n function receiver(event) {\n var processRequestFromParent = {\n init: function initFromParent() {\n initMsg = event.data\n target = event.source\n\n init()\n firstRun = false\n setTimeout(function () {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset: function resetFromParent() {\n if (initLock) {\n log('Page reset ignored by init')\n } else {\n log('Page size reset by host page')\n triggerReset('resetPage')\n }\n },\n\n resize: function resizeFromParent() {\n sendSize('resizeParent', 'Parent window requested size check')\n },\n\n moveToAnchor: function moveToAnchorF() {\n inPageLinks.findTarget(getData())\n },\n inPageLink: function inPageLinkF() {\n this.moveToAnchor()\n }, // Backward compatibility\n\n pageInfo: function pageInfoFromParent() {\n var msgBody = getData()\n log('PageInfoFromParent called from parent: ' + msgBody)\n onPageInfo(JSON.parse(msgBody))\n log(' --')\n },\n\n message: function messageFromParent() {\n var msgBody = getData()\n\n log('onMessage called from parent: ' + msgBody)\n // eslint-disable-next-line sonarjs/no-extra-arguments\n onMessage(JSON.parse(msgBody))\n log(' --')\n }\n }\n\n function isMessageForUs() {\n return msgID === ('' + event.data).slice(0, msgIdLen) // ''+ Protects against non-string messages\n }\n\n function getMessageType() {\n return event.data.split(']')[1].split(':')[0]\n }\n\n function getData() {\n return event.data.slice(event.data.indexOf(':') + 1)\n }\n\n function isMiddleTier() {\n return (\n (!(typeof module !== 'undefined' && module.exports) &&\n 'iFrameResize' in window) ||\n (window.jQuery !== undefined &&\n 'iFrameResize' in window.jQuery.prototype)\n )\n }\n\n function isInitMsg() {\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibility.\n return event.data.split(':')[2] in { true: 1, false: 1 }\n }\n\n function callFromParent() {\n var messageType = getMessageType()\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n } else if (!isMiddleTier() && !isInitMsg()) {\n warn('Unexpected message (' + event.data + ')')\n }\n }\n\n function processMessage() {\n if (false === firstRun) {\n callFromParent()\n } else if (isInitMsg()) {\n processRequestFromParent.init()\n } else {\n log(\n 'Ignored message of type \"' +\n getMessageType() +\n '\". Received before initialization.'\n )\n }\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n }\n\n // Normally the parent kicks things off when it detects the iFrame has loaded.\n // If this script is async-loaded, then tell parent page to retry init.\n function chkLateLoaded() {\n if ('loading' !== document.readyState) {\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\n }\n }\n\n // Setup if not already running\n if (!('iframeResizer' in window)) {\n window.iframeChildListener = function (data) {\n receiver({ data, sameDomian: true })\n }\n addEventListener(window, 'message', receiver)\n addEventListener(window, 'readystatechange', chkLateLoaded)\n chkLateLoaded()\n }\n\n \n})()\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\tflarum.reg._webpack_runtimes[\"flarum-embed\"] ||= __webpack_require__;// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/ForumApplication');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ModalManager');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostMeta');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionPage');","import 'iframe-resizer/js/iframeResizer.contentWindow.js';\nimport { override, extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Stream from 'flarum/common/utils/Stream';\nimport ForumApplication from 'flarum/forum/ForumApplication';\nimport ModalManager from 'flarum/common/components/ModalManager';\nimport PostMeta from 'flarum/forum/components/PostMeta';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nextend(ForumApplication.prototype, 'mount', function () {\n if (m.route.param('hideFirstPost')) {\n extend('flarum/forum/components/PostStream', 'view', vdom => {\n if (vdom.children[0].attrs['data-number'] === 1) {\n vdom.children.splice(0, 1);\n }\n });\n }\n});\noverride(m.route.Link, 'view', function (original, vnode) {\n vnode.attrs.href = vnode.attrs.href.replace('/embed', '/d');\n vnode.attrs.target = '_blank';\n // TODO: If href leads to a post within this discussion that we have\n // already loaded, then scroll to it?\n return original(vnode);\n});\n\n// Trim the /embed prefix off of post permalinks\noverride(PostMeta.prototype, 'getPermalink', (original, post) => {\n return original(post).replace('/embed', '/d');\n});\napp.pageInfo = Stream({});\nconst reposition = function () {\n const info = app.pageInfo();\n this.$().css('top', Math.max(0, info.scrollTop - info.offsetTop));\n};\nextend(ModalManager.prototype, 'show', reposition);\nextend('flarum/forum/components/Composer', 'show', reposition);\nwindow.iFrameResizer = {\n readyCallback: function () {\n window.parentIFrame.getPageInfo(app.pageInfo);\n }\n};\nextend('flarum/forum/components/PostStream', 'goToNumber', function (promise, number) {\n if (number === 'reply' && 'parentIFrame' in window && app.composer.isFullScreen()) {\n const itemTop = this.$('.PostStream-item:last').offset().top;\n window.parentIFrame.scrollToOffset(0, itemTop);\n }\n});\nextend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n items.remove('scrubber');\n const count = this.discussion.replyCount();\n items.add('replies', m(\"h3\", null, m(\"a\", {\n route: app.route.discussion(this.discussion).replace('/embed', '/d')\n }, count, \" comment\", count == 1 ? '' : 's')), 100);\n const attrs = items.get('controls').attrs;\n attrs.className = attrs.className.replace('App-primaryControl', '');\n});\napp.routes['discussion'] = {\n path: '/embed/:id',\n component: DiscussionPage\n};\napp.routes['discussion.near'] = {\n path: '/embed/:id/:near',\n component: DiscussionPage\n};"],"names":["undefined","window","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateWidth","doubleEventList","resize","click","eventCancelTimer","firstRun","height","heightCalcModeDefault","heightCalcMode","initLock","initMsg","inPageLinks","interval","intervalTimer","logging","mouseEvents","msgID","myID","resetRequiredMethods","max","min","bodyScroll","documentElementScroll","resizeFrom","target","parent","targetOriginDefault","tolerance","triggerLocked","triggerLockedTimer","throttledTimer","width","widthCalcModeDefault","widthCalcMode","win","onMessage","warn","onReady","onPageInfo","customCalcMethods","document","documentElement","offsetHeight","body","scrollWidth","eventHandlersByName","passiveSupported","options","Object","create","passive","get","addEventListener","noop","removeEventListener","error","func","context","args","result","timeout","previous","later","getHeight","bodyOffset","getComputedStyle","offset","scrollHeight","custom","documentElementOffset","Math","apply","getAllMeasurements","grow","lowestElement","getMaxElement","getAllElements","taggedElement","getTaggedElements","getWidth","offsetWidth","scroll","rightMostElement","sizeIFrameThrottled","sizeIFrame","Date","now","remaining","this","arguments","clearTimeout","setTimeout","iframeChildListener","data","receiver","sameDomian","chkLateLoaded","el","evt","capitalizeFirstLetter","string","charAt","toUpperCase","slice","formatLogMsg","msg","log","console","init","clearFix","value","strBool","str","split","Number","enable","readDataFromParent","location","href","setupCustomCalcMethods","calcMode","calcFunc","iFrameResizer","constructor","JSON","stringify","keys","forEach","depricate","targetOrigin","heightCalculationMethod","widthCalculationMethod","readDataFromPage","setBodyStyle","indexOf","createElement","style","clear","display","appendChild","checkHeightMode","checkWidthMode","parentIFrame","startEventListeners","manageEventListeners","disconnect","clearInterval","sendMsg","close","getId","getPageInfo","callback","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollTo","x","y","scrollToOffset","sendMessage","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","size","customHeight","customWidth","sendSize","sendMouse","e","type","screenY","screenX","addMouseListener","name","setupMouseEvents","getElementPosition","elPosition","getBoundingClientRect","pagePosition","pageXOffset","scrollLeft","pageYOffset","scrollTop","parseInt","left","top","hashData","decodeURIComponent","getElementById","getElementsByName","jumpPosition","jumpToTarget","checkLocationHash","Array","prototype","querySelectorAll","call","getAttribute","preventDefault","setupInPageLinks","key","splitName","length","attr","manageTriggerEvent","listener","add","eventName","handleEvent","eventType","remove","eventNames","map","method","checkCalcMode","calcModeDefault","modes","forceIntervalTimer","MutationObserver","WebKitMutationObserver","initInterval","addImageLoadListners","mutation","addImageLoadListener","element","complete","src","imageLoaded","imageError","elements","push","attributeName","removeImageLoadListener","splice","removeFromArray","imageEventTriggered","event","typeDesc","mutationObserved","mutations","observer","querySelector","observe","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","createMutationObserver","setupBodyMutationObserver","setInterval","abs","prop","retVal","defaultView","side","elementsLength","elVal","maxVal","Side","timer","i","chkEventThottle","dimensions","tag","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolarance","a","b","isSizeChangeDetected","lockTrigger","resetPage","triggerReset","hcm","message","postMessage","messageType","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parse","getMessageType","isInitMsg","true","false","module","exports","jQuery","readyState","__webpack_module_cache__","__webpack_require__","moduleId","flarum","reg","_webpack_runtimes","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","defineProperty","enumerable","obj","hasOwnProperty","extend","m","route","param","vdom","children","attrs","override","Link","original","vnode","replace","post","reposition","info","$","css","offsetTop","readyCallback","promise","number","isFullScreen","itemTop","items","count","discussion","replyCount","className","path","component"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/emoji/js/dist/forum.js b/extensions/emoji/js/dist/forum.js index a86ae14629..92074b0a1e 100644 --- a/extensions/emoji/js/dist/forum.js +++ b/extensions/emoji/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var d,u,f={},e={};function c(d){var u=e[d];if(void 0!==u)return u.exports;var t=e[d]={exports:{}};return f[d](t,t.exports,c),t.exports}c.m=f,c.n=d=>{var u=d&&d.__esModule?()=>d.default:()=>d;return c.d(u,{a:u}),u},c.d=(d,u)=>{for(var f in u)c.o(u,f)&&!c.o(d,f)&&Object.defineProperty(d,f,{enumerable:!0,get:u[f]})},c.f={},c.e=d=>Promise.all(Object.keys(c.f).reduce(((u,f)=>(c.f[f](d,u),u)),[])),c.u=d=>"forum/emojiMap.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(d){if("object"==typeof window)return window}}(),c.o=(d,u)=>Object.prototype.hasOwnProperty.call(d,u),d={},u="module.exports:",c.l=(f,e,t,o)=>{if(d[f])d[f].push(e);else{var r,n;if(void 0!==t)for(var a=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(l);var c=d[f];if(delete d[f],r.parentNode&&r.parentNode.removeChild(r),c&&c.forEach((d=>d(e))),u)return u(e)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=b.bind(null,r.onerror),r.onload=b.bind(null,r.onload),n&&document.head.appendChild(r)}},c.r=d=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},(()=>{var d;c.g.importScripts&&(d=c.g.location+"");var u=c.g.document;if(!d&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(d=u.currentScript.src),!d)){var f=u.getElementsByTagName("script");if(f.length)for(var e=f.length-1;e>-1&&(!d||!/^http(s?):/.test(d));)d=f[e--].src}if(!d)throw new Error("Automatic publicPath is not supported in this browser");d=d.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=d})(),c.f.compat=(d,u)=>{const f=c.l;c.l=flarum.reg.loadChunk.bind(flarum.reg,f)},(()=>{var d={170:0};c.f.j=(u,f)=>{var e=c.o(d,u)?d[u]:void 0;if(0!==e)if(e)f.push(e[2]);else{var t=new Promise(((f,c)=>e=d[u]=[f,c]));f.push(e[2]=t);var o=c.p+c.u(u),r=new Error;c.l(o,(f=>{if(c.o(d,u)&&(0!==(e=d[u])&&(d[u]=void 0),e)){var t=f&&("load"===f.type?"missing":f.type),o=f&&f.target&&f.target.src;r.message="Loading chunk "+u+" failed.\n("+t+": "+o+")",r.name="ChunkLoadError",r.type=t,r.request=o,e[1](r)}}),"chunk-"+u,u)}};var u=(u,f)=>{var e,t,[o,r,n]=f,a=0;if(o.some((u=>0!==d[u]))){for(e in r)c.o(r,e)&&(c.m[e]=r[e]);n&&n(c)}for(u&&u(f);a{"use strict";const d=flarum.reg.get("core","forum/app");var u=c.n(d);const f=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","common/components/TextEditorButton");var t=c.n(e);const o=flarum.reg.get("core","common/utils/KeyboardNavigatable");var r=c.n(o);const n=flarum.reg.get("core","common/components/Tooltip");var a=c.n(n);const i=flarum.reg.get("core","common/utils/AutocompleteReader");var s=c.n(i);function b(d){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"==typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},b(d)}function l(d,u,f){return(u=function(d){var u=function(d){if("object"!=b(d)||!d)return d;var u=d[Symbol.toPrimitive];if(void 0!==u){var f=u.call(d,"string");if("object"!=b(f))return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(d)}(d);return"symbol"==b(u)?u:u+""}(u))in d?Object.defineProperty(d,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[u]=f,d}const p=flarum.reg.get("core","common/Fragment");var h=c.n(p);class g extends(h()){constructor(){super(...arguments),l(this,"items",[]),l(this,"active",!1),l(this,"index",0),l(this,"keyWasJustPressed",!1)}view(){return m("ul",{className:"Dropdown-menu EmojiDropdown"},m("li",{className:"Dropdown-header"},app.translator.trans("flarum-emoji.forum.composer.type_to_search_text")),this.items.map((d=>m("li",{key:d.attrs.key},d))))}show(d,u){this.$().show().css({left:d+"px",top:u+"px"}),this.active=!0}hide(){this.$().hide(),this.active=!1}navigate(d){this.keyWasJustPressed=!0,this.setIndex(this.index+d,!0),clearTimeout(this.keyWasJustPressedTimeout),this.keyWasJustPressedTimeout=setTimeout((()=>this.keyWasJustPressed=!1),500)}complete(){this.$("li:not(.Dropdown-header)").eq(this.index).find("button").click()}setIndex(d,u){if(this.keyWasJustPressed&&!u)return;const f=this.$(),e=f.find("li:not(.Dropdown-header)");let c=d;c<0?c=e.length-1:c>=e.length&&(c=0),this.index=c;const t=e.removeClass("active").eq(c).addClass("active");if(u){const d=f.scrollTop(),u=f.offset().top,e=u+f.outerHeight(),c=t.offset().top,o=c+t.outerHeight();let r;ce&&(r=d-e+o+parseInt(f.css("padding-bottom"),10)),void 0!==r&&f.stop(!0).animate({scrollTop:r},100)}}}flarum.reg.add("flarum-emoji","forum/fragments/AutocompleteDropdown",g);var v=function(){var d={base:"https://twemoji.maxcdn.com/v/14.0.2/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:function(d){var u="string"==typeof d?parseInt(d,16):d;return u<65536?r(u):r(55296+((u-=65536)>>10),56320+(1023&u))},toCodePoint:g},onerror:function(){this.parentNode&&this.parentNode.replaceChild(n(this.alt,!1),this)},parse:function(u,f){return f&&"function"!=typeof f||(f={callback:f}),("string"==typeof u?l:b)(u,{callback:f.callback||a,attributes:"function"==typeof f.attributes?f.attributes:p,base:"string"==typeof f.base?f.base:d.base,ext:f.ext||d.ext,size:f.folder||(e=f.size||d.size,"number"==typeof e?e+"x"+e:e),className:f.className||d.className,onerror:f.onerror||d.onerror});var e},replace:h,test:function(d){f.lastIndex=0;var u=f.test(d);return f.lastIndex=0,u}},u={"&":"&","<":"<",">":">","'":"'",'"':"""},f=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef6]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,e=/\uFE0F/g,c=String.fromCharCode(8205),t=/[&<>'"]/g,o=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,r=String.fromCharCode;return d;function n(d,u){return document.createTextNode(u?d.replace(e,""):d)}function a(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function i(d,u){for(var f,e,c=d.childNodes,t=c.length;t--;)3===(e=(f=c[t]).nodeType)?u.push(f):1!==e||"ownerSVGElement"in f||o.test(f.nodeName.toLowerCase())||i(f,u);return u}function s(d){return g(d.indexOf(c)<0?d.replace(e,""):d)}function b(d,u){for(var e,c,t,o,r,a,b,l,m,p,h,g,v,w=i(d,[]),y=w.length;y--;){for(t=!1,o=document.createDocumentFragment(),a=(r=w[y]).nodeValue,l=0;b=f.exec(a);){if((m=b.index)!==l&&o.appendChild(n(a.slice(l,m),!0)),g=s(h=b[0]),l=m+h.length,v=u.callback(g,u),g&&v){for(c in(p=new Image).onerror=u.onerror,p.setAttribute("draggable","false"),e=u.attributes(h,g))e.hasOwnProperty(c)&&0!==c.indexOf("on")&&!p.hasAttribute(c)&&p.setAttribute(c,e[c]);p.className=u.className,p.alt=h,p.src=v,t=!0,o.appendChild(p)}p||o.appendChild(n(h,!1)),p=null}t&&(l")}return c}))}function m(d){return u[d]}function p(){return null}function h(d,u){return String(d).replace(f,u)}function g(d,u){for(var f=[],e=0,c=0,t=0;t({loading:"lazy"})}}u().initializers.add("flarum-emoji",(()=>{!function(){let d=null;(0,f.extend)("flarum/common/components/TextEditor","oninit",(function(){this._loaders.push((async()=>await c.e(101).then(c.bind(c,232)).then((u=>d=u.default)))),this.commonEmoji=["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐️","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😮‍💨","😯","😰","😱","😲","😳","😴","😵","😵‍💫","😶","😶‍🌫️","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄"]})),(0,f.extend)("flarum/common/components/TextEditor","onbuild",(function(){this.emojiDropdown=new g;const d=this.$(".TextEditor-editor").wrap('
');this.navigator=new(r()),this.navigator.when((()=>this.emojiDropdown.active)).onUp((()=>this.emojiDropdown.navigate(-1))).onDown((()=>this.emojiDropdown.navigate(1))).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo(d),d.after($('
'))})),(0,f.extend)("flarum/common/components/TextEditor","buildEditorParams",(function(u){const f=Object.keys(d),e=k(),c=new(s())(":");u.inputListeners.push((()=>{const u=this.attrs.composer.editor.getSelectionRange(),t=u[0];if(u[1]-t>0)return;const o=this.attrs.composer.editor.getLastNChars(15),r=c.check(o,t,/[a-z0-9]|\+|\-|_|\:/);if(this.emojiDropdown.hide(),this.emojiDropdown.active=!1,r){const u=r.typed,c=this.emojiDropdown,t=d=>{this.attrs.composer.editor.replaceBeforeCursor(r.absoluteStart-1,d+" "),this.emojiDropdown.hide()},o=function(d){let{emoji:u,name:f,code:o}=d;return m(a(),{text:f},m("button",{key:u,onclick:()=>t(u),onmouseenter:function(){c.setIndex($(this).parent().index()-1)}},m("img",{alt:u,className:"emoji",draggable:"false",loading:"lazy",src:`${e}72x72/${o}.png`,title:f})))};(()=>{const e=[],c=function(d){const u=new RegExp("\\((["+"+.*?[]{}()^$|\\".replace(/(.)/g,"\\$1")+"])\\)","g");return new RegExp("(.*)"+d.toLowerCase().replace(/(.)/g,"($1)(.*?)").replace(u,"(\\$1)")+"$","i")}(u);let t=40;const n=u=>{for(let c=0;c0;c++){const o=f[c];if(-1===e.indexOf(o)){const f=d[o];for(let d of f)if(u(d,o)){--t,e.push(o);break}}}};n(((d,f)=>u?0===d.indexOf(u):this.commonEmoji?.includes(f))),n((d=>c.test(d)));const a=e.map((u=>({emoji:u,name:d[u][0],code:x(u)}))).map(o);if(a.length){this.emojiDropdown.items=a,m.render(this.$(".ComposerBody-emojiDropdownContainer")[0],this.emojiDropdown.render()),this.emojiDropdown.show();const d=this.attrs.composer.editor.getCaretCoordinates(r.absoluteStart),u=this.emojiDropdown.$().outerWidth(),f=this.emojiDropdown.$().outerHeight(),e=this.emojiDropdown.$().offsetParent();let c=d.left,t=d.top+15;t+f>e.height()&&(t=d.top-f-15),c+u>e.width()&&(c=e.width()-u),t=Math.max(-(e.offset().top-$(document).scrollTop()),t),c=Math.max(-e.offset().left,c),this.emojiDropdown.show(c,t)}})(),this.emojiDropdown.setIndex(0),this.emojiDropdown.$().scrollTop(0),this.emojiDropdown.active=!0}}))})),(0,f.extend)("flarum/common/components/TextEditor","toolbarItems",(function(d){d.add("emoji",m(t(),{onclick:()=>this.attrs.composer.editor.insertAtCursor(" :"),icon:"far fa-smile"},app.translator.trans("flarum-emoji.forum.composer.emoji_tooltip")))}))}(),(0,f.override)(T().prototype,"contentHtml",(function(d){const u=d();if(this.oldContentHtml!==u){const d=w.parse(function(d){const u=document.implementation.createHTMLDocument();return u.body.innerHTML=d,u.body}(u),S());this.emojifiedContentHtml=d.innerHTML,this.oldContentHtml=u}return this.emojifiedContentHtml})),(0,f.override)(s9e.TextFormatter,"preview",((d,u,f)=>{d(u,f),w.parse(f,S())}))}))})(),module.exports={}})(); +(()=>{var d,u,f={},e={};function c(d){flarum.reg._webpack_runtimes["flarum-emoji"]||=c;var u=e[d];if(void 0!==u)return u.exports;var t=e[d]={exports:{}};return f[d](t,t.exports,c),t.exports}c.m=f,c.n=d=>{var u=d&&d.__esModule?()=>d.default:()=>d;return c.d(u,{a:u}),u},c.d=(d,u)=>{for(var f in u)c.o(u,f)&&!c.o(d,f)&&Object.defineProperty(d,f,{enumerable:!0,get:u[f]})},c.f={},c.e=d=>Promise.all(Object.keys(c.f).reduce(((u,f)=>(c.f[f](d,u),u)),[])),c.u=d=>"forum/emojiMap.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(d){if("object"==typeof window)return window}}(),c.o=(d,u)=>Object.prototype.hasOwnProperty.call(d,u),d={},u="module.exports:",c.l=(f,e,t,o)=>{if(d[f])d[f].push(e);else{var r,n;if(void 0!==t)for(var a=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(l);var c=d[f];if(delete d[f],r.parentNode&&r.parentNode.removeChild(r),c&&c.forEach((d=>d(e))),u)return u(e)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=b.bind(null,r.onerror),r.onload=b.bind(null,r.onload),n&&document.head.appendChild(r)}},c.r=d=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},(()=>{var d;c.g.importScripts&&(d=c.g.location+"");var u=c.g.document;if(!d&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(d=u.currentScript.src),!d)){var f=u.getElementsByTagName("script");if(f.length)for(var e=f.length-1;e>-1&&(!d||!/^http(s?):/.test(d));)d=f[e--].src}if(!d)throw new Error("Automatic publicPath is not supported in this browser");d=d.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=d})(),c.f.compat=(d,u)=>{const f=c.l;c.l=flarum.reg.loadChunk.bind(flarum.reg,f)},(()=>{var d={170:0};c.f.j=(u,f)=>{var e=c.o(d,u)?d[u]:void 0;if(0!==e)if(e)f.push(e[2]);else{var t=new Promise(((f,c)=>e=d[u]=[f,c]));f.push(e[2]=t);var o=c.p+c.u(u),r=new Error;c.l(o,(f=>{if(c.o(d,u)&&(0!==(e=d[u])&&(d[u]=void 0),e)){var t=f&&("load"===f.type?"missing":f.type),o=f&&f.target&&f.target.src;r.message="Loading chunk "+u+" failed.\n("+t+": "+o+")",r.name="ChunkLoadError",r.type=t,r.request=o,e[1](r)}}),"chunk-"+u,u)}};var u=(u,f)=>{var e,t,[o,r,n]=f,a=0;if(o.some((u=>0!==d[u]))){for(e in r)c.o(r,e)&&(c.m[e]=r[e]);n&&n(c)}for(u&&u(f);a{"use strict";const d=flarum.reg.get("core","forum/app");var u=c.n(d);const f=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","common/components/TextEditorButton");var t=c.n(e);const o=flarum.reg.get("core","common/utils/KeyboardNavigatable");var r=c.n(o);const n=flarum.reg.get("core","common/components/Tooltip");var a=c.n(n);const i=flarum.reg.get("core","common/utils/AutocompleteReader");var s=c.n(i);function b(d){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"==typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},b(d)}function l(d,u,f){return(u=function(d){var u=function(d){if("object"!=b(d)||!d)return d;var u=d[Symbol.toPrimitive];if(void 0!==u){var f=u.call(d,"string");if("object"!=b(f))return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(d)}(d);return"symbol"==b(u)?u:u+""}(u))in d?Object.defineProperty(d,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[u]=f,d}const p=flarum.reg.get("core","common/Fragment");var h=c.n(p);class g extends(h()){constructor(){super(...arguments),l(this,"items",[]),l(this,"active",!1),l(this,"index",0),l(this,"keyWasJustPressed",!1)}view(){return m("ul",{className:"Dropdown-menu EmojiDropdown"},m("li",{className:"Dropdown-header"},app.translator.trans("flarum-emoji.forum.composer.type_to_search_text")),this.items.map((d=>m("li",{key:d.attrs.key},d))))}show(d,u){this.$().show().css({left:d+"px",top:u+"px"}),this.active=!0}hide(){this.$().hide(),this.active=!1}navigate(d){this.keyWasJustPressed=!0,this.setIndex(this.index+d,!0),clearTimeout(this.keyWasJustPressedTimeout),this.keyWasJustPressedTimeout=setTimeout((()=>this.keyWasJustPressed=!1),500)}complete(){this.$("li:not(.Dropdown-header)").eq(this.index).find("button").click()}setIndex(d,u){if(this.keyWasJustPressed&&!u)return;const f=this.$(),e=f.find("li:not(.Dropdown-header)");let c=d;c<0?c=e.length-1:c>=e.length&&(c=0),this.index=c;const t=e.removeClass("active").eq(c).addClass("active");if(u){const d=f.scrollTop(),u=f.offset().top,e=u+f.outerHeight(),c=t.offset().top,o=c+t.outerHeight();let r;ce&&(r=d-e+o+parseInt(f.css("padding-bottom"),10)),void 0!==r&&f.stop(!0).animate({scrollTop:r},100)}}}flarum.reg.add("flarum-emoji","forum/fragments/AutocompleteDropdown",g);var v=function(){var d={base:"https://twemoji.maxcdn.com/v/14.0.2/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:function(d){var u="string"==typeof d?parseInt(d,16):d;return u<65536?r(u):r(55296+((u-=65536)>>10),56320+(1023&u))},toCodePoint:g},onerror:function(){this.parentNode&&this.parentNode.replaceChild(n(this.alt,!1),this)},parse:function(u,f){return f&&"function"!=typeof f||(f={callback:f}),("string"==typeof u?l:b)(u,{callback:f.callback||a,attributes:"function"==typeof f.attributes?f.attributes:p,base:"string"==typeof f.base?f.base:d.base,ext:f.ext||d.ext,size:f.folder||(e=f.size||d.size,"number"==typeof e?e+"x"+e:e),className:f.className||d.className,onerror:f.onerror||d.onerror});var e},replace:h,test:function(d){f.lastIndex=0;var u=f.test(d);return f.lastIndex=0,u}},u={"&":"&","<":"<",">":">","'":"'",'"':"""},f=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef6]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,e=/\uFE0F/g,c=String.fromCharCode(8205),t=/[&<>'"]/g,o=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,r=String.fromCharCode;return d;function n(d,u){return document.createTextNode(u?d.replace(e,""):d)}function a(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function i(d,u){for(var f,e,c=d.childNodes,t=c.length;t--;)3===(e=(f=c[t]).nodeType)?u.push(f):1!==e||"ownerSVGElement"in f||o.test(f.nodeName.toLowerCase())||i(f,u);return u}function s(d){return g(d.indexOf(c)<0?d.replace(e,""):d)}function b(d,u){for(var e,c,t,o,r,a,b,l,m,p,h,g,v,w=i(d,[]),y=w.length;y--;){for(t=!1,o=document.createDocumentFragment(),a=(r=w[y]).nodeValue,l=0;b=f.exec(a);){if((m=b.index)!==l&&o.appendChild(n(a.slice(l,m),!0)),g=s(h=b[0]),l=m+h.length,v=u.callback(g,u),g&&v){for(c in(p=new Image).onerror=u.onerror,p.setAttribute("draggable","false"),e=u.attributes(h,g))e.hasOwnProperty(c)&&0!==c.indexOf("on")&&!p.hasAttribute(c)&&p.setAttribute(c,e[c]);p.className=u.className,p.alt=h,p.src=v,t=!0,o.appendChild(p)}p||o.appendChild(n(h,!1)),p=null}t&&(l")}return c}))}function m(d){return u[d]}function p(){return null}function h(d,u){return String(d).replace(f,u)}function g(d,u){for(var f=[],e=0,c=0,t=0;t({loading:"lazy"})}}u().initializers.add("flarum-emoji",(()=>{!function(){let d=null;(0,f.extend)("flarum/common/components/TextEditor","oninit",(function(){this._loaders.push((async()=>await c.e(101).then(c.bind(c,232)).then((u=>d=u.default)))),this.commonEmoji=["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐️","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😮‍💨","😯","😰","😱","😲","😳","😴","😵","😵‍💫","😶","😶‍🌫️","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄"]})),(0,f.extend)("flarum/common/components/TextEditor","onbuild",(function(){this.emojiDropdown=new g;const d=this.$(".TextEditor-editor").wrap('
');this.navigator=new(r()),this.navigator.when((()=>this.emojiDropdown.active)).onUp((()=>this.emojiDropdown.navigate(-1))).onDown((()=>this.emojiDropdown.navigate(1))).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo(d),d.after($('
'))})),(0,f.extend)("flarum/common/components/TextEditor","buildEditorParams",(function(u){const f=Object.keys(d),e=k(),c=new(s())(":");u.inputListeners.push((()=>{const u=this.attrs.composer.editor.getSelectionRange(),t=u[0];if(u[1]-t>0)return;const o=this.attrs.composer.editor.getLastNChars(15),r=c.check(o,t,/[a-z0-9]|\+|\-|_|\:/);if(this.emojiDropdown.hide(),this.emojiDropdown.active=!1,r){const u=r.typed,c=this.emojiDropdown,t=d=>{this.attrs.composer.editor.replaceBeforeCursor(r.absoluteStart-1,d+" "),this.emojiDropdown.hide()},o=function(d){let{emoji:u,name:f,code:o}=d;return m(a(),{text:f},m("button",{key:u,onclick:()=>t(u),onmouseenter:function(){c.setIndex($(this).parent().index()-1)}},m("img",{alt:u,className:"emoji",draggable:"false",loading:"lazy",src:`${e}72x72/${o}.png`,title:f})))};(()=>{const e=[],c=function(d){const u=new RegExp("\\((["+"+.*?[]{}()^$|\\".replace(/(.)/g,"\\$1")+"])\\)","g");return new RegExp("(.*)"+d.toLowerCase().replace(/(.)/g,"($1)(.*?)").replace(u,"(\\$1)")+"$","i")}(u);let t=40;const n=u=>{for(let c=0;c0;c++){const o=f[c];if(-1===e.indexOf(o)){const f=d[o];for(let d of f)if(u(d,o)){--t,e.push(o);break}}}};n(((d,f)=>u?0===d.indexOf(u):this.commonEmoji?.includes(f))),n((d=>c.test(d)));const a=e.map((u=>({emoji:u,name:d[u][0],code:x(u)}))).map(o);if(a.length){this.emojiDropdown.items=a,m.render(this.$(".ComposerBody-emojiDropdownContainer")[0],this.emojiDropdown.render()),this.emojiDropdown.show();const d=this.attrs.composer.editor.getCaretCoordinates(r.absoluteStart),u=this.emojiDropdown.$().outerWidth(),f=this.emojiDropdown.$().outerHeight(),e=this.emojiDropdown.$().offsetParent();let c=d.left,t=d.top+15;t+f>e.height()&&(t=d.top-f-15),c+u>e.width()&&(c=e.width()-u),t=Math.max(-(e.offset().top-$(document).scrollTop()),t),c=Math.max(-e.offset().left,c),this.emojiDropdown.show(c,t)}})(),this.emojiDropdown.setIndex(0),this.emojiDropdown.$().scrollTop(0),this.emojiDropdown.active=!0}}))})),(0,f.extend)("flarum/common/components/TextEditor","toolbarItems",(function(d){d.add("emoji",m(t(),{onclick:()=>this.attrs.composer.editor.insertAtCursor(" :"),icon:"far fa-smile"},app.translator.trans("flarum-emoji.forum.composer.emoji_tooltip")))}))}(),(0,f.override)(T().prototype,"contentHtml",(function(d){const u=d();if(this.oldContentHtml!==u){const d=w.parse(function(d){const u=document.implementation.createHTMLDocument();return u.body.innerHTML=d,u.body}(u),S());this.emojifiedContentHtml=d.innerHTML,this.oldContentHtml=u}return this.emojifiedContentHtml})),(0,f.override)(s9e.TextFormatter,"preview",((d,u,f)=>{d(u,f),w.parse(f,S())}))}))})(),module.exports={}})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/emoji/js/dist/forum.js.map b/extensions/emoji/js/dist/forum.js.map index f6c4326361..e496df2d33 100644 --- a/extensions/emoji/js/dist/forum.js.map +++ b/extensions/emoji/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";UAAIA,EACAC,OCAAC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,CAAC,GAOX,OAHAE,EAAoBL,GAAUI,EAAQ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C,EAAMC,EAChC,GAEFkL,GACAhS,KAAKqO,cAAc/G,SAAS,GAC5BtH,KAAKqO,cAActH,IAAIsB,UAAU,GACjCrI,KAAKqO,cAAcpH,QAAS,CAC9B,IAEJ,KACA,IAAA8G,QAAO,sCAAuC,gBAAgB,SAAUvH,GACtEA,EAAMuC,IAAI,QAASvK,EAAE,IAAkB,CACrC6R,QAAS,IAAMrQ,KAAK2G,MAAM2I,SAASC,OAAO0C,eAAe,MACzD/G,KAAM,gBACL7E,IAAIC,WAAWC,MAAM,8CAC1B,GACF,CG1IE2L,IDmBA,IAAAC,UAAS,cAAgB,eAAe,SAAUC,GAChD,MAAMC,EAAcD,IACpB,GAAIpS,KAAKsS,iBAAmBD,EAAa,CAWvC,MAAME,EAAe,EAAQ1I,MAnBnC,SAAmBgD,GACjB,MAAM2F,EAAMzR,SAAS0R,eAAeC,qBAEpC,OADAF,EAAIG,KAAKC,UAAY/F,EACd2F,EAAIG,IACb,CAeyCE,CAAUR,GAAclH,KAG3DnL,KAAK8S,qBAAuBP,EAAaK,UACzC5S,KAAKsS,eAAiBD,CACxB,CACA,OAAOrS,KAAK8S,oBACd,KACA,IAAAX,UAASY,IAAIC,cAAe,WAAW,CAACZ,EAAU7H,EAAM0I,KACtDb,EAAS7H,EAAM0I,GACf,EAAQpJ,MAAMoJ,EAAS9H,IAAU,GCvCtB","sources":["webpack://@flarum/emoji/webpack/runtime/load script","webpack://@flarum/emoji/webpack/bootstrap","webpack://@flarum/emoji/webpack/runtime/compat get default export","webpack://@flarum/emoji/webpack/runtime/define property getters","webpack://@flarum/emoji/webpack/runtime/ensure chunk","webpack://@flarum/emoji/webpack/runtime/get javascript chunk filename","webpack://@flarum/emoji/webpack/runtime/global","webpack://@flarum/emoji/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/emoji/webpack/runtime/make namespace object","webpack://@flarum/emoji/webpack/runtime/publicPath","webpack://@flarum/emoji/webpack/runtime/compat","webpack://@flarum/emoji/webpack/runtime/jsonp chunk loading","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/TextEditorButton')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/AutocompleteReader')\"","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/Fragment')\"","webpack://@flarum/emoji/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/emoji/../../../node_modules/twemoji/dist/twemoji.esm.js","webpack://@flarum/emoji/./src/forum/helpers/getEmojiIconCode.js","webpack://@flarum/emoji/./src/common/cdn.js","webpack://@flarum/emoji/./src/forum/addComposerAutocomplete.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/emoji/./src/forum/renderEmoji.js","webpack://@flarum/emoji/./src/forum/index.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/emojiMap\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t170: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/AutocompleteReader');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Fragment');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu EmojiDropdown\"\n }, m(\"li\", {\n className: \"Dropdown-header\"\n }, app.translator.trans('flarum-emoji.forum.composer.type_to_search_text')), this.items.map(item => m(\"li\", {\n key: item.attrs.key\n }, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li:not(.Dropdown-header)').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li:not(.Dropdown-header)');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-emoji', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\nvar twemoji=function(){\"use strict\";var twemoji={base:\"https://twemoji.maxcdn.com/v/14.0.2/\",ext:\".png\",size:\"72x72\",className:\"emoji\",convert:{fromCodePoint:fromCodePoint,toCodePoint:toCodePoint},onerror:function onerror(){if(this.parentNode){this.parentNode.replaceChild(createText(this.alt,false),this)}},parse:parse,replace:replace,test:test},escaper={\"&\":\"&\",\"<\":\"<\",\">\":\">\",\"'\":\"'\",'\"':\""\"},re=/(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g,UFE0Fg=/\\uFE0F/g,U200D=String.fromCharCode(8205),rescaper=/[&<>'\"]/g,shouldntBeParsed=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,fromCharCode=String.fromCharCode;return twemoji;function createText(text,clean){return document.createTextNode(clean?text.replace(UFE0Fg,\"\"):text)}function escapeHTML(s){return s.replace(rescaper,replacer)}function defaultImageSrcGenerator(icon,options){return\"\".concat(options.base,options.size,\"/\",icon,options.ext)}function grabAllTextNodes(node,allText){var childNodes=node.childNodes,length=childNodes.length,subnode,nodeType;while(length--){subnode=childNodes[length];nodeType=subnode.nodeType;if(nodeType===3){allText.push(subnode)}else if(nodeType===1&&!(\"ownerSVGElement\"in subnode)&&!shouldntBeParsed.test(subnode.nodeName.toLowerCase())){grabAllTextNodes(subnode,allText)}}return allText}function grabTheRightIcon(rawText){return toCodePoint(rawText.indexOf(U200D)<0?rawText.replace(UFE0Fg,\"\"):rawText)}function parseNode(node,options){var allText=grabAllTextNodes(node,[]),length=allText.length,attrib,attrname,modified,fragment,subnode,text,match,i,index,img,rawText,iconId,src;while(length--){modified=false;fragment=document.createDocumentFragment();subnode=allText[length];text=subnode.nodeValue;i=0;while(match=re.exec(text)){index=match.index;if(index!==i){fragment.appendChild(createText(text.slice(i,index),true))}rawText=match[0];iconId=grabTheRightIcon(rawText);i=index+rawText.length;src=options.callback(iconId,options);if(iconId&&src){img=new Image;img.onerror=options.onerror;img.setAttribute(\"draggable\",\"false\");attrib=options.attributes(rawText,iconId);for(attrname in attrib){if(attrib.hasOwnProperty(attrname)&&attrname.indexOf(\"on\")!==0&&!img.hasAttribute(attrname)){img.setAttribute(attrname,attrib[attrname])}}img.className=options.className;img.alt=rawText;img.src=src;modified=true;fragment.appendChild(img)}if(!img)fragment.appendChild(createText(rawText,false));img=null}if(modified){if(i\")}return ret})}function replacer(m){return escaper[m]}function returnNull(){return null}function toSizeSquaredAsset(value){return typeof value===\"number\"?value+\"x\"+value:value}function fromCodePoint(codepoint){var code=typeof codepoint===\"string\"?parseInt(codepoint,16):codepoint;if(code<65536){return fromCharCode(code)}code-=65536;return fromCharCode(55296+(code>>10),56320+(code&1023))}function parse(what,how){if(!how||typeof how===\"function\"){how={callback:how}}return(typeof what===\"string\"?parseString:parseNode)(what,{callback:how.callback||defaultImageSrcGenerator,attributes:typeof how.attributes===\"function\"?how.attributes:returnNull,base:typeof how.base===\"string\"?how.base:twemoji.base,ext:how.ext||twemoji.ext,size:how.folder||toSizeSquaredAsset(how.size||twemoji.size),className:how.className||twemoji.className,onerror:how.onerror||twemoji.onerror})}function replace(text,callback){return String(text).replace(re,callback)}function test(text){re.lastIndex=0;var result=re.test(text);re.lastIndex=0;return result}function toCodePoint(unicodeSurrogates,sep){var r=[],c=0,p=0,i=0;while(i await import(/* webpackChunkName: 'forum/emojiMap', webpackMode: 'lazy-once' */ './emojiMap').then(m => emojiMap = m.default));\n // prettier-ignore\n this.commonEmoji = ['😀', '😁', '😂', '😃', '😄', '😅', '😆', '😇', '😈', '😉', '😊', '😋', '😌', '😍', '😎', '😏', '😐️', '😑', '😒', '😓', '😔', '😕', '😖', '😗', '😘', '😙', '😚', '😛', '😜', '😝', '😞', '😟', '😠', '😡', '😢', '😣', '😤', '😥', '😦', '😧', '😨', '😩', '😪', '😫', '😬', '😭', '😮', '😮‍💨', '😯', '😰', '😱', '😲', '😳', '😴', '😵', '😵‍💫', '😶', '😶‍🌫️', '😷', '😸', '😹', '😺', '😻', '😼', '😽', '😾', '😿', '🙀', '🙁', '🙂', '🙃', '🙄'];\n });\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n this.emojiDropdown = new AutocompleteDropdown();\n const $editor = this.$('.TextEditor-editor').wrap('
');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => this.emojiDropdown.active).onUp(() => this.emojiDropdown.navigate(-1)).onDown(() => this.emojiDropdown.navigate(1)).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo($editor);\n $editor.after($('
'));\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n const emojiKeys = Object.keys(emojiMap);\n const resolvedCdn = cdn();\n const autocompleteReader = new AutocompleteReader(':');\n params.inputListeners.push(() => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n const lastChunk = this.attrs.composer.editor.getLastNChars(15);\n const autocompleting = autocompleteReader.check(lastChunk, cursor, /[a-z0-9]|\\+|\\-|_|\\:/);\n this.emojiDropdown.hide();\n this.emojiDropdown.active = false;\n if (autocompleting) {\n const typed = autocompleting.typed;\n const emojiDropdown = this.emojiDropdown;\n const applySuggestion = replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(autocompleting.absoluteStart - 1, replacement + ' ');\n this.emojiDropdown.hide();\n };\n const makeSuggestion = function (_ref) {\n let {\n emoji,\n name,\n code\n } = _ref;\n return m(Tooltip, {\n text: name\n }, m(\"button\", {\n key: emoji,\n onclick: () => applySuggestion(emoji),\n onmouseenter: function () {\n emojiDropdown.setIndex($(this).parent().index() - 1);\n }\n }, m(\"img\", {\n alt: emoji,\n className: \"emoji\",\n draggable: \"false\",\n loading: \"lazy\",\n src: `${resolvedCdn}72x72/${code}.png`,\n title: name\n })));\n };\n const buildSuggestions = () => {\n const similarEmoji = [];\n\n // Build a regular expression to do a fuzzy match of the given input string\n const fuzzyRegexp = function (str) {\n const reEscape = new RegExp('\\\\(([' + '+.*?[]{}()^$|\\\\'.replace(/(.)/g, '\\\\$1') + '])\\\\)', 'g');\n return new RegExp('(.*)' + str.toLowerCase().replace(/(.)/g, '($1)(.*?)').replace(reEscape, '(\\\\$1)') + '$', 'i');\n };\n const regTyped = fuzzyRegexp(typed);\n let maxSuggestions = 40;\n const findMatchingEmojis = matcher => {\n for (let i = 0; i < emojiKeys.length && maxSuggestions > 0; i++) {\n const curEmoji = emojiKeys[i];\n if (similarEmoji.indexOf(curEmoji) === -1) {\n const names = emojiMap[curEmoji];\n for (let name of names) {\n if (matcher(name, curEmoji)) {\n --maxSuggestions;\n similarEmoji.push(curEmoji);\n break;\n }\n }\n }\n }\n };\n\n // First, try to find all emojis starting with the given string\n findMatchingEmojis((emojiName, emoji) => {\n // If no input is provided yet, match the most common emojis.\n if (!typed) {\n return this.commonEmoji?.includes(emoji);\n }\n return emojiName.indexOf(typed) === 0;\n });\n\n // If there are still suggestions left, try for some fuzzy matches\n findMatchingEmojis(emojiName => regTyped.test(emojiName));\n const suggestions = similarEmoji.map(emoji => ({\n emoji,\n name: emojiMap[emoji][0],\n code: getEmojiIconCode(emoji)\n })).map(makeSuggestion);\n if (suggestions.length) {\n this.emojiDropdown.items = suggestions;\n m.render(this.$('.ComposerBody-emojiDropdownContainer')[0], this.emojiDropdown.render());\n this.emojiDropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(autocompleting.absoluteStart);\n const width = this.emojiDropdown.$().outerWidth();\n const height = this.emojiDropdown.$().outerHeight();\n const parent = this.emojiDropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n this.emojiDropdown.show(left, top);\n }\n };\n buildSuggestions();\n this.emojiDropdown.setIndex(0);\n this.emojiDropdown.$().scrollTop(0);\n this.emojiDropdown.active = true;\n }\n });\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('emoji', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' :'),\n icon: \"far fa-smile\"\n }, app.translator.trans('flarum-emoji.forum.composer.emoji_tooltip')));\n });\n}flarum.reg.addChunkModule('101', '232', 'flarum-emoji', 'forum/emojiMap');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","import twemoji from 'twemoji';\nimport { override } from 'flarum/common/extend';\nimport Post from 'flarum/common/models/Post';\nimport cdn from '../common/cdn';\nfunction options() {\n return {\n base: cdn(),\n attributes: () => ({\n loading: 'lazy'\n })\n };\n}\n\n/**\n * Parses an HTML string into a `` node containing the HTML content.\n *\n * Vanilla JS implementation of jQuery's `$.parseHTML()`,\n * sourced from http://youmightnotneedjquery.com/\n */\nfunction parseHTML(str) {\n const tmp = document.implementation.createHTMLDocument();\n tmp.body.innerHTML = str;\n return tmp.body;\n}\nexport default function renderEmoji() {\n override(Post.prototype, 'contentHtml', function (original) {\n const contentHtml = original();\n if (this.oldContentHtml !== contentHtml) {\n // We need to parse the HTML string into a DOM node, then give it to Twemoji.\n //\n // This prevents some issues with the default find-replace that would be performed\n // on a string passed to `Twemoji.parse()`.\n //\n // The parse function can only handle a single DOM node provided, so we need to\n // wrap it in a node. In our `parseHTML` implementation, we wrap it in a ``\n // element. This gets stripped below.\n //\n // See https://github.com/flarum/core/issues/2958\n const emojifiedDom = twemoji.parse(parseHTML(contentHtml), options());\n\n // Steal the HTML string inside the emojified DOM `` tag.\n this.emojifiedContentHtml = emojifiedDom.innerHTML;\n this.oldContentHtml = contentHtml;\n }\n return this.emojifiedContentHtml;\n });\n override(s9e.TextFormatter, 'preview', (original, text, element) => {\n original(text, element);\n twemoji.parse(element, options());\n });\n}","import app from 'flarum/forum/app';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport renderEmoji from './renderEmoji';\napp.initializers.add('flarum-emoji', () => {\n // After typing ':' in the composer, show a dropdown suggesting a bunch of\n // emoji that the user could use.\n addComposerAutocomplete();\n\n // render emoji as image in Posts content and title.\n renderEmoji();\n});"],"names":["inProgress","dataWebpackPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","call","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","compat","originalLoadChunk","flarum","reg","loadChunk","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","self","_typeof","iterator","constructor","_defineProperty","t","toPrimitive","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","super","arguments","view","className","app","translator","trans","items","map","item","attrs","show","left","top","$","css","active","hide","navigate","delta","keyWasJustPressed","setIndex","index","keyWasJustPressedTimeout","complete","eq","find","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","scrollTop","dropdownTop","offset","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","stop","animate","add","twemoji","base","ext","size","convert","fromCodePoint","codepoint","code","fromCharCode","toCodePoint","replaceChild","createText","alt","parse","what","how","callback","parseString","parseNode","defaultImageSrcGenerator","attributes","returnNull","folder","text","re","lastIndex","result","escaper","UFE0Fg","U200D","rescaper","shouldntBeParsed","clean","createTextNode","icon","options","concat","grabAllTextNodes","node","allText","subnode","nodeType","childNodes","nodeName","toLowerCase","grabTheRightIcon","rawText","indexOf","attrib","attrname","modified","fragment","match","img","iconId","createDocumentFragment","nodeValue","exec","slice","Image","hasAttribute","str","ret","replacer","unicodeSurrogates","sep","c","charCodeAt","toString","join","getEmojiIconCode","emoji","version","forum","attribute","addChunkModule","cdn","loading","emojiMap","extend","_loaders","async","then","default","commonEmoji","emojiDropdown","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","after","params","emojiKeys","resolvedCdn","autocompleteReader","inputListeners","selection","composer","editor","getSelectionRange","cursor","lastChunk","getLastNChars","autocompleting","check","typed","applySuggestion","replacement","replaceBeforeCursor","absoluteStart","makeSuggestion","_ref","onclick","onmouseenter","parent","draggable","title","similarEmoji","regTyped","reEscape","RegExp","fuzzyRegexp","maxSuggestions","findMatchingEmojis","matcher","curEmoji","names","emojiName","includes","suggestions","render","coordinates","getCaretCoordinates","width","outerWidth","height","offsetParent","Math","max","buildSuggestions","insertAtCursor","addComposerAutocomplete","override","original","contentHtml","oldContentHtml","emojifiedDom","tmp","implementation","createHTMLDocument","body","innerHTML","parseHTML","emojifiedContentHtml","s9e","TextFormatter","element"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";UAAIA,EACAC,OCAAC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAC5BC,OAAOC,IAAIC,kBAAkB,kBAAoBJ,EACjD,IAAIK,EAAeN,EAAyBE,GAC5C,QAAqBK,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAAST,EAAyBE,GAAY,CAGjDM,QAAS,CAAC,GAOX,OAHAE,EAAoBR,GAAUO,EAAQA,EAAOD,QAASP,GAG/CQ,EAAOD,OACf,CAGAP,EAAoBU,EAAID,ECxBxBT,EAAoBW,EAAKH,IACxB,IAAII,EAASJ,GAAUA,EAAOK,WAC7B,IAAOL,EAAiB,QACxB,IAAM,EAEP,OADAR,EAAoBc,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdZ,EAAoBc,EAAI,CAACP,EAASS,KACjC,IAAI,IAAIC,KAAOD,EACXhB,EAAoBkB,EAAEF,EAAYC,KAASjB,EAAoBkB,EAAEX,EAASU,IAC5EE,OAAOC,eAAeb,EAASU,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDjB,EAAoBuB,EAAI,CAAC,EAGzBvB,EAAoBwB,EAAKC,GACjBC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1I,MAnBnC,SAAmBgD,GACjB,MAAM2F,EAAMvR,SAASwR,eAAeC,qBAEpC,OADAF,EAAIG,KAAKC,UAAY/F,EACd2F,EAAIG,IACb,CAeyCE,CAAUR,GAAclH,KAG3DjL,KAAK4S,qBAAuBP,EAAaK,UACzC1S,KAAKoS,eAAiBD,CACxB,CACA,OAAOnS,KAAK4S,oBACd,KACA,IAAAX,UAASY,IAAIC,cAAe,WAAW,CAACZ,EAAU7H,EAAM0I,KACtDb,EAAS7H,EAAM0I,GACf,EAAQpJ,MAAMoJ,EAAS9H,IAAU,GCvCtB","sources":["webpack://@flarum/emoji/webpack/runtime/load script","webpack://@flarum/emoji/webpack/bootstrap","webpack://@flarum/emoji/webpack/runtime/compat get default export","webpack://@flarum/emoji/webpack/runtime/define property getters","webpack://@flarum/emoji/webpack/runtime/ensure chunk","webpack://@flarum/emoji/webpack/runtime/get javascript chunk filename","webpack://@flarum/emoji/webpack/runtime/global","webpack://@flarum/emoji/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/emoji/webpack/runtime/make namespace object","webpack://@flarum/emoji/webpack/runtime/publicPath","webpack://@flarum/emoji/webpack/runtime/compat","webpack://@flarum/emoji/webpack/runtime/jsonp chunk loading","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/TextEditorButton')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/AutocompleteReader')\"","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/emoji/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/Fragment')\"","webpack://@flarum/emoji/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/emoji/../../../node_modules/twemoji/dist/twemoji.esm.js","webpack://@flarum/emoji/./src/forum/helpers/getEmojiIconCode.js","webpack://@flarum/emoji/./src/common/cdn.js","webpack://@flarum/emoji/./src/forum/addComposerAutocomplete.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/emoji/./src/forum/renderEmoji.js","webpack://@flarum/emoji/./src/forum/index.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\tflarum.reg._webpack_runtimes[\"flarum-emoji\"] ||= __webpack_require__;// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/emojiMap\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t170: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/AutocompleteReader');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Fragment');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu EmojiDropdown\"\n }, m(\"li\", {\n className: \"Dropdown-header\"\n }, app.translator.trans('flarum-emoji.forum.composer.type_to_search_text')), this.items.map(item => m(\"li\", {\n key: item.attrs.key\n }, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li:not(.Dropdown-header)').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li:not(.Dropdown-header)');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-emoji', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\nvar twemoji=function(){\"use strict\";var twemoji={base:\"https://twemoji.maxcdn.com/v/14.0.2/\",ext:\".png\",size:\"72x72\",className:\"emoji\",convert:{fromCodePoint:fromCodePoint,toCodePoint:toCodePoint},onerror:function onerror(){if(this.parentNode){this.parentNode.replaceChild(createText(this.alt,false),this)}},parse:parse,replace:replace,test:test},escaper={\"&\":\"&\",\"<\":\"<\",\">\":\">\",\"'\":\"'\",'\"':\""\"},re=/(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g,UFE0Fg=/\\uFE0F/g,U200D=String.fromCharCode(8205),rescaper=/[&<>'\"]/g,shouldntBeParsed=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,fromCharCode=String.fromCharCode;return twemoji;function createText(text,clean){return document.createTextNode(clean?text.replace(UFE0Fg,\"\"):text)}function escapeHTML(s){return s.replace(rescaper,replacer)}function defaultImageSrcGenerator(icon,options){return\"\".concat(options.base,options.size,\"/\",icon,options.ext)}function grabAllTextNodes(node,allText){var childNodes=node.childNodes,length=childNodes.length,subnode,nodeType;while(length--){subnode=childNodes[length];nodeType=subnode.nodeType;if(nodeType===3){allText.push(subnode)}else if(nodeType===1&&!(\"ownerSVGElement\"in subnode)&&!shouldntBeParsed.test(subnode.nodeName.toLowerCase())){grabAllTextNodes(subnode,allText)}}return allText}function grabTheRightIcon(rawText){return toCodePoint(rawText.indexOf(U200D)<0?rawText.replace(UFE0Fg,\"\"):rawText)}function parseNode(node,options){var allText=grabAllTextNodes(node,[]),length=allText.length,attrib,attrname,modified,fragment,subnode,text,match,i,index,img,rawText,iconId,src;while(length--){modified=false;fragment=document.createDocumentFragment();subnode=allText[length];text=subnode.nodeValue;i=0;while(match=re.exec(text)){index=match.index;if(index!==i){fragment.appendChild(createText(text.slice(i,index),true))}rawText=match[0];iconId=grabTheRightIcon(rawText);i=index+rawText.length;src=options.callback(iconId,options);if(iconId&&src){img=new Image;img.onerror=options.onerror;img.setAttribute(\"draggable\",\"false\");attrib=options.attributes(rawText,iconId);for(attrname in attrib){if(attrib.hasOwnProperty(attrname)&&attrname.indexOf(\"on\")!==0&&!img.hasAttribute(attrname)){img.setAttribute(attrname,attrib[attrname])}}img.className=options.className;img.alt=rawText;img.src=src;modified=true;fragment.appendChild(img)}if(!img)fragment.appendChild(createText(rawText,false));img=null}if(modified){if(i\")}return ret})}function replacer(m){return escaper[m]}function returnNull(){return null}function toSizeSquaredAsset(value){return typeof value===\"number\"?value+\"x\"+value:value}function fromCodePoint(codepoint){var code=typeof codepoint===\"string\"?parseInt(codepoint,16):codepoint;if(code<65536){return fromCharCode(code)}code-=65536;return fromCharCode(55296+(code>>10),56320+(code&1023))}function parse(what,how){if(!how||typeof how===\"function\"){how={callback:how}}return(typeof what===\"string\"?parseString:parseNode)(what,{callback:how.callback||defaultImageSrcGenerator,attributes:typeof how.attributes===\"function\"?how.attributes:returnNull,base:typeof how.base===\"string\"?how.base:twemoji.base,ext:how.ext||twemoji.ext,size:how.folder||toSizeSquaredAsset(how.size||twemoji.size),className:how.className||twemoji.className,onerror:how.onerror||twemoji.onerror})}function replace(text,callback){return String(text).replace(re,callback)}function test(text){re.lastIndex=0;var result=re.test(text);re.lastIndex=0;return result}function toCodePoint(unicodeSurrogates,sep){var r=[],c=0,p=0,i=0;while(i await import(/* webpackChunkName: 'forum/emojiMap', webpackMode: 'lazy-once' */ './emojiMap').then(m => emojiMap = m.default));\n // prettier-ignore\n this.commonEmoji = ['😀', '😁', '😂', '😃', '😄', '😅', '😆', '😇', '😈', '😉', '😊', '😋', '😌', '😍', '😎', '😏', '😐️', '😑', '😒', '😓', '😔', '😕', '😖', '😗', '😘', '😙', '😚', '😛', '😜', '😝', '😞', '😟', '😠', '😡', '😢', '😣', '😤', '😥', '😦', '😧', '😨', '😩', '😪', '😫', '😬', '😭', '😮', '😮‍💨', '😯', '😰', '😱', '😲', '😳', '😴', '😵', '😵‍💫', '😶', '😶‍🌫️', '😷', '😸', '😹', '😺', '😻', '😼', '😽', '😾', '😿', '🙀', '🙁', '🙂', '🙃', '🙄'];\n });\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n this.emojiDropdown = new AutocompleteDropdown();\n const $editor = this.$('.TextEditor-editor').wrap('
');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => this.emojiDropdown.active).onUp(() => this.emojiDropdown.navigate(-1)).onDown(() => this.emojiDropdown.navigate(1)).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo($editor);\n $editor.after($('
'));\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n const emojiKeys = Object.keys(emojiMap);\n const resolvedCdn = cdn();\n const autocompleteReader = new AutocompleteReader(':');\n params.inputListeners.push(() => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n const lastChunk = this.attrs.composer.editor.getLastNChars(15);\n const autocompleting = autocompleteReader.check(lastChunk, cursor, /[a-z0-9]|\\+|\\-|_|\\:/);\n this.emojiDropdown.hide();\n this.emojiDropdown.active = false;\n if (autocompleting) {\n const typed = autocompleting.typed;\n const emojiDropdown = this.emojiDropdown;\n const applySuggestion = replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(autocompleting.absoluteStart - 1, replacement + ' ');\n this.emojiDropdown.hide();\n };\n const makeSuggestion = function (_ref) {\n let {\n emoji,\n name,\n code\n } = _ref;\n return m(Tooltip, {\n text: name\n }, m(\"button\", {\n key: emoji,\n onclick: () => applySuggestion(emoji),\n onmouseenter: function () {\n emojiDropdown.setIndex($(this).parent().index() - 1);\n }\n }, m(\"img\", {\n alt: emoji,\n className: \"emoji\",\n draggable: \"false\",\n loading: \"lazy\",\n src: `${resolvedCdn}72x72/${code}.png`,\n title: name\n })));\n };\n const buildSuggestions = () => {\n const similarEmoji = [];\n\n // Build a regular expression to do a fuzzy match of the given input string\n const fuzzyRegexp = function (str) {\n const reEscape = new RegExp('\\\\(([' + '+.*?[]{}()^$|\\\\'.replace(/(.)/g, '\\\\$1') + '])\\\\)', 'g');\n return new RegExp('(.*)' + str.toLowerCase().replace(/(.)/g, '($1)(.*?)').replace(reEscape, '(\\\\$1)') + '$', 'i');\n };\n const regTyped = fuzzyRegexp(typed);\n let maxSuggestions = 40;\n const findMatchingEmojis = matcher => {\n for (let i = 0; i < emojiKeys.length && maxSuggestions > 0; i++) {\n const curEmoji = emojiKeys[i];\n if (similarEmoji.indexOf(curEmoji) === -1) {\n const names = emojiMap[curEmoji];\n for (let name of names) {\n if (matcher(name, curEmoji)) {\n --maxSuggestions;\n similarEmoji.push(curEmoji);\n break;\n }\n }\n }\n }\n };\n\n // First, try to find all emojis starting with the given string\n findMatchingEmojis((emojiName, emoji) => {\n // If no input is provided yet, match the most common emojis.\n if (!typed) {\n return this.commonEmoji?.includes(emoji);\n }\n return emojiName.indexOf(typed) === 0;\n });\n\n // If there are still suggestions left, try for some fuzzy matches\n findMatchingEmojis(emojiName => regTyped.test(emojiName));\n const suggestions = similarEmoji.map(emoji => ({\n emoji,\n name: emojiMap[emoji][0],\n code: getEmojiIconCode(emoji)\n })).map(makeSuggestion);\n if (suggestions.length) {\n this.emojiDropdown.items = suggestions;\n m.render(this.$('.ComposerBody-emojiDropdownContainer')[0], this.emojiDropdown.render());\n this.emojiDropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(autocompleting.absoluteStart);\n const width = this.emojiDropdown.$().outerWidth();\n const height = this.emojiDropdown.$().outerHeight();\n const parent = this.emojiDropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n this.emojiDropdown.show(left, top);\n }\n };\n buildSuggestions();\n this.emojiDropdown.setIndex(0);\n this.emojiDropdown.$().scrollTop(0);\n this.emojiDropdown.active = true;\n }\n });\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('emoji', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' :'),\n icon: \"far fa-smile\"\n }, app.translator.trans('flarum-emoji.forum.composer.emoji_tooltip')));\n });\n}flarum.reg.addChunkModule('101', '232', 'flarum-emoji', 'forum/emojiMap');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","import twemoji from 'twemoji';\nimport { override } from 'flarum/common/extend';\nimport Post from 'flarum/common/models/Post';\nimport cdn from '../common/cdn';\nfunction options() {\n return {\n base: cdn(),\n attributes: () => ({\n loading: 'lazy'\n })\n };\n}\n\n/**\n * Parses an HTML string into a `` node containing the HTML content.\n *\n * Vanilla JS implementation of jQuery's `$.parseHTML()`,\n * sourced from http://youmightnotneedjquery.com/\n */\nfunction parseHTML(str) {\n const tmp = document.implementation.createHTMLDocument();\n tmp.body.innerHTML = str;\n return tmp.body;\n}\nexport default function renderEmoji() {\n override(Post.prototype, 'contentHtml', function (original) {\n const contentHtml = original();\n if (this.oldContentHtml !== contentHtml) {\n // We need to parse the HTML string into a DOM node, then give it to Twemoji.\n //\n // This prevents some issues with the default find-replace that would be performed\n // on a string passed to `Twemoji.parse()`.\n //\n // The parse function can only handle a single DOM node provided, so we need to\n // wrap it in a node. In our `parseHTML` implementation, we wrap it in a ``\n // element. This gets stripped below.\n //\n // See https://github.com/flarum/core/issues/2958\n const emojifiedDom = twemoji.parse(parseHTML(contentHtml), options());\n\n // Steal the HTML string inside the emojified DOM `` tag.\n this.emojifiedContentHtml = emojifiedDom.innerHTML;\n this.oldContentHtml = contentHtml;\n }\n return this.emojifiedContentHtml;\n });\n override(s9e.TextFormatter, 'preview', (original, text, element) => {\n original(text, element);\n twemoji.parse(element, options());\n });\n}","import app from 'flarum/forum/app';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport renderEmoji from './renderEmoji';\napp.initializers.add('flarum-emoji', () => {\n // After typing ':' in the composer, show a dropdown suggesting a bunch of\n // emoji that the user could use.\n addComposerAutocomplete();\n\n // render emoji as image in Posts content and title.\n renderEmoji();\n});"],"names":["inProgress","dataWebpackPrefix","__webpack_module_cache__","__webpack_require__","moduleId","flarum","reg","_webpack_runtimes","cachedModule","undefined","exports","module","__webpack_modules__","m","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","call","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","self","_typeof","iterator","constructor","_defineProperty","t","toPrimitive","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","super","arguments","view","className","app","translator","trans","items","map","item","attrs","show","left","top","$","css","active","hide","navigate","delta","keyWasJustPressed","setIndex","index","keyWasJustPressedTimeout","complete","eq","find","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","scrollTop","dropdownTop","offset","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","stop","animate","add","twemoji","base","ext","size","convert","fromCodePoint","codepoint","code","fromCharCode","toCodePoint","replaceChild","createText","alt","parse","what","how","callback","parseString","parseNode","defaultImageSrcGenerator","attributes","returnNull","folder","text","re","lastIndex","result","escaper","UFE0Fg","U200D","rescaper","shouldntBeParsed","clean","createTextNode","icon","options","concat","grabAllTextNodes","node","allText","subnode","nodeType","childNodes","nodeName","toLowerCase","grabTheRightIcon","rawText","indexOf","attrib","attrname","modified","fragment","match","img","iconId","createDocumentFragment","nodeValue","exec","slice","Image","hasAttribute","str","ret","replacer","unicodeSurrogates","sep","c","charCodeAt","toString","join","getEmojiIconCode","emoji","version","forum","attribute","addChunkModule","cdn","loading","emojiMap","extend","_loaders","async","then","default","commonEmoji","emojiDropdown","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","after","params","emojiKeys","resolvedCdn","autocompleteReader","inputListeners","selection","composer","editor","getSelectionRange","cursor","lastChunk","getLastNChars","autocompleting","check","typed","applySuggestion","replacement","replaceBeforeCursor","absoluteStart","makeSuggestion","_ref","onclick","onmouseenter","parent","draggable","title","similarEmoji","regTyped","reEscape","RegExp","fuzzyRegexp","maxSuggestions","findMatchingEmojis","matcher","curEmoji","names","emojiName","includes","suggestions","render","coordinates","getCaretCoordinates","width","outerWidth","height","offsetParent","Math","max","buildSuggestions","insertAtCursor","addComposerAutocomplete","override","original","contentHtml","oldContentHtml","emojifiedDom","tmp","implementation","createHTMLDocument","body","innerHTML","parseHTML","emojifiedContentHtml","s9e","TextFormatter","element"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/messages/js/dist/forum.js b/extensions/messages/js/dist/forum.js index 3c2f35097d..d3ca66cce2 100644 --- a/extensions/messages/js/dist/forum.js +++ b/extensions/messages/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var e,t,r={950:e=>{"use strict";e.exports=flarum.reg.get("core","common/Component")},917:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Avatar")},336:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Button")},741:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Dropdown")},801:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Icon")},500:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/InfoTile")},88:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Link")},104:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/LinkButton")},661:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/LoadingIndicator")},533:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Modal")},859:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Page")},547:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Tooltip")},732:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/UserSelectionModal")},653:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/fullTime")},167:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/humanTime")},819:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/listItems")},521:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/username")},662:e=>{"use strict";e.exports=flarum.reg.get("core","common/states/PaginatedListState")},906:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/ItemList")},476:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/ScrollListener")},821:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/Stream")},443:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/classList")},233:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/extractText")},488:e=>{"use strict";e.exports=flarum.reg.get("core","forum/app")},154:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/AbstractPost")},3:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/Comment")},592:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/ComposerBody")},47:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/HeaderList")},402:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/IndexSidebar")},314:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/PageStructure")},301:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/PostMeta")},651:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/PostUser")},805:(e,t,r)=>{"use strict";function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{A:()=>o})}},s={};function o(e){var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.m=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>({301:"forum/components/MessagesPage",451:"forum/components/MessageComposer",619:"forum/components/DialogDropdownList"}[e]+".js"),o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="module.exports:",o.l=(r,s,a,n)=>{if(e[r])e[r].push(s);else{var u,m;if(void 0!==a)for(var l=document.getElementsByTagName("script"),i=0;i{u.onerror=u.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((e=>e(s))),t)return t(s)},d=setTimeout(g.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=g.bind(null,u.onerror),u.onload=g.bind(null,u.onload),m&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),o.f.compat=(e,t)=>{const r=o.l;o.l=flarum.reg.loadChunk.bind(flarum.reg,r)},(()=>{var e={170:0};o.f.j=(t,r)=>{var s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)r.push(s[2]);else{var a=new Promise(((r,o)=>s=e[t]=[r,o]));r.push(s[2]=a);var n=o.p+o.u(t),u=new Error;o.l(n,(r=>{if(o.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var a=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",u.name="ChunkLoadError",u.type=a,u.request=n,s[1](u)}}),"chunk-"+t,t)}};var t=(t,r)=>{var s,a,[n,u,m]=r,l=0;if(n.some((t=>0!==e[t]))){for(s in u)o.o(u,s)&&(o.m[s]=u[s]);m&&m(o)}for(t&&t(r);l{"use strict";o.r(a),o.d(a,{extend:()=>B});var e=o(488),t=o.n(e);const r=flarum.reg.get("core","common/extend");var s=o(402),n=o.n(s),u=o(104),l=o.n(u);const i=flarum.reg.get("core","forum/components/HeaderSecondary");var c=o.n(i);const g=flarum.reg.get("core","forum/utils/UserControls");var d=o.n(g),f=o(336),p=o.n(f),h=o(805);const b=flarum.reg.get("core","forum/components/HeaderDropdown");var v=o.n(b),x=o(443),y=o.n(x),M=o(661),C=o.n(M);class w extends(v()){constructor(){super(...arguments),(0,h.A)(this,"DialogDropdownList",null)}static initAttrs(e){e.className=y()("DialogsDropdown",e.className),e.label=e.label||t().translator.trans("flarum-messages.forum.header.dropdown_tooltip"),e.icon=e.icon||"fas fa-envelope",super.initAttrs(e)}getContent(){return this.DialogDropdownList?m(this.DialogDropdownList,{state:this.attrs.state}):(o.e(619).then(o.bind(o,331)).then((e=>{this.DialogDropdownList=e.default})),m(C(),null))}goToRoute(){m.route.set(t().route("dialogs"))}getUnreadCount(){return t().session.user.attribute("messageCount")}getNewCount(){return t().session.user.attribute("messageCount")}}flarum.reg.add("flarum-messages","forum/components/DialogsDropdown",w),flarum.reg.addChunkModule("619","331","flarum-messages","forum/components/DialogDropdownList"),flarum.reg.addChunkModule("619","331","flarum-messages","forum/components/DialogList"),flarum.reg.addChunkModule("619","331","flarum-messages","forum/components/DialogListItem");var S=o(662),A=o.n(S);class D extends(A()){constructor(e,t,r){void 0===t&&(t=1),void 0===r&&(r=null),super(e,t,r),(0,h.A)(this,"lastCount",0)}get type(){return"dialogs"}getAllItems(){return super.getAllItems()}requestParams(){return{include:["lastMessage","users.groups"],filter:this.params.filter||{},sort:this.currentSort()||this.sortValue(Object.values(this.sortMap())[0])}}sortMap(){return{latest:"-lastMessageAt",newest:"-createdAt",oldest:"createdAt"}}load(){return t().session.user?.attribute("messageCount")!==this.lastCount&&(this.pages=[],this.location={page:1},this.lastCount=t().session.user?.attribute("messageCount")||0),this.pages.length>0?Promise.resolve():super.loadNext()}markAllAsRead(){return t().request({method:"POST",url:t().forum.attribute("apiUrl")+"/dialogs/read"}).then((()=>{t().dialogs.getAllItems().forEach((e=>{e.pushAttributes({unreadCount:0})})),t().session.user.pushAttributes({messageCount:0}),t().dropdownDialogs.clear(),m.redraw()}))}}flarum.reg.add("flarum-messages","forum/states/DialogListState",D);const k=flarum.reg.get("core","common/extenders");var P=o.n(k);const L=flarum.reg.get("core","common/Model");var T=o.n(L);const I=flarum.reg.get("core","common/utils/computed");var _=o.n(I);const j=flarum.reg.get("core","common/utils/string");class O extends(T()){content(){return T().attribute("content").call(this)}contentHtml(){return T().attribute("contentHtml").call(this)}renderFailed(){return T().attribute("renderFailed").call(this)}contentPlain(){return _()("contentHtml",(e=>"string"==typeof e?(0,j.getPlainContent)(e):e)).call(this)}createdAt(){return T().attribute("createdAt",T().transformDate).call(this)}dialog(){return T().hasOne("dialog").call(this)}user(){return T().hasOne("user").call(this)}}flarum.reg.add("flarum-messages","common/models/DialogMessage",O);const N=flarum.reg.get("core","common/app");var E=o.n(N);class R extends(T()){title(){return T().attribute("title").call(this)}type(){return T().attribute("type").call(this)}lastMessageAt(){return T().attribute("lastMessageAt",T().transformDate).call(this)}createdAt(){return T().attribute("createdAt",T().transformDate).call(this)}users(){return T().hasMany("users").call(this)}firstMessage(){return T().hasOne("firstMessage").call(this)}lastMessage(){return T().hasOne("lastMessage").call(this)}unreadCount(){return T().attribute("unreadCount").call(this)}lastReadMessageId(){return T().attribute("lastReadMessageId").call(this)}lastReadAt(){return T().attribute("lastReadAt",T().transformDate).call(this)}recipient(){let e=this.users();return e?e.find((e=>e&&e.id()!==E().session.user.id())):null}}flarum.reg.add("flarum-messages","common/models/Dialog",R);const B=[(new(P().Store)).add("dialogs",R).add("dialog-messages",O),(new(P().Routes)).add("messages","/messages",(()=>o.e(301).then(o.bind(o,654)))).add("dialog","/messages/dialog/:id",(()=>o.e(301).then(o.bind(o,654)))).helper("dialog",(e=>t().route("dialog",{id:e.id()})))];flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/MessagesPage"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/MessagesSidebar"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/DialogSection"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/MessageStream"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/states/MessageStreamState"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/DetailsModal"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/Message"),t().initializers.add("flarum-messages",(()=>{t().dialogs=new D({},1),t().dropdownDialogs=new D({filter:{unread:!0}},1,5),t().composer.composingMessageTo=function(e){return this.isVisible()&&this.bodyMatches("flarum/messages/forum/components/MessageComposer",{dialog:e})},(0,r.extend)(n().prototype,"navItems",(function(e){t().session.user&&e.add("messages",m(l(),{href:t().route("messages"),icon:"far fa-envelope",active:t().current.data.routeName&&["messages","dialog"].includes(t().current.data.routeName)},t().translator.trans("flarum-messages.forum.index.messages_link")),95)})),(0,r.extend)(c().prototype,"items",(function(e){t().session.user?.attribute("canSendAnyMessage")&&e.add("messages",m(w,{state:t().dropdownDialogs}),15)})),(0,r.extend)(d(),"userControls",((e,r)=>{t().session.user?.attribute("canSendAnyMessage")&&e.add("sendMessage",m(p(),{icon:"fas fa-envelope",onclick:()=>{flarum.reg.asyncModuleImport("flarum/forum/components/ComposerBody").then((()=>{t().composer.load((()=>o.e(451).then(o.bind(o,761))),{user:t().session.user,recipients:[r]}).then((()=>t().composer.show()))}))}},t().translator.trans("flarum-messages.forum.user_controls.send_message_button")))})),(0,r.extend)("flarum/forum/components/NotificationGrid","notificationTypes",(function(e){e.add("messageReceived",{name:"messageReceived",icon:"fas fa-envelope",label:t().translator.trans("flarum-messages.forum.settings.notify_message_received_label")})}))})),flarum.reg.addChunkModule("451","761","flarum-messages","forum/components/MessageComposer")})(),module.exports=a})(); +(()=>{var e,t,r={950:e=>{"use strict";e.exports=flarum.reg.get("core","common/Component")},917:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Avatar")},336:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Button")},741:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Dropdown")},801:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Icon")},500:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/InfoTile")},88:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Link")},104:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/LinkButton")},661:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/LoadingIndicator")},533:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Modal")},859:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Page")},547:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/Tooltip")},732:e=>{"use strict";e.exports=flarum.reg.get("core","common/components/UserSelectionModal")},653:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/fullTime")},167:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/humanTime")},819:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/listItems")},521:e=>{"use strict";e.exports=flarum.reg.get("core","common/helpers/username")},662:e=>{"use strict";e.exports=flarum.reg.get("core","common/states/PaginatedListState")},906:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/ItemList")},476:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/ScrollListener")},821:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/Stream")},443:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/classList")},233:e=>{"use strict";e.exports=flarum.reg.get("core","common/utils/extractText")},488:e=>{"use strict";e.exports=flarum.reg.get("core","forum/app")},154:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/AbstractPost")},3:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/Comment")},592:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/ComposerBody")},47:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/HeaderList")},402:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/IndexSidebar")},314:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/PageStructure")},301:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/PostMeta")},651:e=>{"use strict";e.exports=flarum.reg.get("core","forum/components/PostUser")},805:(e,t,r)=>{"use strict";function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{A:()=>o})}},s={};function o(e){flarum.reg._webpack_runtimes["flarum-messages"]||=o;var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.m=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>({301:"forum/components/MessagesPage",451:"forum/components/MessageComposer",619:"forum/components/DialogDropdownList"}[e]+".js"),o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="module.exports:",o.l=(r,s,a,n)=>{if(e[r])e[r].push(s);else{var u,m;if(void 0!==a)for(var l=document.getElementsByTagName("script"),i=0;i{u.onerror=u.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((e=>e(s))),t)return t(s)},d=setTimeout(g.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=g.bind(null,u.onerror),u.onload=g.bind(null,u.onload),m&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),o.f.compat=(e,t)=>{const r=o.l;o.l=flarum.reg.loadChunk.bind(flarum.reg,r)},(()=>{var e={170:0};o.f.j=(t,r)=>{var s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)r.push(s[2]);else{var a=new Promise(((r,o)=>s=e[t]=[r,o]));r.push(s[2]=a);var n=o.p+o.u(t),u=new Error;o.l(n,(r=>{if(o.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var a=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",u.name="ChunkLoadError",u.type=a,u.request=n,s[1](u)}}),"chunk-"+t,t)}};var t=(t,r)=>{var s,a,[n,u,m]=r,l=0;if(n.some((t=>0!==e[t]))){for(s in u)o.o(u,s)&&(o.m[s]=u[s]);m&&m(o)}for(t&&t(r);l{"use strict";o.r(a),o.d(a,{extend:()=>B});var e=o(488),t=o.n(e);const r=flarum.reg.get("core","common/extend");var s=o(402),n=o.n(s),u=o(104),l=o.n(u);const i=flarum.reg.get("core","forum/components/HeaderSecondary");var c=o.n(i);const g=flarum.reg.get("core","forum/utils/UserControls");var d=o.n(g),f=o(336),p=o.n(f),h=o(805);const b=flarum.reg.get("core","forum/components/HeaderDropdown");var v=o.n(b),x=o(443),y=o.n(x),M=o(661),C=o.n(M);class w extends(v()){constructor(){super(...arguments),(0,h.A)(this,"DialogDropdownList",null)}static initAttrs(e){e.className=y()("DialogsDropdown",e.className),e.label=e.label||t().translator.trans("flarum-messages.forum.header.dropdown_tooltip"),e.icon=e.icon||"fas fa-envelope",super.initAttrs(e)}getContent(){return this.DialogDropdownList?m(this.DialogDropdownList,{state:this.attrs.state}):(o.e(619).then(o.bind(o,331)).then((e=>{this.DialogDropdownList=e.default})),m(C(),null))}goToRoute(){m.route.set(t().route("dialogs"))}getUnreadCount(){return t().session.user.attribute("messageCount")}getNewCount(){return t().session.user.attribute("messageCount")}}flarum.reg.add("flarum-messages","forum/components/DialogsDropdown",w),flarum.reg.addChunkModule("619","331","flarum-messages","forum/components/DialogDropdownList"),flarum.reg.addChunkModule("619","331","flarum-messages","forum/components/DialogList"),flarum.reg.addChunkModule("619","331","flarum-messages","forum/components/DialogListItem");var S=o(662),A=o.n(S);class D extends(A()){constructor(e,t,r){void 0===t&&(t=1),void 0===r&&(r=null),super(e,t,r),(0,h.A)(this,"lastCount",0)}get type(){return"dialogs"}getAllItems(){return super.getAllItems()}requestParams(){return{include:["lastMessage","users.groups"],filter:this.params.filter||{},sort:this.currentSort()||this.sortValue(Object.values(this.sortMap())[0])}}sortMap(){return{latest:"-lastMessageAt",newest:"-createdAt",oldest:"createdAt"}}load(){return t().session.user?.attribute("messageCount")!==this.lastCount&&(this.pages=[],this.location={page:1},this.lastCount=t().session.user?.attribute("messageCount")||0),this.pages.length>0?Promise.resolve():super.loadNext()}markAllAsRead(){return t().request({method:"POST",url:t().forum.attribute("apiUrl")+"/dialogs/read"}).then((()=>{t().dialogs.getAllItems().forEach((e=>{e.pushAttributes({unreadCount:0})})),t().session.user.pushAttributes({messageCount:0}),t().dropdownDialogs.clear(),m.redraw()}))}}flarum.reg.add("flarum-messages","forum/states/DialogListState",D);const k=flarum.reg.get("core","common/extenders");var P=o.n(k);const L=flarum.reg.get("core","common/Model");var T=o.n(L);const _=flarum.reg.get("core","common/utils/computed");var I=o.n(_);const j=flarum.reg.get("core","common/utils/string");class O extends(T()){content(){return T().attribute("content").call(this)}contentHtml(){return T().attribute("contentHtml").call(this)}renderFailed(){return T().attribute("renderFailed").call(this)}contentPlain(){return I()("contentHtml",(e=>"string"==typeof e?(0,j.getPlainContent)(e):e)).call(this)}createdAt(){return T().attribute("createdAt",T().transformDate).call(this)}dialog(){return T().hasOne("dialog").call(this)}user(){return T().hasOne("user").call(this)}}flarum.reg.add("flarum-messages","common/models/DialogMessage",O);const N=flarum.reg.get("core","common/app");var E=o.n(N);class R extends(T()){title(){return T().attribute("title").call(this)}type(){return T().attribute("type").call(this)}lastMessageAt(){return T().attribute("lastMessageAt",T().transformDate).call(this)}createdAt(){return T().attribute("createdAt",T().transformDate).call(this)}users(){return T().hasMany("users").call(this)}firstMessage(){return T().hasOne("firstMessage").call(this)}lastMessage(){return T().hasOne("lastMessage").call(this)}unreadCount(){return T().attribute("unreadCount").call(this)}lastReadMessageId(){return T().attribute("lastReadMessageId").call(this)}lastReadAt(){return T().attribute("lastReadAt",T().transformDate).call(this)}recipient(){let e=this.users();return e?e.find((e=>e&&e.id()!==E().session.user.id())):null}}flarum.reg.add("flarum-messages","common/models/Dialog",R);const B=[(new(P().Store)).add("dialogs",R).add("dialog-messages",O),(new(P().Routes)).add("messages","/messages",(()=>o.e(301).then(o.bind(o,654)))).add("dialog","/messages/dialog/:id",(()=>o.e(301).then(o.bind(o,654)))).helper("dialog",(e=>t().route("dialog",{id:e.id()})))];flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/MessagesPage"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/MessagesSidebar"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/DialogSection"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/MessageStream"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/states/MessageStreamState"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/DetailsModal"),flarum.reg.addChunkModule("301","654","flarum-messages","forum/components/Message"),t().initializers.add("flarum-messages",(()=>{t().dialogs=new D({},1),t().dropdownDialogs=new D({filter:{unread:!0}},1,5),t().composer.composingMessageTo=function(e){return this.isVisible()&&this.bodyMatches("flarum/messages/forum/components/MessageComposer",{dialog:e})},(0,r.extend)(n().prototype,"navItems",(function(e){t().session.user&&e.add("messages",m(l(),{href:t().route("messages"),icon:"far fa-envelope",active:t().current.data.routeName&&["messages","dialog"].includes(t().current.data.routeName)},t().translator.trans("flarum-messages.forum.index.messages_link")),95)})),(0,r.extend)(c().prototype,"items",(function(e){t().session.user?.attribute("canSendAnyMessage")&&e.add("messages",m(w,{state:t().dropdownDialogs}),15)})),(0,r.extend)(d(),"userControls",((e,r)=>{t().session.user?.attribute("canSendAnyMessage")&&e.add("sendMessage",m(p(),{icon:"fas fa-envelope",onclick:()=>{flarum.reg.asyncModuleImport("flarum/forum/components/ComposerBody").then((()=>{t().composer.load((()=>o.e(451).then(o.bind(o,761))),{user:t().session.user,recipients:[r]}).then((()=>t().composer.show()))}))}},t().translator.trans("flarum-messages.forum.user_controls.send_message_button")))})),(0,r.extend)("flarum/forum/components/NotificationGrid","notificationTypes",(function(e){e.add("messageReceived",{name:"messageReceived",icon:"fas fa-envelope",label:t().translator.trans("flarum-messages.forum.settings.notify_message_received_label")})}))})),flarum.reg.addChunkModule("451","761","flarum-messages","forum/components/MessageComposer")})(),module.exports=a})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/messages/js/dist/forum.js.map b/extensions/messages/js/dist/forum.js.map index abdcab0495..fc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AAS,SAAUC,GAC/C,YAAYtD,MAAMC,UAAU,sBAC9BqD,EAAMnD,IAAI,WAAYpH,EAAE+F,EAAiB,CACvCW,MAAO,sBACL,GAER,KAGA,IAAA4D,QAAO,IAAc,gBAAgB,CAACC,EAAOtD,KACvC,YAAYA,MAAMC,UAAU,sBAC9BqD,EAAMnD,IAAI,cAAepH,EAAE,IAAQ,CACjCuG,KAAM,kBACNqE,QAAS,KACP3M,OAAOC,IAAI2M,kBAAkB,wCAAwClE,MAAK,KACxE,aAAayB,MAAK,IAAM,8BAA6H,CACnJnB,KAAM,YAAYA,KAClB6D,WAAY,CAAC7D,KACZN,MAAK,IAAM,aAAaoE,QAAO,GAClC,GAEH,eAAezE,MAAM,4DAC1B,KAEF,IAAAgE,QAAO,2CAA4C,qBAAqB,SAAUC,GAChFA,EAAMnD,IAAI,kBAAmB,CAC3BjC,KAAM,kBACNoB,KAAM,kBACNF,MAAO,eAAeC,MAAM,iEAEhC,GAAE,IACDrI,OAAOC,IAAImJ,eAAe,MAAO,MAAO,kBAAmB,mC","sources":["webpack://@flarum/messages/webpack/runtime/load script","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Avatar')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/InfoTile')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/UserSelectionModal')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/fullTime')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/listItems')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/username')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/ScrollListener')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/AbstractPost')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/Comment')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/ComposerBody')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/HeaderList')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/PostMeta')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/PostUser')\"","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/messages/webpack/bootstrap","webpack://@flarum/messages/webpack/runtime/compat get default export","webpack://@flarum/messages/webpack/runtime/define property getters","webpack://@flarum/messages/webpack/runtime/ensure chunk","webpack://@flarum/messages/webpack/runtime/get javascript chunk filename","webpack://@flarum/messages/webpack/runtime/global","webpack://@flarum/messages/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/messages/webpack/runtime/make namespace object","webpack://@flarum/messages/webpack/runtime/publicPath","webpack://@flarum/messages/webpack/runtime/compat","webpack://@flarum/messages/webpack/runtime/jsonp chunk loading","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/HeaderSecondary')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/utils/UserControls')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/HeaderDropdown')\"","webpack://@flarum/messages/./src/forum/components/DialogsDropdown.tsx","webpack://@flarum/messages/./src/forum/states/DialogListState.ts","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/messages/./src/common/models/DialogMessage.ts","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/messages/./src/common/models/Dialog.ts","webpack://@flarum/messages/./src/common/extend.ts","webpack://@flarum/messages/./src/forum/extend.ts","webpack://@flarum/messages/./src/forum/index.tsx"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/components/Avatar');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/Dropdown');","module.exports = flarum.reg.get('core', 'common/components/Icon');","module.exports = flarum.reg.get('core', 'common/components/InfoTile');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LinkButton');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/components/Modal');","module.exports = flarum.reg.get('core', 'common/components/Page');","module.exports = flarum.reg.get('core', 'common/components/Tooltip');","module.exports = flarum.reg.get('core', 'common/components/UserSelectionModal');","module.exports = flarum.reg.get('core', 'common/helpers/fullTime');","module.exports = flarum.reg.get('core', 'common/helpers/humanTime');","module.exports = flarum.reg.get('core', 'common/helpers/listItems');","module.exports = flarum.reg.get('core', 'common/helpers/username');","module.exports = flarum.reg.get('core', 'common/states/PaginatedListState');","module.exports = flarum.reg.get('core', 'common/utils/ItemList');","module.exports = flarum.reg.get('core', 'common/utils/ScrollListener');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/AbstractPost');","module.exports = flarum.reg.get('core', 'forum/components/Comment');","module.exports = flarum.reg.get('core', 'forum/components/ComposerBody');","module.exports = flarum.reg.get('core', 'forum/components/HeaderList');","module.exports = flarum.reg.get('core', 'forum/components/IndexSidebar');","module.exports = flarum.reg.get('core', 'forum/components/PageStructure');","module.exports = flarum.reg.get('core', 'forum/components/PostMeta');","module.exports = flarum.reg.get('core', 'forum/components/PostUser');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + {\"301\":\"forum/components/MessagesPage\",\"451\":\"forum/components/MessageComposer\",\"619\":\"forum/components/DialogDropdownList\"}[chunkId] + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t170: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderSecondary');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/UserControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderDropdown');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport HeaderDropdown from 'flarum/forum/components/HeaderDropdown';\nimport classList from 'flarum/common/utils/classList';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nexport default class DialogsDropdown extends HeaderDropdown {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"DialogDropdownList\", null);\n }\n static initAttrs(attrs) {\n attrs.className = classList('DialogsDropdown', attrs.className);\n attrs.label = attrs.label || app.translator.trans('flarum-messages.forum.header.dropdown_tooltip');\n attrs.icon = attrs.icon || 'fas fa-envelope';\n super.initAttrs(attrs);\n }\n getContent() {\n if (!this.DialogDropdownList) {\n import(/* webpackChunkName: 'forum/components/DialogDropdownList', webpackMode: 'lazy-once' */ './DialogDropdownList').then(DialogDropdownList => {\n this.DialogDropdownList = DialogDropdownList.default;\n });\n return m(LoadingIndicator, null);\n }\n return m(this.DialogDropdownList, {\n state: this.attrs.state\n });\n }\n goToRoute() {\n m.route.set(app.route('dialogs'));\n }\n getUnreadCount() {\n return app.session.user.attribute('messageCount');\n }\n getNewCount() {\n return app.session.user.attribute('messageCount');\n }\n}\nflarum.reg.add('flarum-messages', 'forum/components/DialogsDropdown', DialogsDropdown);flarum.reg.addChunkModule('619', '331', 'flarum-messages', 'forum/components/DialogDropdownList');\nflarum.reg.addChunkModule('619', '331', 'flarum-messages', 'forum/components/DialogList');\nflarum.reg.addChunkModule('619', '331', 'flarum-messages', 'forum/components/DialogListItem');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class DialogListState extends PaginatedListState {\n constructor(params, page, perPage) {\n if (page === void 0) {\n page = 1;\n }\n if (perPage === void 0) {\n perPage = null;\n }\n super(params, page, perPage);\n _defineProperty(this, \"lastCount\", 0);\n }\n get type() {\n return 'dialogs';\n }\n getAllItems() {\n return super.getAllItems();\n }\n requestParams() {\n const params = {\n include: ['lastMessage', 'users.groups'],\n filter: this.params.filter || {},\n sort: this.currentSort() || this.sortValue(Object.values(this.sortMap())[0])\n };\n return params;\n }\n sortMap() {\n const map = {};\n map.latest = '-lastMessageAt';\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n return map;\n }\n load() {\n if (app.session.user?.attribute('messageCount') !== this.lastCount) {\n this.pages = [];\n this.location = {\n page: 1\n };\n this.lastCount = app.session.user?.attribute('messageCount') || 0;\n }\n if (this.pages.length > 0) {\n return Promise.resolve();\n }\n return super.loadNext();\n }\n markAllAsRead() {\n return app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/dialogs/read'\n }).then(() => {\n app.dialogs.getAllItems().forEach(dialog => {\n dialog.pushAttributes({\n unreadCount: 0\n });\n });\n app.session.user.pushAttributes({\n messageCount: 0\n });\n app.dropdownDialogs.clear();\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-messages', 'forum/states/DialogListState', DialogListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import Model from 'flarum/common/Model';\nimport computed from 'flarum/common/utils/computed';\nimport { getPlainContent } from 'flarum/common/utils/string';\nexport default class DialogMessage extends Model {\n content() {\n return Model.attribute('content').call(this);\n }\n contentHtml() {\n return Model.attribute('contentHtml').call(this);\n }\n renderFailed() {\n return Model.attribute('renderFailed').call(this);\n }\n contentPlain() {\n return computed('contentHtml', content => {\n if (typeof content === 'string') {\n return getPlainContent(content);\n }\n return content;\n }).call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n dialog() {\n return Model.hasOne('dialog').call(this);\n }\n user() {\n return Model.hasOne('user').call(this);\n }\n}\nflarum.reg.add('flarum-messages', 'common/models/DialogMessage', DialogMessage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","import Model from 'flarum/common/Model';\nimport app from 'flarum/common/app';\nexport default class Dialog extends Model {\n title() {\n return Model.attribute('title').call(this);\n }\n type() {\n return Model.attribute('type').call(this);\n }\n lastMessageAt() {\n return Model.attribute('lastMessageAt', Model.transformDate).call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n users() {\n return Model.hasMany('users').call(this);\n }\n firstMessage() {\n return Model.hasOne('firstMessage').call(this);\n }\n lastMessage() {\n return Model.hasOne('lastMessage').call(this);\n }\n unreadCount() {\n return Model.attribute('unreadCount').call(this);\n }\n lastReadMessageId() {\n return Model.attribute('lastReadMessageId').call(this);\n }\n lastReadAt() {\n return Model.attribute('lastReadAt', Model.transformDate).call(this);\n }\n recipient() {\n let users = this.users();\n return !users ? null : users.find(user => user && user.id() !== app.session.user.id());\n }\n}\nflarum.reg.add('flarum-messages', 'common/models/Dialog', Dialog);","import DialogMessage from './models/DialogMessage';\nimport Dialog from './models/Dialog';\nimport Extend from 'flarum/common/extenders';\nexport default [new Extend.Store().add('dialogs', Dialog) //\n.add('dialog-messages', DialogMessage) //\n];","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('messages', '/messages', () => import(/* webpackChunkName: 'forum/components/MessagesPage', webpackMode: 'lazy-once' */ './components/MessagesPage')).add('dialog', '/messages/dialog/:id', () => import(/* webpackChunkName: 'forum/components/MessagesPage', webpackMode: 'lazy-once' */ './components/MessagesPage')).helper('dialog', dialog => app.route('dialog', {\n id: dialog.id()\n}))];flarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/MessagesPage');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/MessagesSidebar');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/DialogSection');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/MessageStream');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/states/MessageStreamState');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/DetailsModal');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/Message');","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\nimport DialogsDropdown from './components/DialogsDropdown';\nimport DialogListState from './states/DialogListState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-messages', () => {\n app.dialogs = new DialogListState({}, 1);\n app.dropdownDialogs = new DialogListState({\n filter: {\n unread: true\n }\n }, 1, 5);\n app.composer.composingMessageTo = function (dialog) {\n return this.isVisible() && this.bodyMatches('flarum/messages/forum/components/MessageComposer', {\n dialog\n });\n };\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n if (app.session.user) {\n items.add('messages', m(LinkButton, {\n href: app.route('messages'),\n icon: \"far fa-envelope\",\n active: app.current.data.routeName && ['messages', 'dialog'].includes(app.current.data.routeName)\n }, app.translator.trans('flarum-messages.forum.index.messages_link')), 95);\n }\n });\n extend(HeaderSecondary.prototype, 'items', function (items) {\n if (app.session.user?.attribute('canSendAnyMessage')) {\n items.add('messages', m(DialogsDropdown, {\n state: app.dropdownDialogs\n }), 15);\n }\n });\n\n // @ts-ignore\n extend(UserControls, 'userControls', (items, user) => {\n if (app.session.user?.attribute('canSendAnyMessage')) {\n items.add('sendMessage', m(Button, {\n icon: \"fas fa-envelope\",\n onclick: () => {\n flarum.reg.asyncModuleImport('flarum/forum/components/ComposerBody').then(() => {\n app.composer.load(() => import(/* webpackChunkName: 'forum/components/MessageComposer', webpackMode: 'lazy-once' */ './components/MessageComposer'), {\n user: app.session.user,\n recipients: [user]\n }).then(() => app.composer.show());\n });\n }\n }, app.translator.trans('flarum-messages.forum.user_controls.send_message_button')));\n }\n });\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('messageReceived', {\n name: 'messageReceived',\n icon: 'fas fa-envelope',\n label: app.translator.trans('flarum-messages.forum.settings.notify_message_received_label')\n });\n });\n});flarum.reg.addChunkModule('451', '761', 'flarum-messages', 'forum/components/MessageComposer');"],"names":["inProgress","dataWebpackPrefix","module","exports","flarum","reg","get","_typeof","o","Symbol","iterator","constructor","prototype","_defineProperty","e","r","t","i","toPrimitive","call","TypeError","String","toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","n","getter","__esModule","d","a","definition","key","f","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","toStringTag","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","self","DialogsDropdown","super","arguments","initAttrs","attrs","className","label","trans","icon","getContent","DialogDropdownList","state","then","default","goToRoute","route","set","getUnreadCount","user","attribute","getNewCount","add","addChunkModule","DialogListState","params","page","perPage","getAllItems","requestParams","include","filter","sort","currentSort","sortValue","values","sortMap","map","load","lastCount","pages","loadNext","markAllAsRead","method","dialog","pushAttributes","unreadCount","messageCount","clear","redraw","DialogMessage","content","contentHtml","renderFailed","contentPlain","getPlainContent","createdAt","Dialog","title","lastMessageAt","users","firstMessage","lastMessage","lastReadMessageId","lastReadAt","recipient","find","helper","unread","composingMessageTo","isVisible","bodyMatches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A+C,GAE3E,KACA,IAAAgE,QAAO,cAA2B,SAAS,SAAUC,GAC/C,YAAYtD,MAAMC,UAAU,sBAC9BqD,EAAMnD,IAAI,WAAYpH,EAAE+F,EAAiB,CACvCW,MAAO,sBACL,GAER,KAGA,IAAA4D,QAAO,IAAc,gBAAgB,CAACC,EAAOtD,KACvC,YAAYA,MAAMC,UAAU,sBAC9BqD,EAAMnD,IAAI,cAAepH,EAAE,IAAQ,CACjCuG,KAAM,kBACNqE,QAAS,KACP5M,OAAOC,IAAI4M,kBAAkB,wCAAwClE,MAAK,KACxE,aAAayB,MAAK,IAAM,8BAA6H,CACnJnB,KAAM,YAAYA,KAClB6D,WAAY,CAAC7D,KACZN,MAAK,IAAM,aAAaoE,QAAO,GAClC,GAEH,eAAezE,MAAM,4DAC1B,KAEF,IAAAgE,QAAO,2CAA4C,qBAAqB,SAAUC,GAChFA,EAAMnD,IAAI,kBAAmB,CAC3BjC,KAAM,kBACNoB,KAAM,kBACNF,MAAO,eAAeC,MAAM,iEAEhC,GAAE,IACDtI,OAAOC,IAAIoJ,eAAe,MAAO,MAAO,kBAAmB,mC","sources":["webpack://@flarum/messages/webpack/runtime/load script","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Avatar')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/InfoTile')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/components/UserSelectionModal')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/fullTime')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/listItems')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/helpers/username')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/ScrollListener')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/AbstractPost')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/Comment')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/ComposerBody')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/HeaderList')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/PostMeta')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/PostUser')\"","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/messages/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/messages/webpack/bootstrap","webpack://@flarum/messages/webpack/runtime/compat get default export","webpack://@flarum/messages/webpack/runtime/define property getters","webpack://@flarum/messages/webpack/runtime/ensure chunk","webpack://@flarum/messages/webpack/runtime/get javascript chunk filename","webpack://@flarum/messages/webpack/runtime/global","webpack://@flarum/messages/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/messages/webpack/runtime/make namespace object","webpack://@flarum/messages/webpack/runtime/publicPath","webpack://@flarum/messages/webpack/runtime/compat","webpack://@flarum/messages/webpack/runtime/jsonp chunk loading","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/HeaderSecondary')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/utils/UserControls')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'forum/components/HeaderDropdown')\"","webpack://@flarum/messages/./src/forum/components/DialogsDropdown.tsx","webpack://@flarum/messages/./src/forum/states/DialogListState.ts","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/messages/./src/common/models/DialogMessage.ts","webpack://@flarum/messages/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/messages/./src/common/models/Dialog.ts","webpack://@flarum/messages/./src/common/extend.ts","webpack://@flarum/messages/./src/forum/extend.ts","webpack://@flarum/messages/./src/forum/index.tsx"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/components/Avatar');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/Dropdown');","module.exports = flarum.reg.get('core', 'common/components/Icon');","module.exports = flarum.reg.get('core', 'common/components/InfoTile');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LinkButton');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/components/Modal');","module.exports = flarum.reg.get('core', 'common/components/Page');","module.exports = flarum.reg.get('core', 'common/components/Tooltip');","module.exports = flarum.reg.get('core', 'common/components/UserSelectionModal');","module.exports = flarum.reg.get('core', 'common/helpers/fullTime');","module.exports = flarum.reg.get('core', 'common/helpers/humanTime');","module.exports = flarum.reg.get('core', 'common/helpers/listItems');","module.exports = flarum.reg.get('core', 'common/helpers/username');","module.exports = flarum.reg.get('core', 'common/states/PaginatedListState');","module.exports = flarum.reg.get('core', 'common/utils/ItemList');","module.exports = flarum.reg.get('core', 'common/utils/ScrollListener');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/AbstractPost');","module.exports = flarum.reg.get('core', 'forum/components/Comment');","module.exports = flarum.reg.get('core', 'forum/components/ComposerBody');","module.exports = flarum.reg.get('core', 'forum/components/HeaderList');","module.exports = flarum.reg.get('core', 'forum/components/IndexSidebar');","module.exports = flarum.reg.get('core', 'forum/components/PageStructure');","module.exports = flarum.reg.get('core', 'forum/components/PostMeta');","module.exports = flarum.reg.get('core', 'forum/components/PostUser');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\tflarum.reg._webpack_runtimes[\"flarum-messages\"] ||= __webpack_require__;// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + {\"301\":\"forum/components/MessagesPage\",\"451\":\"forum/components/MessageComposer\",\"619\":\"forum/components/DialogDropdownList\"}[chunkId] + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t170: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderSecondary');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/UserControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderDropdown');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport HeaderDropdown from 'flarum/forum/components/HeaderDropdown';\nimport classList from 'flarum/common/utils/classList';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nexport default class DialogsDropdown extends HeaderDropdown {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"DialogDropdownList\", null);\n }\n static initAttrs(attrs) {\n attrs.className = classList('DialogsDropdown', attrs.className);\n attrs.label = attrs.label || app.translator.trans('flarum-messages.forum.header.dropdown_tooltip');\n attrs.icon = attrs.icon || 'fas fa-envelope';\n super.initAttrs(attrs);\n }\n getContent() {\n if (!this.DialogDropdownList) {\n import(/* webpackChunkName: 'forum/components/DialogDropdownList', webpackMode: 'lazy-once' */ './DialogDropdownList').then(DialogDropdownList => {\n this.DialogDropdownList = DialogDropdownList.default;\n });\n return m(LoadingIndicator, null);\n }\n return m(this.DialogDropdownList, {\n state: this.attrs.state\n });\n }\n goToRoute() {\n m.route.set(app.route('dialogs'));\n }\n getUnreadCount() {\n return app.session.user.attribute('messageCount');\n }\n getNewCount() {\n return app.session.user.attribute('messageCount');\n }\n}\nflarum.reg.add('flarum-messages', 'forum/components/DialogsDropdown', DialogsDropdown);flarum.reg.addChunkModule('619', '331', 'flarum-messages', 'forum/components/DialogDropdownList');\nflarum.reg.addChunkModule('619', '331', 'flarum-messages', 'forum/components/DialogList');\nflarum.reg.addChunkModule('619', '331', 'flarum-messages', 'forum/components/DialogListItem');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class DialogListState extends PaginatedListState {\n constructor(params, page, perPage) {\n if (page === void 0) {\n page = 1;\n }\n if (perPage === void 0) {\n perPage = null;\n }\n super(params, page, perPage);\n _defineProperty(this, \"lastCount\", 0);\n }\n get type() {\n return 'dialogs';\n }\n getAllItems() {\n return super.getAllItems();\n }\n requestParams() {\n const params = {\n include: ['lastMessage', 'users.groups'],\n filter: this.params.filter || {},\n sort: this.currentSort() || this.sortValue(Object.values(this.sortMap())[0])\n };\n return params;\n }\n sortMap() {\n const map = {};\n map.latest = '-lastMessageAt';\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n return map;\n }\n load() {\n if (app.session.user?.attribute('messageCount') !== this.lastCount) {\n this.pages = [];\n this.location = {\n page: 1\n };\n this.lastCount = app.session.user?.attribute('messageCount') || 0;\n }\n if (this.pages.length > 0) {\n return Promise.resolve();\n }\n return super.loadNext();\n }\n markAllAsRead() {\n return app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/dialogs/read'\n }).then(() => {\n app.dialogs.getAllItems().forEach(dialog => {\n dialog.pushAttributes({\n unreadCount: 0\n });\n });\n app.session.user.pushAttributes({\n messageCount: 0\n });\n app.dropdownDialogs.clear();\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-messages', 'forum/states/DialogListState', DialogListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import Model from 'flarum/common/Model';\nimport computed from 'flarum/common/utils/computed';\nimport { getPlainContent } from 'flarum/common/utils/string';\nexport default class DialogMessage extends Model {\n content() {\n return Model.attribute('content').call(this);\n }\n contentHtml() {\n return Model.attribute('contentHtml').call(this);\n }\n renderFailed() {\n return Model.attribute('renderFailed').call(this);\n }\n contentPlain() {\n return computed('contentHtml', content => {\n if (typeof content === 'string') {\n return getPlainContent(content);\n }\n return content;\n }).call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n dialog() {\n return Model.hasOne('dialog').call(this);\n }\n user() {\n return Model.hasOne('user').call(this);\n }\n}\nflarum.reg.add('flarum-messages', 'common/models/DialogMessage', DialogMessage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","import Model from 'flarum/common/Model';\nimport app from 'flarum/common/app';\nexport default class Dialog extends Model {\n title() {\n return Model.attribute('title').call(this);\n }\n type() {\n return Model.attribute('type').call(this);\n }\n lastMessageAt() {\n return Model.attribute('lastMessageAt', Model.transformDate).call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n users() {\n return Model.hasMany('users').call(this);\n }\n firstMessage() {\n return Model.hasOne('firstMessage').call(this);\n }\n lastMessage() {\n return Model.hasOne('lastMessage').call(this);\n }\n unreadCount() {\n return Model.attribute('unreadCount').call(this);\n }\n lastReadMessageId() {\n return Model.attribute('lastReadMessageId').call(this);\n }\n lastReadAt() {\n return Model.attribute('lastReadAt', Model.transformDate).call(this);\n }\n recipient() {\n let users = this.users();\n return !users ? null : users.find(user => user && user.id() !== app.session.user.id());\n }\n}\nflarum.reg.add('flarum-messages', 'common/models/Dialog', Dialog);","import DialogMessage from './models/DialogMessage';\nimport Dialog from './models/Dialog';\nimport Extend from 'flarum/common/extenders';\nexport default [new Extend.Store().add('dialogs', Dialog) //\n.add('dialog-messages', DialogMessage) //\n];","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('messages', '/messages', () => import(/* webpackChunkName: 'forum/components/MessagesPage', webpackMode: 'lazy-once' */ './components/MessagesPage')).add('dialog', '/messages/dialog/:id', () => import(/* webpackChunkName: 'forum/components/MessagesPage', webpackMode: 'lazy-once' */ './components/MessagesPage')).helper('dialog', dialog => app.route('dialog', {\n id: dialog.id()\n}))];flarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/MessagesPage');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/MessagesSidebar');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/DialogSection');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/MessageStream');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/states/MessageStreamState');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/DetailsModal');\nflarum.reg.addChunkModule('301', '654', 'flarum-messages', 'forum/components/Message');","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\nimport DialogsDropdown from './components/DialogsDropdown';\nimport DialogListState from './states/DialogListState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-messages', () => {\n app.dialogs = new DialogListState({}, 1);\n app.dropdownDialogs = new DialogListState({\n filter: {\n unread: true\n }\n }, 1, 5);\n app.composer.composingMessageTo = function (dialog) {\n return this.isVisible() && this.bodyMatches('flarum/messages/forum/components/MessageComposer', {\n dialog\n });\n };\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n if (app.session.user) {\n items.add('messages', m(LinkButton, {\n href: app.route('messages'),\n icon: \"far fa-envelope\",\n active: app.current.data.routeName && ['messages', 'dialog'].includes(app.current.data.routeName)\n }, app.translator.trans('flarum-messages.forum.index.messages_link')), 95);\n }\n });\n extend(HeaderSecondary.prototype, 'items', function (items) {\n if (app.session.user?.attribute('canSendAnyMessage')) {\n items.add('messages', m(DialogsDropdown, {\n state: app.dropdownDialogs\n }), 15);\n }\n });\n\n // @ts-ignore\n extend(UserControls, 'userControls', (items, user) => {\n if (app.session.user?.attribute('canSendAnyMessage')) {\n items.add('sendMessage', m(Button, {\n icon: \"fas fa-envelope\",\n onclick: () => {\n flarum.reg.asyncModuleImport('flarum/forum/components/ComposerBody').then(() => {\n app.composer.load(() => import(/* webpackChunkName: 'forum/components/MessageComposer', webpackMode: 'lazy-once' */ './components/MessageComposer'), {\n user: app.session.user,\n recipients: [user]\n }).then(() => app.composer.show());\n });\n }\n }, app.translator.trans('flarum-messages.forum.user_controls.send_message_button')));\n }\n });\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('messageReceived', {\n name: 'messageReceived',\n icon: 'fas fa-envelope',\n label: app.translator.trans('flarum-messages.forum.settings.notify_message_received_label')\n });\n });\n});flarum.reg.addChunkModule('451', '761', 'flarum-messages', 'forum/components/MessageComposer');"],"names":["inProgress","dataWebpackPrefix","module","exports","flarum","reg","get","_typeof","o","Symbol","iterator","constructor","prototype","_defineProperty","e","r","t","i","toPrimitive","call","TypeError","String","toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","_webpack_runtimes","cachedModule","undefined","__webpack_modules__","m","n","getter","__esModule","d","a","definition","key","f","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","toStringTag","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","self","DialogsDropdown","super","arguments","initAttrs","attrs","className","label","trans","icon","getContent","DialogDropdownList","state","then","default","goToRoute","route","set","getUnreadCount","user","attribute","getNewCount","add","addChunkModule","DialogListState","params","page","perPage","getAllItems","requestParams","include","filter","sort","currentSort","sortValue","values","sortMap","map","load","lastCount","pages","loadNext","markAllAsRead","method","dialog","pushAttributes","unreadCount","messageCount","clear","redraw","DialogMessage","content","contentHtml","renderFailed","contentPlain","getPlainContent","createdAt","Dialog","title","lastMessageAt","users","firstMessage","lastMessage","lastReadMessageId","lastReadAt","recipient","find","helper","unread","composingMessageTo","isVisible","bodyMatches","extend","items","href","active","routeName","includes","onclick","asyncModuleImport","recipients","show"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/package-manager/js/dist/admin.js b/extensions/package-manager/js/dist/admin.js index b1e5ce24a2..8d3132868a 100755 --- a/extensions/package-manager/js/dist/admin.js +++ b/extensions/package-manager/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var e={151:function(e){e.exports=function(){"use strict";var e,t,a=1e3,n=6e4,s=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,i=31536e6,l=2628e6,m=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:i,months:l,days:r,hours:s,minutes:n,seconds:a,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof b},c=function(e,t,a){return new b(e,a,t.$l)},g=function(e){return t.p(e)+"s"},p=function(e){return e<0},h=function(e){return p(e)?Math.ceil(e):Math.floor(e)},f=function(e){return Math.abs(e)},x=function(e,t){return e?p(e)?{negative:!0,format:""+f(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function p(e,t,a){var n=this;if(this.$d={},this.$l=a,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return c(e*u[g(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){n.$d[g(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var s=e.match(m);if(s){var r=s.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var f=p.prototype;return f.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,a){return t+(e.$d[a]||0)*u[a]}),0)},f.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/i),e%=i,this.$d.months=h(e/l),e%=l,this.$d.days=h(e/r),e%=r,this.$d.hours=h(e/s),e%=s,this.$d.minutes=h(e/n),e%=n,this.$d.seconds=h(e/a),e%=a,this.$d.milliseconds=e},f.toISOString=function(){var e=x(this.$d.years,"Y"),t=x(this.$d.months,"M"),a=+this.$d.days||0;this.$d.weeks&&(a+=7*this.$d.weeks);var n=x(a,"D"),s=x(this.$d.hours,"H"),r=x(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var i=x(o,"S"),l=e.negative||t.negative||n.negative||s.negative||r.negative||i.negative,m=s.format||r.format||i.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+n.format+m+s.format+r.format+i.format;return"P"===u||"-P"===u?"P0D":u},f.toJSON=function(){return this.toISOString()},f.format=function(e){var a=e||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return a.replace(o,(function(e,t){return t||String(n[e])}))},f.as=function(e){return this.$ms/u[g(e)]},f.get=function(e){var t=this.$ms,a=g(e);return"milliseconds"===a?t%=1e3:t="weeks"===a?h(t/u[a]):this.$d[a],t||0},f.add=function(e,t,a){var n;return n=t?e*u[g(t)]:d(e)?e.$ms:c(e,this).$ms,c(this.$ms+n*(a?-1:1),this)},f.subtract=function(e,t){return this.add(e,t,!0)},f.locale=function(e){var t=this.clone();return t.$l=e,t},f.clone=function(){return c(this.$ms,this)},f.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},f.valueOf=function(){return this.asMilliseconds()},f.milliseconds=function(){return this.get("milliseconds")},f.asMilliseconds=function(){return this.as("milliseconds")},f.seconds=function(){return this.get("seconds")},f.asSeconds=function(){return this.as("seconds")},f.minutes=function(){return this.get("minutes")},f.asMinutes=function(){return this.as("minutes")},f.hours=function(){return this.get("hours")},f.asHours=function(){return this.as("hours")},f.days=function(){return this.get("days")},f.asDays=function(){return this.as("days")},f.weeks=function(){return this.get("weeks")},f.asWeeks=function(){return this.as("weeks")},f.months=function(){return this.get("months")},f.asMonths=function(){return this.as("months")},f.years=function(){return this.get("years")},f.asYears=function(){return this.as("years")},p}(),y=function(e,t,a){return e.add(t.years()*a,"y").add(t.months()*a,"M").add(t.days()*a,"d").add(t.hours()*a,"h").add(t.minutes()*a,"m").add(t.seconds()*a,"s").add(t.milliseconds()*a,"ms")};return function(a,n,s){e=s,t=s().$utils(),s.duration=function(e,t){var a=s.locale();return c(e,{$l:a},t)},s.isDuration=d;var r=n.prototype.add,o=n.prototype.subtract;n.prototype.add=function(e,t){return d(e)?y(this,e,1):r.bind(this)(e,t)},n.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}()}},t={};function a(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";a.r(n),a.d(n,{extend:()=>Je});const e=flarum.reg.get("core","common/extend"),t=flarum.reg.get("core","admin/app");var s=a.n(t);const r=flarum.reg.get("core","admin/components/ExtensionPage");var o=a.n(r);const i=flarum.reg.get("core","common/components/Button");var l=a.n(i);const u=flarum.reg.get("core","admin/components/LoadingModal");var d=a.n(u);const c=flarum.reg.get("core","admin/utils/isExtensionEnabled");var g=a.n(c);function p(){s().modal.close(),m.route.set(s().route("extension",{id:"flarum-extension-manager"})),s().extensionManager.queue.load({},!0),setTimeout((()=>{document.getElementById("ExtensionManager-queueSection")?.scrollIntoView({block:"nearest"})}),200)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e,t,a){return(t=function(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=h(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}window.jumpToQueue=p,flarum.reg.add("flarum-extension-manager","admin/utils/jumpToQueue",p);class x{constructor(){f(this,"polling",null),f(this,"tasks",null),f(this,"limit",20),f(this,"offset",0),f(this,"total",0),f(this,"loading",!1)}load(e,t){return void 0===t&&(t=!1),this.loading=!0,e={page:{limit:this.limit,offset:this.offset,...e?.page},...e},s().store.find("extension-manager-tasks",e||{}).then((e=>{this.tasks=e,this.total=e.payload.meta?.page?.total||0,m.redraw();const a=e?.find((e=>"pending"===e.status()||"running"===e.status()));return a?this.pollQueue(t):t?(s().extensionManager.control.setLoading(null),window.location.reload()):s().extensionManager.control.isLoading()&&s().extensionManager.control.setLoading(null),this.loading=!1,e}))}isLoading(){return this.loading}getItems(){return this.tasks}getTotalItems(){return this.total}getTotalPages(){return Math.ceil(this.total/this.limit)}pageNumber(){return Math.ceil(this.offset/this.limit)}getPerPage(){return this.limit}hasPrev(){return 0!==this.pageNumber()}hasNext(){return this.offset+this.limit{this.load({},e)}),6e3)}hasPending(){return!!this.tasks?.find((e=>"pending"===e.status()||"running"===e.status()))}}function b(e){s().extensionManager.control.setLoading(null);const t=e.response.errors[0];if(!["composer_command_failure","extension_already_installed","extension_not_installed"].includes(t.code))throw e;switch(s().alerts.clear(),t.code){case"composer_command_failure":t.guessed_cause?(s().alerts.show({type:"error"},s().translator.trans(`flarum-extension-manager.admin.exceptions.guessed_cause.${t.guessed_cause}`)),s().modal.close()):s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.composer_command_failure"));break;case"extension_already_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_already_installed")),s().modal.close();break;case"extension_not_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_not_installed")),s().modal.close()}}flarum.reg.add("flarum-extension-manager","admin/states/QueueState",x);const y=flarum.reg.get("core","common/utils/extractText");var v=a.n(y);class _{get lastUpdateRun(){const e=JSON.parse(s().data.settings["flarum-extension-manager.last_update_run"]);return e.limitedPackages=()=>[...e.major.limitedPackages,...e.minor.limitedPackages,...e.global.limitedPackages],e}constructor(){f(this,"loading",null),f(this,"packageUpdates",{}),f(this,"lastUpdateCheck",void 0),f(this,"extensionUpdates",void 0),f(this,"coreUpdate",null),this.lastUpdateCheck=JSON.parse(s().data.settings["flarum-extension-manager.last_update_check"]),this.extensionUpdates=this.formatExtensionUpdates(this.lastUpdateCheck),this.coreUpdate=this.formatCoreUpdate(this.lastUpdateCheck)}isLoading(e){return void 0===e&&(e=null),e&&this.loading===e||!e&&null!==this.loading}hasOperationRunning(){return this.isLoading()||s().extensionManager.queue.hasPending()}setLoading(e){this.loading=e}requirePackage(e){s().extensionManager.control.setLoading("extension-install"),s().modal.show(d()),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/extensions`,body:{data:e}}).then((e=>{if(e.processing)p();else{const t=e.id;s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_install",{extension:t})),window.location.href=`${s().forum.attribute("adminUrl")}#/extension/${t}`,window.location.reload()}})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}checkForUpdates(){this.setLoading("check"),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/check-for-updates`}).then((e=>{e.processing?p():(this.lastUpdateCheck=e,this.extensionUpdates=this.formatExtensionUpdates(e),this.coreUpdate=this.formatCoreUpdate(e),this.setLoading(null),m.redraw())})).catch(b).finally((()=>{m.redraw()}))}updateCoreMinor(){confirm(v()(s().translator.trans("flarum-extension-manager.admin.minor_update_confirmation.content")))&&(s().modal.show(d()),this.setLoading("minor-update"),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/minor-update`}).then((e=>{e?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()})))}updateExtension(e,t){s().modal.show(d()),this.setLoading("extension-update"),s().request({method:"PATCH",url:`${s().forum.attribute("apiUrl")}/extension-manager/extensions/${e.id}`,body:{data:{updateMode:t}}}).then((t=>{t?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_update",{extension:e.extra["flarum-extension"].title})),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}updateGlobally(){s().modal.show(d()),this.setLoading("global-update"),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/global-update`}).then((e=>{e?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.updater.global_update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}formatExtensionUpdates(e){return this.packageUpdates={},e?.updates?.installed?.filter((e=>{const t=e.name.replace("/","-").replace(/(flarum-ext-)|(flarum-)/,""),a=s().data.extensions[t],n=["semver-safe-update","update-possible"].includes(e["latest-status"]);return a&&n&&(this.packageUpdates[a.id]=e),a&&n})),Object.values(s().data.extensions).filter((e=>this.packageUpdates[e.id]))}formatCoreUpdate(e){const t=e?.updates?.installed?.filter((e=>"flarum/core"===e.name)).pop();return t?{package:t,extension:{id:"flarum-core",name:"flarum/core",version:s().data.settings.version,icon:{name:"",backgroundImage:`url(${s().data.resources[0].attributes.baseUrl}/assets/extensions/flarum-extension-manager/flarum.svg`},extra:{"flarum-extension":{title:v()(s().translator.trans("flarum-extension-manager.admin.updater.flarum"))}},links:{}}}:null}majorUpdate(e){let{dryRun:t}=e;s().extensionManager.control.setLoading(t?"major-update-dry-run":"major-update"),s().modal.show(d());const a=this.lastUpdateRun.major;s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/major-update`,body:{data:{dryRun:t}}}).then((e=>{e?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).catch((e=>{s().modal.close(),a.status="failure",a.incompatibleExtensions=e.response?.errors?.pop()?.incompatible_extensions})).finally((()=>{m.redraw()}))}}flarum.reg.add("flarum-extension-manager","admin/states/ControlSectionState",_);const k=flarum.reg.get("core","common/states/PaginatedListState");var N=a.n(k);class M extends(N()){get type(){return"external-extensions"}constructor(){super({sort:"-downloads"},1,12)}sortMap(){return{"-createdAt":{sort:"-createdAt",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.latest",{},!0)},"-downloads":{sort:"-downloads",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.top",{},!0)}}}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionListState",M);class w{constructor(){f(this,"queue",new x),f(this,"control",new _),f(this,"extensions",new M)}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionManagerState",w);const E=flarum.reg.get("core","common/extenders");var S=a.n(E);const B=flarum.reg.get("core","common/Component");var U=a.n(B);const $=flarum.reg.get("core","common/components/LoadingIndicator");var C=a.n($);const q=flarum.reg.get("core","common/components/Tooltip");var P=a.n(q);const T=flarum.reg.get("core","common/components/Icon");var j=a.n(T);const F=flarum.reg.get("core","common/utils/ItemList");var L=a.n(F);const I=flarum.reg.get("core","common/components/Link");var A=a.n(I);const D=flarum.reg.get("core","common/components/Pagination");var O=a.n(D);const R=flarum.reg.get("core","common/utils/classList");var Y=a.n(R);class W extends(U()){view(e){const{className:t,type:a,...n}=this.attrs;return m("span",Object.assign({className:Y()(["Label",`Label--${this.attrs.type}`,t])},n),e.children)}}flarum.reg.add("flarum-extension-manager","admin/components/Label",W);const G=flarum.reg.get("core","common/components/Modal");var V=a.n(G);class H extends(V()){className(){return"Modal--large QuickModal"}title(){return s().translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${this.attrs.task.operation()}`)}content(){return m("div",{className:"Modal-body"},m("div",{className:"TaskOutputModal-data"},"failure"===this.attrs.task.status()&&m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause")),m("div",{className:"FormControl TaskOutputModal-data-guessed-cause"},this.attrs.task.guessedCause()&&s().translator.trans("flarum-extension-manager.admin.exceptions.guessed_cause."+this.attrs.task.guessedCause())||s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown"))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.command")),m("div",{className:"FormControl TaskOutputModal-data-command"},m("code",null,"$ composer ",this.attrs.task.command()))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.output")),m("div",{className:"FormControl TaskOutputModal-data-output"},m("code",null,m("pre",null,this.attrs.task.output()))))))}}flarum.reg.add("flarum-extension-manager","admin/components/TaskOutputModal",H);var z=a(151),Q=a.n(z);function J(e,t){dayjs.extend(Q());const a=dayjs(t).diff(e);return dayjs.duration(a).humanize()}flarum.reg.add("flarum-extension-manager","admin/utils/humanDuration",J);class Z extends(U()){oninit(e){super.oninit(e),s().extensionManager.queue.load()}view(){return m("section",{id:"ExtensionManager-queueSection",className:"ExtensionPage-settings ExtensionManager-queueSection"},m("div",{className:"ExtensionPage-permissions-header ExtensionManager-queueSection-header"},m("div",{className:"container"},m("h2",{className:"ExtensionTitle"},s().translator.trans("flarum-extension-manager.admin.sections.queue.title")),m(l(),{className:"Button Button--icon",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.queue.load(),"aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.refresh"),disabled:s().extensionManager.control.isLoading()}))),m("div",{className:"container"},this.queueTable()))}columns(){const e=new(L());return e.add("operation",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.operation")),content:e=>m("div",{className:"ExtensionManager-queueTable-operation"},m("span",{className:"ExtensionManager-queueTable-operation-icon"},this.operationIcon(e.operation())),m("span",{className:"ExtensionManager-queueTable-operation-name"},s().translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${e.operation()}`)))},80),e.add("package",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.package")),content:e=>{const t=s().data.extensions[e.package()?.replace(/(\/flarum-|\/flarum-ext-|\/)/g,"-")];return t?m(A(),{className:"ExtensionManager-queueTable-package",href:s().route("extension",{id:t.id})},m("div",{className:"ExtensionManager-queueTable-package-icon ExtensionIcon",style:t.icon},!!t.icon&&m(j(),{name:t.icon.name})),m("div",{className:"ExtensionManager-queueTable-package-details"},m("span",{className:"ExtensionManager-queueTable-package-title"},t.extra["flarum-extension"].title),m("span",{className:"ExtensionManager-queueTable-package-name"},e.package()))):e.package()}},75),e.add("status",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.status")),content:e=>m("[",null,m(W,{className:"ExtensionManager-queueTable-status",type:{running:"neutral",failure:"error",pending:"warning",success:"success"}[e.status()]},s().translator.trans(`flarum-extension-manager.admin.sections.queue.statuses.${e.status()}`)),["pending","running"].includes(e.status())&&m(C(),{size:"small",display:"inline"}))},70),e.add("elapsedTime",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.elapsed_time")),content:e=>e.startedAt()&&e.finishedAt()?m(P(),{text:`${dayjs(e.startedAt()).format("LL LTS")} ${dayjs(e.finishedAt()).format("LL LTS")}`},m("span",null,J(e.startedAt(),e.finishedAt()))):s().translator.trans("flarum-extension-manager.admin.sections.queue.task_just_started")},65),e.add("memoryUsed",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.peak_memory_used")),content:e=>m("span",null,e.peakMemoryUsed())},60),e.add("details",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details")),content:e=>m(l(),{className:"Button Button--icon Table-controls-item",icon:"fas fa-file-alt","aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details"),onclick:()=>s().modal.show(H,{task:e}),disabled:["pending","running"].includes(e.status())}),className:"Table-controls"},55),e}queueTable(){const e=s().extensionManager.queue.getItems();if(!e)return m(C(),null);if(e&&!e.length)return m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("flarum-extension-manager.admin.sections.queue.none"));const t=this.columns();return m("[",null,m("div",{className:Y()("Table-container",{"loading-container":e&&s().extensionManager.queue.isLoading()})},m("table",{className:"Table ExtensionManager-queueTable"},m("thead",null,m("tr",null,t.toArray().map(((e,t)=>m("th",{key:t},e.label))))),m("tbody",null,e.map(((e,a)=>m("tr",{key:a},t.toArray().map(((t,a)=>{const{label:n,content:s,...r}=t;return m("td",Object.assign({key:a},r),s(e))}))))))),e&&s().extensionManager.queue.isLoading()&&m(C(),{size:"large"})),m(O(),{total:s().extensionManager.queue.getTotalItems(),currentPage:s().extensionManager.queue.pageNumber()+1,perPage:s().extensionManager.queue.getPerPage(),onChange:e=>s().extensionManager.queue.goto(e)}))}operationIcon(e){return m(j(),{name:{update_check:"fas fa-sync-alt",update_major:"fas fa-play",update_minor:"fas fa-play",update_global:"fas fa-play",extension_install:"fas fa-download",extension_remove:"fas fa-times",extension_update:"fas fa-arrow-alt-circle-up",why_not:"fas fa-exclamation-circle"}[e]})}}flarum.reg.add("flarum-extension-manager","admin/components/QueueSection",Z);const K=flarum.reg.get("core","common/components/Alert");var X=a.n(K);const ee=flarum.reg.get("core","common/utils/Stream");var te=a.n(ee);class ae extends(U()){constructor(){super(...arguments),f(this,"packageName",void 0)}oninit(e){super.oninit(e),this.packageName=te()("")}view(){return m("div",{className:"Form-group ExtensionManager-installer"},m("label",{htmlFor:"install-extension"},s().translator.trans("flarum-extension-manager.admin.extensions.install")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.extensions.install_help",{link:m("a",{href:"https://flarum.org/extensions"},"flarum.org"),semantic_link:m("a",{href:"https://devhints.io/semver"}),code:m("code",null)})),m("div",{className:"FormControl-container"},m("input",{className:"FormControl",id:"install-extension",placeholder:"vendor/package-name",bidi:this.packageName}),m(l(),{className:"Button",icon:"fas fa-download",onclick:this.onsubmit.bind(this),loading:s().extensionManager.control.isLoading("extension-install"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.extensions.proceed"))))}data(){return{package:this.packageName()}}onsubmit(){s().extensionManager.control.requirePackage(this.data())}}flarum.reg.add("flarum-extension-manager","admin/components/Installer",ae);const ne=flarum.reg.get("core","common/helpers/humanTime");var se=a.n(ne);class re extends(V()){constructor(){super(...arguments),f(this,"loading",!0),f(this,"whyNot",null)}className(){return"Modal--large WhyNotModal"}title(){return s().translator.trans("flarum-extension-manager.admin.why_not_modal.title")}oncreate(e){super.oncreate(e),this.requestWhyNot()}content(){return m("div",{className:"Modal-body"},this.loading?m(C(),null):m("pre",{className:"WhyNotModal-contents"},this.whyNot))}requestWhyNot(){s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/why-not`,body:{data:{package:this.attrs.package}}}).then((e=>{this.loading=!1,this.whyNot=e.data.reason,m.redraw()})).catch(b)}}flarum.reg.add("flarum-extension-manager","admin/components/WhyNotModal",re);const oe=flarum.reg.get("core","common/components/Badge");var ie=a.n(oe);const le=flarum.reg.get("core","common/utils/formatAmount");var me=a.n(le);const ue=flarum.reg.get("core","common/Model");var de=a.n(ue);let ce=function(e){return e.Stable="stable",e.Alpha="alpha",e.Beta="beta",e.RC="rc",e.Dev="dev",e}({});function ge(e){return[ce.Stable,ce.RC].includes(pe(e))}function pe(e){const t=e.split("-");if(1===t.length)return ce.Stable;switch(t[1].split(".")[0].toLowerCase()){case"alpha":return ce.Alpha;case"beta":return ce.Beta;case"rc":return ce.RC;default:return ce.Dev}}flarum.reg.add("flarum-extension-manager","admin/utils/versions",{VersionStability:ce,isProductionReady:ge,stability:pe});class he extends(de()){constructor(){super(...arguments),f(this,"extensionId",de().attribute("extensionId")),f(this,"name",de().attribute("name")),f(this,"title",de().attribute("title")),f(this,"description",de().attribute("description")),f(this,"iconUrl",de().attribute("iconUrl")),f(this,"icon",de().attribute("icon")),f(this,"highestVersion",de().attribute("highestVersion")),f(this,"httpUri",de().attribute("httpUri")),f(this,"discussUri",de().attribute("discussUri")),f(this,"vendor",de().attribute("vendor")),f(this,"isPremium",de().attribute("isPremium")),f(this,"isLocale",de().attribute("isLocale")),f(this,"locale",de().attribute("locale")),f(this,"latestFlarumVersionSupported",de().attribute("latestFlarumVersionSupported")),f(this,"downloads",de().attribute("downloads")),f(this,"installed",!1)}isSupported(){const e=s().data.settings.version,t=this.latestFlarumVersionSupported();return e.split("-")[1]===t.split("-")[1]&&e.split(".")[0]===t.split(".")[0]}isProductionReady(){return ge(this.highestVersion())}toLocalExtension(){return{id:this.extensionId(),name:this.name(),version:this.highestVersion(),description:this.description(),icon:this.icon()||{name:"fas fa-box-open",backgroundColor:"#117187",color:"#fff"},links:{discuss:this.discussUri(),website:this.httpUri()},extra:{"flarum-extension":{title:this.title()}}}}}flarum.reg.add("flarum-extension-manager","admin/models/ExternalExtension",he);const fe=flarum.reg.get("core","common/components/Dropdown");var xe=a.n(fe);const be=flarum.reg.get("core","common/components/LinkButton");var ye=a.n(be);class ve extends(U()){getExtension(){return this.attrs.extension instanceof he?this.attrs.extension.toLocalExtension():this.attrs.extension}view(){const e=this.getExtension(),{isCore:t,isDanger:a}=this.attrs;return m("div",{className:Y()("ExtensionCard",{"ExtensionCard--core":t,"ExtensionCard--danger":a})},m("div",{className:"ExtensionCard-header"},this.icon(),m(P(),{text:e.name},m("h4",null,e.extra["flarum-extension"].title)),this.attrs.extension instanceof he&&m("div",{className:"ExtensionCard-badges"},this.badges().toArray()),m("div",{className:"ExtensionCard-actions"},this.actionItems().toArray())),m("div",{className:"ExtensionCard-body"},m("p",null,e.description)),m("div",{className:"ExtensionCard-footer"},m("div",{className:"ExtensionCard-meta"},this.metaItems().toArray())))}icon(){const e=this.getExtension();this.attrs.extension instanceof he&&e.id in s().data.extensions&&(e.icon=s().data.extensions[e.id].icon);const t=e.icon||{};return!e.icon?.name&&this.attrs.extension instanceof he&&!(e.id in s().data.extensions)&&this.attrs.extension.iconUrl()&&(t.backgroundImage=`url(${this.attrs.extension.iconUrl()})`),m("span",{className:"ExtensionIcon",style:e.icon},e.icon?.name?m(j(),{name:e.icon.name}):null)}badges(){const e=new(L()),t=this.attrs.extension;return t.isSupported()?e.add("compatible",m(ie(),{icon:"fas fa-check",type:"success",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.compatible"),className:"Badge--flat Badge--square"})):e.add("incompatible",m(ie(),{icon:"fas fa-times",type:"danger",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.incompatible"),className:"Badge--flat Badge--square"})),t.isPremium()&&e.add("premium",m(ie(),{icon:"fas fa-dollar-sign",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.premium"),className:"ExtensionCard-badge--premium Badge--flat Badge--square"})),t.isProductionReady()||e.add("unstable",m(ie(),{icon:"fas fa-flask",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.unstable"),className:"Badge--flat Badge--square Badge--danger"})),"fof"===t.name().split("/")[0]&&e.add("fof",m(ie(),{icon:"fas fa-users",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.fof"),className:"Badge--flat Badge--square"})),"flarum"===t.name().split("/")[0]&&e.add("flarum",m(ie(),{icon:"fab fa-flarum",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.flarum"),className:"ExtensionCard-badge--flarum Badge--flat Badge--square"})),e}metaItems(){const e=new(L()),{updates:t,isCore:a}=this.attrs,n=t?t["latest-minor"]??(t["latest-major"]&&!a?t["latest-major"]:null):null;return this.attrs.extension instanceof he?e.add("downloads",m("span",null,m(j(),{name:"fas fa-circle-down"}),s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.downloads",{count:this.attrs.extension.downloads(),formattedCount:me()(this.attrs.extension.downloads())}))):e.add("version",m("div",{className:"ExtensionCard-version"},m("span",{className:"ExtensionCard-version-current"},this.version(t.version)),n?m("[",null,m(j(),{name:"fas fa-arrow-right"}),m(W,{className:"ExtensionCard-version-latest",type:t["latest-minor"]?"success":"warning"},this.version(n))):null)),this.attrs.extension instanceof he&&(e.add("version",m("div",{className:"ExtensionCard-version"},"v",this.version(this.attrs.extension.highestVersion()))),e.add("link",m(ye(),{className:"Button Button--ua-reset Button--link Button--icon",href:this.attrs.extension.httpUri(),target:"_blank",icon:"fas fa-external-link-alt",external:!0}))),e}actionItems(){const e=new(L()),{updates:t,extension:a,onClickUpdate:n,whyNotWarning:r}=this.attrs;return a instanceof he?a.extensionId()in s().data.extensions?e.add("installed",m(l(),{className:"Button Button--icon Button--flat Button--success",icon:"fas fa-check-circle",disabled:!0})):e.add("install",m(l(),{className:"Button Button--icon Button--flat",icon:"fas fa-cloud-arrow-down",onclick:()=>{s().extensionManager.control.requirePackage({package:a.name()})}})):(n&&"function"==typeof n?e.add("update",m(P(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",className:"Button Button--icon Button--flat",onclick:n,"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.update")}))):n&&e.add("update",m(xe(),{buttonClassName:"Button Button--icon Button--flat",icon:"fas fa-ellipsis",label:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",onclick:n.soft},s().translator.trans("flarum-extension-manager.admin.extensions.update_soft_label")),m(l(),{icon:"fas fa-rotate",onclick:n.hard,disabled:!t["direct-dependency"]},s().translator.trans("flarum-extension-manager.admin.extensions.update_hard_label")))),r&&e.add("whyNot",m(P(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")},m(l(),{icon:"fas fa-exclamation-circle",className:"Button Button--icon Button--flat Button--danger",onclick:()=>s().modal.show(re,{package:a.name}),"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")})))),e}version(e){return"v"===e.charAt(0)?e.substring(1):e}}flarum.reg.add("flarum-extension-manager","admin/components/ExtensionCard",ve);class _e extends(U()){constructor(){super(...arguments),f(this,"updateState",void 0)}oninit(e){super.oninit(e),this.updateState=this.attrs.updateState}view(){return m("div",{className:Y()("Form-group Form-group--danger ExtensionManager-majorUpdate",{"ExtensionManager-majorUpdate--failed":"failure"===this.updateState.status,"ExtensionManager-majorUpdate--incompatibleExtensions":this.updateState.incompatibleExtensions.length})},m("img",{alt:"flarum logo",src:s().forum.attribute("baseUrl")+"/assets/extensions/flarum-extension-manager/flarum.svg"}),m("label",null,s().translator.trans("flarum-extension-manager.admin.major_updater.title",{version:this.attrs.coreUpdate["latest-major"]})),m("p",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.major_updater.description")),m("div",{className:"ExtensionManager-updaterControls"},m(P(),{text:s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run_help")},m(l(),{className:"Button",icon:"fas fa-vial",onclick:this.update.bind(this,!0),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run"))),m(l(),{className:"Button Button--danger",icon:"fas fa-play",onclick:this.update.bind(this,!1),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.update"))),this.updateState.incompatibleExtensions.length?m("div",{className:"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid"},this.updateState.incompatibleExtensions.map((e=>m(ve,{extension:s().data.extensions[e.replace("flarum-","").replace("flarum-ext-","").replace("/","-")],updates:{},onClickUpdate:null,isDanger:!0})))):null,"failure"===this.updateState.status?m(X(),{type:"error",className:"ExtensionManager-majorUpdate-failure",dismissible:!1,controls:[m(l(),{className:"Button Button--text ExtensionManager-majorUpdate-failure-details",icon:"fas fa-question-circle",onclick:()=>s().modal.show(re,{package:"flarum/core"})},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.why"))]},m("p",{className:"ExtensionManager-majorUpdate-failure-desc"},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.desc"))):null)}update(e){s().extensionManager.control.majorUpdate({dryRun:e})}}flarum.reg.add("flarum-extension-manager","admin/components/MajorUpdater",_e);const ke=flarum.reg.get("core","common/components/InfoTile");var Ne=a.n(ke);class Me extends(U()){view(){const e=s().extensionManager.control.coreUpdate;return[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.updater.updater_title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.updater.updater_help")),this.lastUpdateCheckView(),m("div",{className:"ExtensionManager-updaterControls"},this.controlItems().toArray()),this.availableUpdatesView()),e&&e.package["latest-major"]&&ge(e.package["latest-major"])?m(_e,{coreUpdate:e.package,updateState:s().extensionManager.control.lastUpdateRun.major}):null]}lastUpdateCheckView(){return s().extensionManager.control.lastUpdateCheck?.checkedAt&&m("p",{className:"ExtensionManager-lastUpdatedAt"},m("span",{className:"ExtensionManager-lastUpdatedAt-label"},s().translator.trans("flarum-extension-manager.admin.updater.last_update_checked_at")),m("span",{className:"ExtensionManager-lastUpdatedAt-value"},se()(s().extensionManager.control.lastUpdateCheck.checkedAt)))||null}availableUpdatesView(){const e=s().extensionManager.control;if(s().extensionManager.control.isLoading("check")||s().extensionManager.control.isLoading("global-update"))return m("div",{className:"ExtensionManager-extensions"},m(C(),null));const t=e.coreUpdate&&e.coreUpdate.package["latest-minor"];return e.extensionUpdates.length||t?m("div",{className:"ExtensionManager-extensions"},m("div",{className:"ExtensionManager-extensions-grid"},t?m(ve,{extension:e.coreUpdate.extension,updates:e.coreUpdate.package,isCore:!0,onClickUpdate:()=>e.updateCoreMinor(),whyNotWarning:e.lastUpdateRun.limitedPackages().includes("flarum/core")}):null,e.extensionUpdates.map((t=>m(ve,{extension:t,updates:e.packageUpdates[t.id],onClickUpdate:{soft:()=>e.updateExtension(t,"soft"),hard:()=>e.updateExtension(t,"hard")},whyNotWarning:e.lastUpdateRun.limitedPackages().includes(t.name)}))))):m("div",{className:"ExtensionManager-extensions ExtensionManager-extensions--empty"},m(Ne(),{icon:"fas fa-plug-circle-check"},s().translator.trans("flarum-extension-manager.admin.updater.up_to_date")))}controlItems(){const e=new(L());return e.add("updateCheck",m(l(),{className:"Button",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.control.checkForUpdates(),loading:s().extensionManager.control.isLoading("check"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.check_for_updates")),100),e.add("globalUpdate",m(l(),{className:"Button",icon:"fas fa-play",onclick:()=>s().extensionManager.control.updateGlobally(),loading:s().extensionManager.control.isLoading("global-update"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.run_global_update"))),e}}flarum.reg.add("flarum-extension-manager","admin/components/Updater",Me);const we=flarum.reg.get("core","common/components/Form");var Ee=a.n(we);class Se extends(U()){oninit(e){super.oninit(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-controlSection"},m("div",{className:"container"},s().data["flarum-extension-manager.writable_dirs"]?m(Ee(),null,m(ae,null),m(Me,null)):m("div",{className:"Form-group"},m(X(),{type:"warning",dismissible:!1},s().translator.trans("flarum-extension-manager.admin.file_permissions")))))}}flarum.reg.add("flarum-extension-manager","admin/components/ControlSection",Se);const Be=flarum.reg.get("core","common/components/FormGroup");var Ue=a.n(Be);class $e extends(U()){constructor(){super(...arguments),f(this,"settings",{}),f(this,"initialSettings",null),f(this,"loading",!1),f(this,"type",void 0)}oninit(e){super.oninit(e),this.submit(!0)}className(){return""}view(){return m("div",{className:Y()("FormSection",this.className())},m("label",null,this.title()),this.content(),m("div",{className:"Form-group Form-controls"},this.submitButton()))}submitButton(){return[m(l(),{className:"Button Button--primary",loading:this.loading,onclick:()=>this.submit(!1),disabled:!this.isDirty()},s().translator.trans("core.admin.settings.submit_button"))]}customSettingComponents(){return Ue().prototype.customFieldComponents()}setting(e){return this.settings[e]??(this.settings[e]=te()())}submit(e){this.loading=!0;const t={};Object.keys(this.settings).forEach((e=>{t[e]=this.settings[e]()})),s().request({method:"POST",url:s().forum.attribute("apiUrl")+"/extension-manager/composer",body:{type:this.type,data:e?null:t}}).then((e=>{let{data:t}=e;Object.keys(t).forEach((e=>{this.settings[e]=te()(t[e])})),this.initialSettings=Array.isArray(t)?{}:t})).finally((()=>{this.loading=!1,m.redraw()}))}isDirty(){return JSON.stringify(this.initialSettings)!==JSON.stringify(this.settings)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureJson",$e);const Ce=flarum.reg.get("core","common/components/Select");var qe=a.n(Ce);class Pe extends(V()){constructor(){super(...arguments),f(this,"name",void 0),f(this,"repository",void 0)}oninit(e){super.oninit(e),this.name=te()(this.attrs.name||""),this.repository=te()(this.attrs.repository||{type:"composer",url:""})}className(){return"RepositoryModal Modal--small"}title(){const e=this.attrs.repository?"edit":"add";return s().translator.trans(`flarum-extension-manager.admin.composer.${e}_repository_label`)}content(){const e={composer:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.composer"),vcs:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.vcs"),path:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.path")};return m("div",{className:"Modal-body"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.name_label")),m("input",{className:"FormControl",bidi:this.name})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.type_label")),m(qe(),{options:e,value:this.repository().type,onchange:e=>this.repository({...this.repository(),type:e})})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.url")),m("input",{className:"FormControl",onchange:e=>this.repository({...this.repository(),url:e.target.value}),value:this.repository().url})),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.repository(),this.name()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/RepositoryModal",Pe);class Te extends $e{constructor(){super(...arguments),f(this,"type","composer")}title(){return s().translator.trans("flarum-extension-manager.admin.composer.title")}className(){return"ConfigureComposer"}content(){return m("div",{className:"Form ExtensionManager-SettingsGroups-content"},this.attrs.buildSettingComponent.call(this,{setting:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label"),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help"),type:"select",options:{stable:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.stable"),RC:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.rc"),beta:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.beta"),alpha:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.alpha"),dev:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.dev")}}),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.label")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.composer.repositories.help")),m("div",{className:"ConfigureComposer-repositories"},Object.keys(this.setting("repositories")()||{}).map((e=>{const t=this.setting("repositories")()[e];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:{composer:"fas fa-cubes",vcs:"fas fa-code-branch",path:"fas fa-folder"}[t.type],onclick:()=>s().modal.show(Pe,{name:e,repository:t,onsubmit:(t,a)=>{const n=this.setting("repositories")();delete n[e],this.setting("repositories")(n),this.onchange(t,a)}})},e," (",t.type,")"),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_label"),onclick:()=>{if(confirm(v()(s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_confirmation")))){const t={...this.setting("repositories")()};delete t[e],this.setting("repositories")(t)}}}))})))))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",onclick:()=>s().modal.show(Pe,{onsubmit:this.onchange.bind(this)})},s().translator.trans("flarum-extension-manager.admin.composer.add_repository_label"))),e}onchange(e,t){this.setting("repositories")({...this.setting("repositories")(),[t]:e})}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureComposer",Te);class je extends(V()){constructor(){super(...arguments),f(this,"type",void 0),f(this,"host",void 0),f(this,"token",void 0)}oninit(e){super.oninit(e),this.type=te()(this.attrs.type||"bearer"),this.host=te()(this.attrs.host||""),this.token=te()(this.attrs.token||"")}className(){return"AuthMethodModal Modal--small"}title(){const e=this.attrs.host?"edit":"add";return s().translator.trans(`flarum-extension-manager.admin.auth_config.${e}_label`)}content(){const e={"github-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.github-oauth"),"gitlab-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-oauth"),"gitlab-token":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-token"),bearer:s().translator.trans("flarum-extension-manager.admin.auth_config.types.bearer")};return m("div",{className:"Modal-body"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.type_label")),m(qe(),{options:e,value:this.type(),onchange:this.type})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_label")),m("input",{className:"FormControl",bidi:this.host,placeholder:s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_placeholder")})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.token_label")),m("textarea",{className:"FormControl",oninput:e=>this.token(e.target.value),rows:"6",placeholder:this.token().startsWith("unchanged:")?v()(s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder")):""},this.token().startsWith("unchanged:")?"":this.token())),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.type(),this.host(),this.token()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/AuthMethodModal",je);class Fe extends $e{constructor(){super(...arguments),f(this,"type","auth")}title(){return s().translator.trans("flarum-extension-manager.admin.auth_config.title")}className(){return"ConfigureAuth"}content(){const e=Object.keys(this.settings),t=e.length&&e.every((e=>{const t=this.settings[e]();return Array.isArray(t)?t.length:Object.keys(t).length}));return m("div",{className:"ExtensionManager-SettingsGroups-content"},t?e.map((e=>{const t=this.settings[e]();return m("div",{className:"Form-group"},m("label",null,s().translator.trans(`flarum-extension-manager.admin.auth_config.types.${e}`)),m("div",{className:"ConfigureAuth-hosts"},Object.keys(t).map((a=>{const n=t[a];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:"fas fa-key",onclick:()=>s().modal.show(je,{type:e,host:a,token:n,onsubmit:this.onchange.bind(this,a)})},a),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.auth_config.delete_label"),onclick:()=>{if(confirm(v()(s().translator.trans("flarum-extension-manager.admin.auth_config.delete_confirmation")))){const t={...this.setting(e)()};delete t[a],Object.keys(t).length?this.setting(e)(t):delete this.settings[e]}}}))}))))})):m("span",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.auth_config.no_auth_methods_configured")))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",loading:this.loading,onclick:()=>s().modal.show(je,{onsubmit:this.onchange.bind(this,null)})},s().translator.trans("flarum-extension-manager.admin.auth_config.add_label"))),e}onchange(e,t,a,n){const s={...this.setting(t)()};e&&delete s[e],s[a]=n,this.setting(t)(s)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureAuth",Fe);const Le=flarum.reg.get("core","common/components/Input");var Ie=a.n(Le);const Ae=flarum.reg.get("core","common/helpers/listItems");var De=a.n(Ae);const Oe=flarum.reg.get("core","common/utils/throttleDebounce");class Re extends(U()){constructor(){super(...arguments),f(this,"search",te()("")),f(this,"warningsDismissed",te()(!1)),f(this,"applySearch",(0,Oe.throttle)(1200,(e=>{const t=s().extensionManager.extensions.getParams();s().extensionManager.extensions.refreshParams({...t,filter:{...t.filter,q:e}},1)})))}oninit(e){super.oninit(e),s().extensionManager.extensions.goto(1),this.warningsDismissed("true"===localStorage.getItem("flarum-extension-manager.warningsDismissed"))}load(e){void 0===e&&(e=1),s().extensionManager.extensions.goto(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-DiscoverSection"},m("div",{className:"container"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.discover.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.discover.description"),this.warningsDismissed()&&m(l(),{className:"Button Button--text Button--warning Button--more",icon:"fas fa-exclamation-triangle",onclick:()=>this.setWarningDismissed(!1)}))),!this.warningsDismissed()&&m("div",{className:"ExtensionManager-warnings Form-group"},m(X(),{className:"ExtensionManager-primaryWarning",type:"warning",dismissible:!0,ondismiss:()=>this.setWarningDismissed(!0)},m("ul",null,De()(this.warningItems().toArray())))),m("div",{className:"Tabs"},m("div",{className:"Tabs-nav"},this.tabItems().toArray()),m("div",{className:"Tabs-content"},m("hr",{className:"Tabs-divider"}),m("div",{className:"ExtensionManager-DiscoverSection-toolbar"},m("div",{className:"ExtensionManager-DiscoverSection-toolbar-primary"},this.toolbarPrimaryItems().toArray()),m("div",{className:"ExtensionManager-DiscoverSection-toolbar-secondary"},this.toolbarSecondaryItems().toArray())),this.extensionList(),m("div",{className:"ExtensionManager-DiscoverSection-footer"},this.footerItems().toArray()))))))}tabFilters(){return{"":{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.discover"),active:()=>!s().extensionManager.extensions.getParams().filter?.type},extension:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.extensions"),active:()=>"extension"===s().extensionManager.extensions.getParams().filter?.type},locale:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.languages"),active:()=>"locale"===s().extensionManager.extensions.getParams().filter?.type},theme:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.themes"),active:()=>"theme"===s().extensionManager.extensions.getParams().filter?.type}}}tabItems(){const e=new(L()),t=this.tabFilters();return Object.keys(t).forEach((a=>{const n=t[a];e.add(a,m(l(),{className:"Button Button--link",active:n.active(),onclick:()=>{s().extensionManager.extensions.changeFilter("type",a)}},n.label))})),e}warningItems(){const e=new(L());return e.add("accessWarning",s().translator.trans("flarum-extension-manager.admin.settings.access_warning")),s().data.debugEnabled&&e.add("devModeWarning",s().translator.trans("flarum-extension-manager.admin.settings.debug_mode_warning")),e}toolbarPrimaryItems(){const e=new(L());return e.add("search",m(Ie(),{value:this.search(),onchange:e=>{this.search(e),this.applySearch(e)},inputAttrs:{className:"FormControl-alt"},clearable:!0,placeholder:s().translator.trans("flarum-extension-manager.admin.sections.discover.search"),prefixIcon:"fas fa-search"})),e}toolbarSecondaryItems(){const e=new(L()),t=s().extensionManager.extensions.sortMap(),a=Object.keys(t).reduce(((e,a)=>{const n=t[a];return e[a]="string"!=typeof n?n.label:n,e}),{});e.add("sort",m(xe(),{buttonClassName:"Button",label:a[s().extensionManager.extensions.getParams().sort]||Object.keys(t).map((e=>a[e]))[0],accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label")},Object.keys(a).map((e=>{const t=a[e],n=s().extensionManager.extensions.getParams().sort===e;return m(l(),{icon:!n||"fas fa-check",onclick:()=>s().extensionManager.extensions.changeSort(e),active:n},t)}))));const n=(s().extensionManager.extensions.getParams().filter?.is?.[0]??null)||"all";return e.add("party",m(xe(),{buttonClassName:"Button",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+n),accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label")},["all","premium"].map((e=>m(l(),{icon:n!==e||"fas fa-check",onclick:()=>{s().extensionManager.extensions.changeFilter("is","all"===e?void 0:[e])},active:n===e},s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+e)))))),e}extensionList(){return!s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()?m(C(),{display:"block"}):s().extensionManager.extensions.hasItems()?m("div",{className:Y()("ExtensionManager-DiscoverSection-list",{"loading-container":s().extensionManager.extensions.isLoading()})},m("div",{className:"ExtensionManager-DiscoverSection-list-inner"},s().extensionManager.extensions.getPages().map((e=>e.items.map((e=>m(ve,{extension:e,key:e.name()})))))),s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()&&m(C(),{size:"large"})):m("div",{className:"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty"},m(Ne(),{icon:"fas fa-plug-circle-exclamation"},s().translator.trans("flarum-extension-manager.admin.sections.discover.empty_results")))}footerItems(){const e=new(L());return e.add("pagination",m(O(),{total:s().extensionManager.extensions.totalItems,perPage:s().extensionManager.extensions.pageSize,currentPage:s().extensionManager.extensions.getLocation().page,onChange:e=>{s().extensionManager.extensions.getLocation().page!==e&&this.load(e)}})),e.add("premiumTermsLink",m(ye(),{className:"Button Button--link",href:"https://flarum.org/terms/premium-extensions",external:!0,target:"_blank",icon:"fas fa-circle-info"},s().translator.trans("flarum-extension-manager.admin.sections.discover.premium_extension_terms"))),e}setWarningDismissed(e){this.warningsDismissed(e),localStorage.setItem("flarum-extension-manager.warningsDismissed",e?"true":"false")}}flarum.reg.add("flarum-extension-manager","admin/components/DiscoverSection",Re);class Ye extends(o()){content(){const e=s().registry.getSettings(this.extension.id);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},e?[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.settings.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.settings.description"))),m("div",{className:"FormSectionGroup ExtensionManager-SettingsGroups"},m("div",{className:"FormSection"},m("label",null,s().translator.trans("flarum-extension-manager.admin.settings.title")),m("div",{className:"Form"},e.map(this.buildSettingComponent.bind(this))),m("div",{className:"Form-group Form--controls"},this.submitButton())),m(Te,{buildSettingComponent:this.buildSettingComponent}),m(Fe,{buildSettingComponent:this.buildSettingComponent}))]:m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("core.admin.extension.no_settings"))))}sections(e){const t=super.sections(e);return t.add("discover",m(Re,null),15),t.add("control",m(Se,null),10),t.setPriority("content",8),"0"!==s().data.settings["flarum-extension-manager.queue_jobs"]&&s().data.settings["flarum-extension-manager.queue_jobs"]&&t.add("queue",m(Z,null),5),t.remove("permissions"),t}onsaved(){super.onsaved(),m.redraw()}}flarum.reg.add("flarum-extension-manager","admin/components/SettingsPage",Ye);const We=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ge=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ve=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],He=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],ze=(e,t,a)=>{let n=e;return"string"==typeof t||Array.isArray(t)?n=e.toLocaleString(t,a):!0!==t&&void 0===a||(n=e.toLocaleString(void 0,a)),n};class Qe extends(de()){status(){return de().attribute("status").call(this)}operation(){return de().attribute("operation").call(this)}command(){return de().attribute("command").call(this)}package(){return de().attribute("package").call(this)}output(){return de().attribute("output").call(this)}guessedCause(){return de().attribute("guessedCause").call(this)}createdAt(){return de().attribute("createdAt",de().transformDate).call(this)}startedAt(){return de().attribute("startedAt",de().transformDate).call(this)}finishedAt(){return de().attribute("finishedAt",de().transformDate).call(this)}peakMemoryUsed(){return function(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const a=(t={bits:!1,binary:!1,space:!0,...t}).bits?t.binary?He:Ve:t.binary?Ge:We,n=t.space?" ":"";if(t.signed&&0===e)return` 0${n}${a[0]}`;const s=e<0,r=s?"-":t.signed?"+":"";let o;if(s&&(e=-e),void 0!==t.minimumFractionDigits&&(o={minimumFractionDigits:t.minimumFractionDigits}),void 0!==t.maximumFractionDigits&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1)return r+ze(e,t.locale,o)+n+a[0];const i=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),a.length-1);return e/=(t.binary?1024:1e3)**i,o||(e=e.toPrecision(3)),r+ze(Number(e),t.locale,o)+n+a[i]}(1024*de().attribute("peakMemoryUsed").call(this))}}flarum.reg.add("flarum-extension-manager","admin/models/Task",Qe);const Je=[(new(S().Store)).add("extension-manager-tasks",Qe).add("external-extensions",he),(new(S().Admin)).setting((()=>({setting:"flarum-extension-manager.queue_jobs",label:s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs"),help:s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs_help",{basic_impl_link:m("a",{href:"https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting"}),adv_impl_link:m("a",{href:"https://discuss.flarum.org/d/21873-redis-sessions-cache-queues"}),php_version:m("strong",null,s().data.phpVersion),folder_perms_link:m("a",{href:"https://docs.flarum.org/install#folder-ownership"})}),type:"boolean",disabled:s().data["flarum-extension-manager.using_sync_queue"]}))).setting((()=>({setting:"flarum-extension-manager.task_retention_days",label:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days"),help:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days_help"),type:"number"}))).page(Ye).generalIndexItems("settings",(()=>[{id:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help",{},!0)},{id:"repositories",label:s().translator.trans("flarum-extension-manager.admin.composer.repositories.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.repositories.help",{},!0)},{id:"composer-auth",label:s().translator.trans("flarum-extension-manager.admin.auth_config.title",{},!0)},{id:"updates",label:s().translator.trans("flarum-extension-manager.admin.updater.updater_title",{},!0),help:s().translator.trans("flarum-extension-manager.admin.updater.updater_help",{},!0)}]))];s().initializers.add("flarum-extension-manager",(t=>{t.extensionManager=new w,t.data["flarum-extension-manager.using_sync_queue"]&&(t.data.settings["flarum-extension-manager.queue_jobs"]="0"),(0,e.extend)(o().prototype,"topItems",(function(e){"flarum-extension-manager"===this.extension.id||g()(this.extension.id)||e.add("remove",m(l(),{className:"Button Button--danger",icon:"fas fa-times",onclick:()=>{t.modal.show(d()),t.request({url:`${t.forum.attribute("apiUrl")}/extension-manager/extensions/${this.extension.id}`,method:"DELETE"}).then((e=>{e?.processing?p():(t.alerts.show({type:"success"},t.translator.trans("flarum-extension-manager.admin.extensions.successful_remove")),window.location=t.forum.attribute("adminUrl"))})).finally((()=>{t.modal.close()}))}},t.translator.trans("flarum-extension-manager.admin.extensions.remove")))}))}))})(),module.exports=n})(); +(()=>{var e={151:function(e){e.exports=function(){"use strict";var e,t,a=1e3,n=6e4,s=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,i=31536e6,l=2628e6,m=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:i,months:l,days:r,hours:s,minutes:n,seconds:a,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof b},c=function(e,t,a){return new b(e,a,t.$l)},g=function(e){return t.p(e)+"s"},p=function(e){return e<0},h=function(e){return p(e)?Math.ceil(e):Math.floor(e)},f=function(e){return Math.abs(e)},x=function(e,t){return e?p(e)?{negative:!0,format:""+f(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function p(e,t,a){var n=this;if(this.$d={},this.$l=a,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return c(e*u[g(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){n.$d[g(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var s=e.match(m);if(s){var r=s.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var f=p.prototype;return f.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,a){return t+(e.$d[a]||0)*u[a]}),0)},f.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/i),e%=i,this.$d.months=h(e/l),e%=l,this.$d.days=h(e/r),e%=r,this.$d.hours=h(e/s),e%=s,this.$d.minutes=h(e/n),e%=n,this.$d.seconds=h(e/a),e%=a,this.$d.milliseconds=e},f.toISOString=function(){var e=x(this.$d.years,"Y"),t=x(this.$d.months,"M"),a=+this.$d.days||0;this.$d.weeks&&(a+=7*this.$d.weeks);var n=x(a,"D"),s=x(this.$d.hours,"H"),r=x(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var i=x(o,"S"),l=e.negative||t.negative||n.negative||s.negative||r.negative||i.negative,m=s.format||r.format||i.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+n.format+m+s.format+r.format+i.format;return"P"===u||"-P"===u?"P0D":u},f.toJSON=function(){return this.toISOString()},f.format=function(e){var a=e||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return a.replace(o,(function(e,t){return t||String(n[e])}))},f.as=function(e){return this.$ms/u[g(e)]},f.get=function(e){var t=this.$ms,a=g(e);return"milliseconds"===a?t%=1e3:t="weeks"===a?h(t/u[a]):this.$d[a],t||0},f.add=function(e,t,a){var n;return n=t?e*u[g(t)]:d(e)?e.$ms:c(e,this).$ms,c(this.$ms+n*(a?-1:1),this)},f.subtract=function(e,t){return this.add(e,t,!0)},f.locale=function(e){var t=this.clone();return t.$l=e,t},f.clone=function(){return c(this.$ms,this)},f.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},f.valueOf=function(){return this.asMilliseconds()},f.milliseconds=function(){return this.get("milliseconds")},f.asMilliseconds=function(){return this.as("milliseconds")},f.seconds=function(){return this.get("seconds")},f.asSeconds=function(){return this.as("seconds")},f.minutes=function(){return this.get("minutes")},f.asMinutes=function(){return this.as("minutes")},f.hours=function(){return this.get("hours")},f.asHours=function(){return this.as("hours")},f.days=function(){return this.get("days")},f.asDays=function(){return this.as("days")},f.weeks=function(){return this.get("weeks")},f.asWeeks=function(){return this.as("weeks")},f.months=function(){return this.get("months")},f.asMonths=function(){return this.as("months")},f.years=function(){return this.get("years")},f.asYears=function(){return this.as("years")},p}(),y=function(e,t,a){return e.add(t.years()*a,"y").add(t.months()*a,"M").add(t.days()*a,"d").add(t.hours()*a,"h").add(t.minutes()*a,"m").add(t.seconds()*a,"s").add(t.milliseconds()*a,"ms")};return function(a,n,s){e=s,t=s().$utils(),s.duration=function(e,t){var a=s.locale();return c(e,{$l:a},t)},s.isDuration=d;var r=n.prototype.add,o=n.prototype.subtract;n.prototype.add=function(e,t){return d(e)?y(this,e,1):r.bind(this)(e,t)},n.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}()}},t={};function a(n){flarum.reg._webpack_runtimes["flarum-extension-manager"]||=a;var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";a.r(n),a.d(n,{extend:()=>Je});const e=flarum.reg.get("core","common/extend"),t=flarum.reg.get("core","admin/app");var s=a.n(t);const r=flarum.reg.get("core","admin/components/ExtensionPage");var o=a.n(r);const i=flarum.reg.get("core","common/components/Button");var l=a.n(i);const u=flarum.reg.get("core","admin/components/LoadingModal");var d=a.n(u);const c=flarum.reg.get("core","admin/utils/isExtensionEnabled");var g=a.n(c);function p(){s().modal.close(),m.route.set(s().route("extension",{id:"flarum-extension-manager"})),s().extensionManager.queue.load({},!0),setTimeout((()=>{document.getElementById("ExtensionManager-queueSection")?.scrollIntoView({block:"nearest"})}),200)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e,t,a){return(t=function(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=h(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}window.jumpToQueue=p,flarum.reg.add("flarum-extension-manager","admin/utils/jumpToQueue",p);class x{constructor(){f(this,"polling",null),f(this,"tasks",null),f(this,"limit",20),f(this,"offset",0),f(this,"total",0),f(this,"loading",!1)}load(e,t){return void 0===t&&(t=!1),this.loading=!0,e={page:{limit:this.limit,offset:this.offset,...e?.page},...e},s().store.find("extension-manager-tasks",e||{}).then((e=>{this.tasks=e,this.total=e.payload.meta?.page?.total||0,m.redraw();const a=e?.find((e=>"pending"===e.status()||"running"===e.status()));return a?this.pollQueue(t):t?(s().extensionManager.control.setLoading(null),window.location.reload()):s().extensionManager.control.isLoading()&&s().extensionManager.control.setLoading(null),this.loading=!1,e}))}isLoading(){return this.loading}getItems(){return this.tasks}getTotalItems(){return this.total}getTotalPages(){return Math.ceil(this.total/this.limit)}pageNumber(){return Math.ceil(this.offset/this.limit)}getPerPage(){return this.limit}hasPrev(){return 0!==this.pageNumber()}hasNext(){return this.offset+this.limit{this.load({},e)}),6e3)}hasPending(){return!!this.tasks?.find((e=>"pending"===e.status()||"running"===e.status()))}}function b(e){s().extensionManager.control.setLoading(null);const t=e.response.errors[0];if(!["composer_command_failure","extension_already_installed","extension_not_installed"].includes(t.code))throw e;switch(s().alerts.clear(),t.code){case"composer_command_failure":t.guessed_cause?(s().alerts.show({type:"error"},s().translator.trans(`flarum-extension-manager.admin.exceptions.guessed_cause.${t.guessed_cause}`)),s().modal.close()):s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.composer_command_failure"));break;case"extension_already_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_already_installed")),s().modal.close();break;case"extension_not_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_not_installed")),s().modal.close()}}flarum.reg.add("flarum-extension-manager","admin/states/QueueState",x);const y=flarum.reg.get("core","common/utils/extractText");var v=a.n(y);class _{get lastUpdateRun(){const e=JSON.parse(s().data.settings["flarum-extension-manager.last_update_run"]);return e.limitedPackages=()=>[...e.major.limitedPackages,...e.minor.limitedPackages,...e.global.limitedPackages],e}constructor(){f(this,"loading",null),f(this,"packageUpdates",{}),f(this,"lastUpdateCheck",void 0),f(this,"extensionUpdates",void 0),f(this,"coreUpdate",null),this.lastUpdateCheck=JSON.parse(s().data.settings["flarum-extension-manager.last_update_check"]),this.extensionUpdates=this.formatExtensionUpdates(this.lastUpdateCheck),this.coreUpdate=this.formatCoreUpdate(this.lastUpdateCheck)}isLoading(e){return void 0===e&&(e=null),e&&this.loading===e||!e&&null!==this.loading}hasOperationRunning(){return this.isLoading()||s().extensionManager.queue.hasPending()}setLoading(e){this.loading=e}requirePackage(e){s().extensionManager.control.setLoading("extension-install"),s().modal.show(d()),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/extensions`,body:{data:e}}).then((e=>{if(e.processing)p();else{const t=e.id;s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_install",{extension:t})),window.location.href=`${s().forum.attribute("adminUrl")}#/extension/${t}`,window.location.reload()}})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}checkForUpdates(){this.setLoading("check"),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/check-for-updates`}).then((e=>{e.processing?p():(this.lastUpdateCheck=e,this.extensionUpdates=this.formatExtensionUpdates(e),this.coreUpdate=this.formatCoreUpdate(e),this.setLoading(null),m.redraw())})).catch(b).finally((()=>{m.redraw()}))}updateCoreMinor(){confirm(v()(s().translator.trans("flarum-extension-manager.admin.minor_update_confirmation.content")))&&(s().modal.show(d()),this.setLoading("minor-update"),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/minor-update`}).then((e=>{e?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()})))}updateExtension(e,t){s().modal.show(d()),this.setLoading("extension-update"),s().request({method:"PATCH",url:`${s().forum.attribute("apiUrl")}/extension-manager/extensions/${e.id}`,body:{data:{updateMode:t}}}).then((t=>{t?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_update",{extension:e.extra["flarum-extension"].title})),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}updateGlobally(){s().modal.show(d()),this.setLoading("global-update"),s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/global-update`}).then((e=>{e?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.updater.global_update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}formatExtensionUpdates(e){return this.packageUpdates={},e?.updates?.installed?.filter((e=>{const t=e.name.replace("/","-").replace(/(flarum-ext-)|(flarum-)/,""),a=s().data.extensions[t],n=["semver-safe-update","update-possible"].includes(e["latest-status"]);return a&&n&&(this.packageUpdates[a.id]=e),a&&n})),Object.values(s().data.extensions).filter((e=>this.packageUpdates[e.id]))}formatCoreUpdate(e){const t=e?.updates?.installed?.filter((e=>"flarum/core"===e.name)).pop();return t?{package:t,extension:{id:"flarum-core",name:"flarum/core",version:s().data.settings.version,icon:{name:"",backgroundImage:`url(${s().data.resources[0].attributes.baseUrl}/assets/extensions/flarum-extension-manager/flarum.svg`},extra:{"flarum-extension":{title:v()(s().translator.trans("flarum-extension-manager.admin.updater.flarum"))}},links:{}}}:null}majorUpdate(e){let{dryRun:t}=e;s().extensionManager.control.setLoading(t?"major-update-dry-run":"major-update"),s().modal.show(d());const a=this.lastUpdateRun.major;s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/major-update`,body:{data:{dryRun:t}}}).then((e=>{e?.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).catch((e=>{s().modal.close(),a.status="failure",a.incompatibleExtensions=e.response?.errors?.pop()?.incompatible_extensions})).finally((()=>{m.redraw()}))}}flarum.reg.add("flarum-extension-manager","admin/states/ControlSectionState",_);const k=flarum.reg.get("core","common/states/PaginatedListState");var N=a.n(k);class M extends(N()){get type(){return"external-extensions"}constructor(){super({sort:"-downloads"},1,12)}sortMap(){return{"-createdAt":{sort:"-createdAt",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.latest",{},!0)},"-downloads":{sort:"-downloads",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.top",{},!0)}}}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionListState",M);class w{constructor(){f(this,"queue",new x),f(this,"control",new _),f(this,"extensions",new M)}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionManagerState",w);const E=flarum.reg.get("core","common/extenders");var S=a.n(E);const B=flarum.reg.get("core","common/Component");var U=a.n(B);const $=flarum.reg.get("core","common/components/LoadingIndicator");var C=a.n($);const q=flarum.reg.get("core","common/components/Tooltip");var P=a.n(q);const T=flarum.reg.get("core","common/components/Icon");var j=a.n(T);const F=flarum.reg.get("core","common/utils/ItemList");var L=a.n(F);const I=flarum.reg.get("core","common/components/Link");var A=a.n(I);const D=flarum.reg.get("core","common/components/Pagination");var O=a.n(D);const R=flarum.reg.get("core","common/utils/classList");var Y=a.n(R);class W extends(U()){view(e){const{className:t,type:a,...n}=this.attrs;return m("span",Object.assign({className:Y()(["Label",`Label--${this.attrs.type}`,t])},n),e.children)}}flarum.reg.add("flarum-extension-manager","admin/components/Label",W);const G=flarum.reg.get("core","common/components/Modal");var V=a.n(G);class H extends(V()){className(){return"Modal--large QuickModal"}title(){return s().translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${this.attrs.task.operation()}`)}content(){return m("div",{className:"Modal-body"},m("div",{className:"TaskOutputModal-data"},"failure"===this.attrs.task.status()&&m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause")),m("div",{className:"FormControl TaskOutputModal-data-guessed-cause"},this.attrs.task.guessedCause()&&s().translator.trans("flarum-extension-manager.admin.exceptions.guessed_cause."+this.attrs.task.guessedCause())||s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown"))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.command")),m("div",{className:"FormControl TaskOutputModal-data-command"},m("code",null,"$ composer ",this.attrs.task.command()))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.output")),m("div",{className:"FormControl TaskOutputModal-data-output"},m("code",null,m("pre",null,this.attrs.task.output()))))))}}flarum.reg.add("flarum-extension-manager","admin/components/TaskOutputModal",H);var z=a(151),Q=a.n(z);function J(e,t){dayjs.extend(Q());const a=dayjs(t).diff(e);return dayjs.duration(a).humanize()}flarum.reg.add("flarum-extension-manager","admin/utils/humanDuration",J);class Z extends(U()){oninit(e){super.oninit(e),s().extensionManager.queue.load()}view(){return m("section",{id:"ExtensionManager-queueSection",className:"ExtensionPage-settings ExtensionManager-queueSection"},m("div",{className:"ExtensionPage-permissions-header ExtensionManager-queueSection-header"},m("div",{className:"container"},m("h2",{className:"ExtensionTitle"},s().translator.trans("flarum-extension-manager.admin.sections.queue.title")),m(l(),{className:"Button Button--icon",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.queue.load(),"aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.refresh"),disabled:s().extensionManager.control.isLoading()}))),m("div",{className:"container"},this.queueTable()))}columns(){const e=new(L());return e.add("operation",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.operation")),content:e=>m("div",{className:"ExtensionManager-queueTable-operation"},m("span",{className:"ExtensionManager-queueTable-operation-icon"},this.operationIcon(e.operation())),m("span",{className:"ExtensionManager-queueTable-operation-name"},s().translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${e.operation()}`)))},80),e.add("package",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.package")),content:e=>{const t=s().data.extensions[e.package()?.replace(/(\/flarum-|\/flarum-ext-|\/)/g,"-")];return t?m(A(),{className:"ExtensionManager-queueTable-package",href:s().route("extension",{id:t.id})},m("div",{className:"ExtensionManager-queueTable-package-icon ExtensionIcon",style:t.icon},!!t.icon&&m(j(),{name:t.icon.name})),m("div",{className:"ExtensionManager-queueTable-package-details"},m("span",{className:"ExtensionManager-queueTable-package-title"},t.extra["flarum-extension"].title),m("span",{className:"ExtensionManager-queueTable-package-name"},e.package()))):e.package()}},75),e.add("status",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.status")),content:e=>m("[",null,m(W,{className:"ExtensionManager-queueTable-status",type:{running:"neutral",failure:"error",pending:"warning",success:"success"}[e.status()]},s().translator.trans(`flarum-extension-manager.admin.sections.queue.statuses.${e.status()}`)),["pending","running"].includes(e.status())&&m(C(),{size:"small",display:"inline"}))},70),e.add("elapsedTime",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.elapsed_time")),content:e=>e.startedAt()&&e.finishedAt()?m(P(),{text:`${dayjs(e.startedAt()).format("LL LTS")} ${dayjs(e.finishedAt()).format("LL LTS")}`},m("span",null,J(e.startedAt(),e.finishedAt()))):s().translator.trans("flarum-extension-manager.admin.sections.queue.task_just_started")},65),e.add("memoryUsed",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.peak_memory_used")),content:e=>m("span",null,e.peakMemoryUsed())},60),e.add("details",{label:v()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details")),content:e=>m(l(),{className:"Button Button--icon Table-controls-item",icon:"fas fa-file-alt","aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details"),onclick:()=>s().modal.show(H,{task:e}),disabled:["pending","running"].includes(e.status())}),className:"Table-controls"},55),e}queueTable(){const e=s().extensionManager.queue.getItems();if(!e)return m(C(),null);if(e&&!e.length)return m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("flarum-extension-manager.admin.sections.queue.none"));const t=this.columns();return m("[",null,m("div",{className:Y()("Table-container",{"loading-container":e&&s().extensionManager.queue.isLoading()})},m("table",{className:"Table ExtensionManager-queueTable"},m("thead",null,m("tr",null,t.toArray().map(((e,t)=>m("th",{key:t},e.label))))),m("tbody",null,e.map(((e,a)=>m("tr",{key:a},t.toArray().map(((t,a)=>{const{label:n,content:s,...r}=t;return m("td",Object.assign({key:a},r),s(e))}))))))),e&&s().extensionManager.queue.isLoading()&&m(C(),{size:"large"})),m(O(),{total:s().extensionManager.queue.getTotalItems(),currentPage:s().extensionManager.queue.pageNumber()+1,perPage:s().extensionManager.queue.getPerPage(),onChange:e=>s().extensionManager.queue.goto(e)}))}operationIcon(e){return m(j(),{name:{update_check:"fas fa-sync-alt",update_major:"fas fa-play",update_minor:"fas fa-play",update_global:"fas fa-play",extension_install:"fas fa-download",extension_remove:"fas fa-times",extension_update:"fas fa-arrow-alt-circle-up",why_not:"fas fa-exclamation-circle"}[e]})}}flarum.reg.add("flarum-extension-manager","admin/components/QueueSection",Z);const K=flarum.reg.get("core","common/components/Alert");var X=a.n(K);const ee=flarum.reg.get("core","common/utils/Stream");var te=a.n(ee);class ae extends(U()){constructor(){super(...arguments),f(this,"packageName",void 0)}oninit(e){super.oninit(e),this.packageName=te()("")}view(){return m("div",{className:"Form-group ExtensionManager-installer"},m("label",{htmlFor:"install-extension"},s().translator.trans("flarum-extension-manager.admin.extensions.install")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.extensions.install_help",{link:m("a",{href:"https://flarum.org/extensions"},"flarum.org"),semantic_link:m("a",{href:"https://devhints.io/semver"}),code:m("code",null)})),m("div",{className:"FormControl-container"},m("input",{className:"FormControl",id:"install-extension",placeholder:"vendor/package-name",bidi:this.packageName}),m(l(),{className:"Button",icon:"fas fa-download",onclick:this.onsubmit.bind(this),loading:s().extensionManager.control.isLoading("extension-install"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.extensions.proceed"))))}data(){return{package:this.packageName()}}onsubmit(){s().extensionManager.control.requirePackage(this.data())}}flarum.reg.add("flarum-extension-manager","admin/components/Installer",ae);const ne=flarum.reg.get("core","common/helpers/humanTime");var se=a.n(ne);class re extends(V()){constructor(){super(...arguments),f(this,"loading",!0),f(this,"whyNot",null)}className(){return"Modal--large WhyNotModal"}title(){return s().translator.trans("flarum-extension-manager.admin.why_not_modal.title")}oncreate(e){super.oncreate(e),this.requestWhyNot()}content(){return m("div",{className:"Modal-body"},this.loading?m(C(),null):m("pre",{className:"WhyNotModal-contents"},this.whyNot))}requestWhyNot(){s().request({method:"POST",url:`${s().forum.attribute("apiUrl")}/extension-manager/why-not`,body:{data:{package:this.attrs.package}}}).then((e=>{this.loading=!1,this.whyNot=e.data.reason,m.redraw()})).catch(b)}}flarum.reg.add("flarum-extension-manager","admin/components/WhyNotModal",re);const oe=flarum.reg.get("core","common/components/Badge");var ie=a.n(oe);const le=flarum.reg.get("core","common/utils/formatAmount");var me=a.n(le);const ue=flarum.reg.get("core","common/Model");var de=a.n(ue);let ce=function(e){return e.Stable="stable",e.Alpha="alpha",e.Beta="beta",e.RC="rc",e.Dev="dev",e}({});function ge(e){return[ce.Stable,ce.RC].includes(pe(e))}function pe(e){const t=e.split("-");if(1===t.length)return ce.Stable;switch(t[1].split(".")[0].toLowerCase()){case"alpha":return ce.Alpha;case"beta":return ce.Beta;case"rc":return ce.RC;default:return ce.Dev}}flarum.reg.add("flarum-extension-manager","admin/utils/versions",{VersionStability:ce,isProductionReady:ge,stability:pe});class he extends(de()){constructor(){super(...arguments),f(this,"extensionId",de().attribute("extensionId")),f(this,"name",de().attribute("name")),f(this,"title",de().attribute("title")),f(this,"description",de().attribute("description")),f(this,"iconUrl",de().attribute("iconUrl")),f(this,"icon",de().attribute("icon")),f(this,"highestVersion",de().attribute("highestVersion")),f(this,"httpUri",de().attribute("httpUri")),f(this,"discussUri",de().attribute("discussUri")),f(this,"vendor",de().attribute("vendor")),f(this,"isPremium",de().attribute("isPremium")),f(this,"isLocale",de().attribute("isLocale")),f(this,"locale",de().attribute("locale")),f(this,"latestFlarumVersionSupported",de().attribute("latestFlarumVersionSupported")),f(this,"downloads",de().attribute("downloads")),f(this,"installed",!1)}isSupported(){const e=s().data.settings.version,t=this.latestFlarumVersionSupported();return e.split("-")[1]===t.split("-")[1]&&e.split(".")[0]===t.split(".")[0]}isProductionReady(){return ge(this.highestVersion())}toLocalExtension(){return{id:this.extensionId(),name:this.name(),version:this.highestVersion(),description:this.description(),icon:this.icon()||{name:"fas fa-box-open",backgroundColor:"#117187",color:"#fff"},links:{discuss:this.discussUri(),website:this.httpUri()},extra:{"flarum-extension":{title:this.title()}}}}}flarum.reg.add("flarum-extension-manager","admin/models/ExternalExtension",he);const fe=flarum.reg.get("core","common/components/Dropdown");var xe=a.n(fe);const be=flarum.reg.get("core","common/components/LinkButton");var ye=a.n(be);class ve extends(U()){getExtension(){return this.attrs.extension instanceof he?this.attrs.extension.toLocalExtension():this.attrs.extension}view(){const e=this.getExtension(),{isCore:t,isDanger:a}=this.attrs;return m("div",{className:Y()("ExtensionCard",{"ExtensionCard--core":t,"ExtensionCard--danger":a})},m("div",{className:"ExtensionCard-header"},this.icon(),m(P(),{text:e.name},m("h4",null,e.extra["flarum-extension"].title)),this.attrs.extension instanceof he&&m("div",{className:"ExtensionCard-badges"},this.badges().toArray()),m("div",{className:"ExtensionCard-actions"},this.actionItems().toArray())),m("div",{className:"ExtensionCard-body"},m("p",null,e.description)),m("div",{className:"ExtensionCard-footer"},m("div",{className:"ExtensionCard-meta"},this.metaItems().toArray())))}icon(){const e=this.getExtension();this.attrs.extension instanceof he&&e.id in s().data.extensions&&(e.icon=s().data.extensions[e.id].icon);const t=e.icon||{};return!e.icon?.name&&this.attrs.extension instanceof he&&!(e.id in s().data.extensions)&&this.attrs.extension.iconUrl()&&(t.backgroundImage=`url(${this.attrs.extension.iconUrl()})`),m("span",{className:"ExtensionIcon",style:e.icon},e.icon?.name?m(j(),{name:e.icon.name}):null)}badges(){const e=new(L()),t=this.attrs.extension;return t.isSupported()?e.add("compatible",m(ie(),{icon:"fas fa-check",type:"success",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.compatible"),className:"Badge--flat Badge--square"})):e.add("incompatible",m(ie(),{icon:"fas fa-times",type:"danger",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.incompatible"),className:"Badge--flat Badge--square"})),t.isPremium()&&e.add("premium",m(ie(),{icon:"fas fa-dollar-sign",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.premium"),className:"ExtensionCard-badge--premium Badge--flat Badge--square"})),t.isProductionReady()||e.add("unstable",m(ie(),{icon:"fas fa-flask",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.unstable"),className:"Badge--flat Badge--square Badge--danger"})),"fof"===t.name().split("/")[0]&&e.add("fof",m(ie(),{icon:"fas fa-users",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.fof"),className:"Badge--flat Badge--square"})),"flarum"===t.name().split("/")[0]&&e.add("flarum",m(ie(),{icon:"fab fa-flarum",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.flarum"),className:"ExtensionCard-badge--flarum Badge--flat Badge--square"})),e}metaItems(){const e=new(L()),{updates:t,isCore:a}=this.attrs,n=t?t["latest-minor"]??(t["latest-major"]&&!a?t["latest-major"]:null):null;return this.attrs.extension instanceof he?e.add("downloads",m("span",null,m(j(),{name:"fas fa-circle-down"}),s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.downloads",{count:this.attrs.extension.downloads(),formattedCount:me()(this.attrs.extension.downloads())}))):e.add("version",m("div",{className:"ExtensionCard-version"},m("span",{className:"ExtensionCard-version-current"},this.version(t.version)),n?m("[",null,m(j(),{name:"fas fa-arrow-right"}),m(W,{className:"ExtensionCard-version-latest",type:t["latest-minor"]?"success":"warning"},this.version(n))):null)),this.attrs.extension instanceof he&&(e.add("version",m("div",{className:"ExtensionCard-version"},"v",this.version(this.attrs.extension.highestVersion()))),e.add("link",m(ye(),{className:"Button Button--ua-reset Button--link Button--icon",href:this.attrs.extension.httpUri(),target:"_blank",icon:"fas fa-external-link-alt",external:!0}))),e}actionItems(){const e=new(L()),{updates:t,extension:a,onClickUpdate:n,whyNotWarning:r}=this.attrs;return a instanceof he?a.extensionId()in s().data.extensions?e.add("installed",m(l(),{className:"Button Button--icon Button--flat Button--success",icon:"fas fa-check-circle",disabled:!0})):e.add("install",m(l(),{className:"Button Button--icon Button--flat",icon:"fas fa-cloud-arrow-down",onclick:()=>{s().extensionManager.control.requirePackage({package:a.name()})}})):(n&&"function"==typeof n?e.add("update",m(P(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",className:"Button Button--icon Button--flat",onclick:n,"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.update")}))):n&&e.add("update",m(xe(),{buttonClassName:"Button Button--icon Button--flat",icon:"fas fa-ellipsis",label:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",onclick:n.soft},s().translator.trans("flarum-extension-manager.admin.extensions.update_soft_label")),m(l(),{icon:"fas fa-rotate",onclick:n.hard,disabled:!t["direct-dependency"]},s().translator.trans("flarum-extension-manager.admin.extensions.update_hard_label")))),r&&e.add("whyNot",m(P(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")},m(l(),{icon:"fas fa-exclamation-circle",className:"Button Button--icon Button--flat Button--danger",onclick:()=>s().modal.show(re,{package:a.name}),"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")})))),e}version(e){return"v"===e.charAt(0)?e.substring(1):e}}flarum.reg.add("flarum-extension-manager","admin/components/ExtensionCard",ve);class _e extends(U()){constructor(){super(...arguments),f(this,"updateState",void 0)}oninit(e){super.oninit(e),this.updateState=this.attrs.updateState}view(){return m("div",{className:Y()("Form-group Form-group--danger ExtensionManager-majorUpdate",{"ExtensionManager-majorUpdate--failed":"failure"===this.updateState.status,"ExtensionManager-majorUpdate--incompatibleExtensions":this.updateState.incompatibleExtensions.length})},m("img",{alt:"flarum logo",src:s().forum.attribute("baseUrl")+"/assets/extensions/flarum-extension-manager/flarum.svg"}),m("label",null,s().translator.trans("flarum-extension-manager.admin.major_updater.title",{version:this.attrs.coreUpdate["latest-major"]})),m("p",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.major_updater.description")),m("div",{className:"ExtensionManager-updaterControls"},m(P(),{text:s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run_help")},m(l(),{className:"Button",icon:"fas fa-vial",onclick:this.update.bind(this,!0),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run"))),m(l(),{className:"Button Button--danger",icon:"fas fa-play",onclick:this.update.bind(this,!1),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.update"))),this.updateState.incompatibleExtensions.length?m("div",{className:"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid"},this.updateState.incompatibleExtensions.map((e=>m(ve,{extension:s().data.extensions[e.replace("flarum-","").replace("flarum-ext-","").replace("/","-")],updates:{},onClickUpdate:null,isDanger:!0})))):null,"failure"===this.updateState.status?m(X(),{type:"error",className:"ExtensionManager-majorUpdate-failure",dismissible:!1,controls:[m(l(),{className:"Button Button--text ExtensionManager-majorUpdate-failure-details",icon:"fas fa-question-circle",onclick:()=>s().modal.show(re,{package:"flarum/core"})},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.why"))]},m("p",{className:"ExtensionManager-majorUpdate-failure-desc"},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.desc"))):null)}update(e){s().extensionManager.control.majorUpdate({dryRun:e})}}flarum.reg.add("flarum-extension-manager","admin/components/MajorUpdater",_e);const ke=flarum.reg.get("core","common/components/InfoTile");var Ne=a.n(ke);class Me extends(U()){view(){const e=s().extensionManager.control.coreUpdate;return[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.updater.updater_title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.updater.updater_help")),this.lastUpdateCheckView(),m("div",{className:"ExtensionManager-updaterControls"},this.controlItems().toArray()),this.availableUpdatesView()),e&&e.package["latest-major"]&&ge(e.package["latest-major"])?m(_e,{coreUpdate:e.package,updateState:s().extensionManager.control.lastUpdateRun.major}):null]}lastUpdateCheckView(){return s().extensionManager.control.lastUpdateCheck?.checkedAt&&m("p",{className:"ExtensionManager-lastUpdatedAt"},m("span",{className:"ExtensionManager-lastUpdatedAt-label"},s().translator.trans("flarum-extension-manager.admin.updater.last_update_checked_at")),m("span",{className:"ExtensionManager-lastUpdatedAt-value"},se()(s().extensionManager.control.lastUpdateCheck.checkedAt)))||null}availableUpdatesView(){const e=s().extensionManager.control;if(s().extensionManager.control.isLoading("check")||s().extensionManager.control.isLoading("global-update"))return m("div",{className:"ExtensionManager-extensions"},m(C(),null));const t=e.coreUpdate&&e.coreUpdate.package["latest-minor"];return e.extensionUpdates.length||t?m("div",{className:"ExtensionManager-extensions"},m("div",{className:"ExtensionManager-extensions-grid"},t?m(ve,{extension:e.coreUpdate.extension,updates:e.coreUpdate.package,isCore:!0,onClickUpdate:()=>e.updateCoreMinor(),whyNotWarning:e.lastUpdateRun.limitedPackages().includes("flarum/core")}):null,e.extensionUpdates.map((t=>m(ve,{extension:t,updates:e.packageUpdates[t.id],onClickUpdate:{soft:()=>e.updateExtension(t,"soft"),hard:()=>e.updateExtension(t,"hard")},whyNotWarning:e.lastUpdateRun.limitedPackages().includes(t.name)}))))):m("div",{className:"ExtensionManager-extensions ExtensionManager-extensions--empty"},m(Ne(),{icon:"fas fa-plug-circle-check"},s().translator.trans("flarum-extension-manager.admin.updater.up_to_date")))}controlItems(){const e=new(L());return e.add("updateCheck",m(l(),{className:"Button",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.control.checkForUpdates(),loading:s().extensionManager.control.isLoading("check"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.check_for_updates")),100),e.add("globalUpdate",m(l(),{className:"Button",icon:"fas fa-play",onclick:()=>s().extensionManager.control.updateGlobally(),loading:s().extensionManager.control.isLoading("global-update"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.run_global_update"))),e}}flarum.reg.add("flarum-extension-manager","admin/components/Updater",Me);const we=flarum.reg.get("core","common/components/Form");var Ee=a.n(we);class Se extends(U()){oninit(e){super.oninit(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-controlSection"},m("div",{className:"container"},s().data["flarum-extension-manager.writable_dirs"]?m(Ee(),null,m(ae,null),m(Me,null)):m("div",{className:"Form-group"},m(X(),{type:"warning",dismissible:!1},s().translator.trans("flarum-extension-manager.admin.file_permissions")))))}}flarum.reg.add("flarum-extension-manager","admin/components/ControlSection",Se);const Be=flarum.reg.get("core","common/components/FormGroup");var Ue=a.n(Be);class $e extends(U()){constructor(){super(...arguments),f(this,"settings",{}),f(this,"initialSettings",null),f(this,"loading",!1),f(this,"type",void 0)}oninit(e){super.oninit(e),this.submit(!0)}className(){return""}view(){return m("div",{className:Y()("FormSection",this.className())},m("label",null,this.title()),this.content(),m("div",{className:"Form-group Form-controls"},this.submitButton()))}submitButton(){return[m(l(),{className:"Button Button--primary",loading:this.loading,onclick:()=>this.submit(!1),disabled:!this.isDirty()},s().translator.trans("core.admin.settings.submit_button"))]}customSettingComponents(){return Ue().prototype.customFieldComponents()}setting(e){return this.settings[e]??(this.settings[e]=te()())}submit(e){this.loading=!0;const t={};Object.keys(this.settings).forEach((e=>{t[e]=this.settings[e]()})),s().request({method:"POST",url:s().forum.attribute("apiUrl")+"/extension-manager/composer",body:{type:this.type,data:e?null:t}}).then((e=>{let{data:t}=e;Object.keys(t).forEach((e=>{this.settings[e]=te()(t[e])})),this.initialSettings=Array.isArray(t)?{}:t})).finally((()=>{this.loading=!1,m.redraw()}))}isDirty(){return JSON.stringify(this.initialSettings)!==JSON.stringify(this.settings)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureJson",$e);const Ce=flarum.reg.get("core","common/components/Select");var qe=a.n(Ce);class Pe extends(V()){constructor(){super(...arguments),f(this,"name",void 0),f(this,"repository",void 0)}oninit(e){super.oninit(e),this.name=te()(this.attrs.name||""),this.repository=te()(this.attrs.repository||{type:"composer",url:""})}className(){return"RepositoryModal Modal--small"}title(){const e=this.attrs.repository?"edit":"add";return s().translator.trans(`flarum-extension-manager.admin.composer.${e}_repository_label`)}content(){const e={composer:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.composer"),vcs:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.vcs"),path:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.path")};return m("div",{className:"Modal-body"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.name_label")),m("input",{className:"FormControl",bidi:this.name})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.type_label")),m(qe(),{options:e,value:this.repository().type,onchange:e=>this.repository({...this.repository(),type:e})})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.url")),m("input",{className:"FormControl",onchange:e=>this.repository({...this.repository(),url:e.target.value}),value:this.repository().url})),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.repository(),this.name()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/RepositoryModal",Pe);class Te extends $e{constructor(){super(...arguments),f(this,"type","composer")}title(){return s().translator.trans("flarum-extension-manager.admin.composer.title")}className(){return"ConfigureComposer"}content(){return m("div",{className:"Form ExtensionManager-SettingsGroups-content"},this.attrs.buildSettingComponent.call(this,{setting:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label"),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help"),type:"select",options:{stable:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.stable"),RC:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.rc"),beta:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.beta"),alpha:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.alpha"),dev:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.dev")}}),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.label")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.composer.repositories.help")),m("div",{className:"ConfigureComposer-repositories"},Object.keys(this.setting("repositories")()||{}).map((e=>{const t=this.setting("repositories")()[e];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:{composer:"fas fa-cubes",vcs:"fas fa-code-branch",path:"fas fa-folder"}[t.type],onclick:()=>s().modal.show(Pe,{name:e,repository:t,onsubmit:(t,a)=>{const n=this.setting("repositories")();delete n[e],this.setting("repositories")(n),this.onchange(t,a)}})},e," (",t.type,")"),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_label"),onclick:()=>{if(confirm(v()(s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_confirmation")))){const t={...this.setting("repositories")()};delete t[e],this.setting("repositories")(t)}}}))})))))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",onclick:()=>s().modal.show(Pe,{onsubmit:this.onchange.bind(this)})},s().translator.trans("flarum-extension-manager.admin.composer.add_repository_label"))),e}onchange(e,t){this.setting("repositories")({...this.setting("repositories")(),[t]:e})}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureComposer",Te);class je extends(V()){constructor(){super(...arguments),f(this,"type",void 0),f(this,"host",void 0),f(this,"token",void 0)}oninit(e){super.oninit(e),this.type=te()(this.attrs.type||"bearer"),this.host=te()(this.attrs.host||""),this.token=te()(this.attrs.token||"")}className(){return"AuthMethodModal Modal--small"}title(){const e=this.attrs.host?"edit":"add";return s().translator.trans(`flarum-extension-manager.admin.auth_config.${e}_label`)}content(){const e={"github-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.github-oauth"),"gitlab-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-oauth"),"gitlab-token":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-token"),bearer:s().translator.trans("flarum-extension-manager.admin.auth_config.types.bearer")};return m("div",{className:"Modal-body"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.type_label")),m(qe(),{options:e,value:this.type(),onchange:this.type})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_label")),m("input",{className:"FormControl",bidi:this.host,placeholder:s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_placeholder")})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.token_label")),m("textarea",{className:"FormControl",oninput:e=>this.token(e.target.value),rows:"6",placeholder:this.token().startsWith("unchanged:")?v()(s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder")):""},this.token().startsWith("unchanged:")?"":this.token())),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.type(),this.host(),this.token()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/AuthMethodModal",je);class Fe extends $e{constructor(){super(...arguments),f(this,"type","auth")}title(){return s().translator.trans("flarum-extension-manager.admin.auth_config.title")}className(){return"ConfigureAuth"}content(){const e=Object.keys(this.settings),t=e.length&&e.every((e=>{const t=this.settings[e]();return Array.isArray(t)?t.length:Object.keys(t).length}));return m("div",{className:"ExtensionManager-SettingsGroups-content"},t?e.map((e=>{const t=this.settings[e]();return m("div",{className:"Form-group"},m("label",null,s().translator.trans(`flarum-extension-manager.admin.auth_config.types.${e}`)),m("div",{className:"ConfigureAuth-hosts"},Object.keys(t).map((a=>{const n=t[a];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:"fas fa-key",onclick:()=>s().modal.show(je,{type:e,host:a,token:n,onsubmit:this.onchange.bind(this,a)})},a),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.auth_config.delete_label"),onclick:()=>{if(confirm(v()(s().translator.trans("flarum-extension-manager.admin.auth_config.delete_confirmation")))){const t={...this.setting(e)()};delete t[a],Object.keys(t).length?this.setting(e)(t):delete this.settings[e]}}}))}))))})):m("span",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.auth_config.no_auth_methods_configured")))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",loading:this.loading,onclick:()=>s().modal.show(je,{onsubmit:this.onchange.bind(this,null)})},s().translator.trans("flarum-extension-manager.admin.auth_config.add_label"))),e}onchange(e,t,a,n){const s={...this.setting(t)()};e&&delete s[e],s[a]=n,this.setting(t)(s)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureAuth",Fe);const Le=flarum.reg.get("core","common/components/Input");var Ie=a.n(Le);const Ae=flarum.reg.get("core","common/helpers/listItems");var De=a.n(Ae);const Oe=flarum.reg.get("core","common/utils/throttleDebounce");class Re extends(U()){constructor(){super(...arguments),f(this,"search",te()("")),f(this,"warningsDismissed",te()(!1)),f(this,"applySearch",(0,Oe.throttle)(1200,(e=>{const t=s().extensionManager.extensions.getParams();s().extensionManager.extensions.refreshParams({...t,filter:{...t.filter,q:e}},1)})))}oninit(e){super.oninit(e),s().extensionManager.extensions.goto(1),this.warningsDismissed("true"===localStorage.getItem("flarum-extension-manager.warningsDismissed"))}load(e){void 0===e&&(e=1),s().extensionManager.extensions.goto(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-DiscoverSection"},m("div",{className:"container"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.discover.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.discover.description"),this.warningsDismissed()&&m(l(),{className:"Button Button--text Button--warning Button--more",icon:"fas fa-exclamation-triangle",onclick:()=>this.setWarningDismissed(!1)}))),!this.warningsDismissed()&&m("div",{className:"ExtensionManager-warnings Form-group"},m(X(),{className:"ExtensionManager-primaryWarning",type:"warning",dismissible:!0,ondismiss:()=>this.setWarningDismissed(!0)},m("ul",null,De()(this.warningItems().toArray())))),m("div",{className:"Tabs"},m("div",{className:"Tabs-nav"},this.tabItems().toArray()),m("div",{className:"Tabs-content"},m("hr",{className:"Tabs-divider"}),m("div",{className:"ExtensionManager-DiscoverSection-toolbar"},m("div",{className:"ExtensionManager-DiscoverSection-toolbar-primary"},this.toolbarPrimaryItems().toArray()),m("div",{className:"ExtensionManager-DiscoverSection-toolbar-secondary"},this.toolbarSecondaryItems().toArray())),this.extensionList(),m("div",{className:"ExtensionManager-DiscoverSection-footer"},this.footerItems().toArray()))))))}tabFilters(){return{"":{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.discover"),active:()=>!s().extensionManager.extensions.getParams().filter?.type},extension:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.extensions"),active:()=>"extension"===s().extensionManager.extensions.getParams().filter?.type},locale:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.languages"),active:()=>"locale"===s().extensionManager.extensions.getParams().filter?.type},theme:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.themes"),active:()=>"theme"===s().extensionManager.extensions.getParams().filter?.type}}}tabItems(){const e=new(L()),t=this.tabFilters();return Object.keys(t).forEach((a=>{const n=t[a];e.add(a,m(l(),{className:"Button Button--link",active:n.active(),onclick:()=>{s().extensionManager.extensions.changeFilter("type",a)}},n.label))})),e}warningItems(){const e=new(L());return e.add("accessWarning",s().translator.trans("flarum-extension-manager.admin.settings.access_warning")),s().data.debugEnabled&&e.add("devModeWarning",s().translator.trans("flarum-extension-manager.admin.settings.debug_mode_warning")),e}toolbarPrimaryItems(){const e=new(L());return e.add("search",m(Ie(),{value:this.search(),onchange:e=>{this.search(e),this.applySearch(e)},inputAttrs:{className:"FormControl-alt"},clearable:!0,placeholder:s().translator.trans("flarum-extension-manager.admin.sections.discover.search"),prefixIcon:"fas fa-search"})),e}toolbarSecondaryItems(){const e=new(L()),t=s().extensionManager.extensions.sortMap(),a=Object.keys(t).reduce(((e,a)=>{const n=t[a];return e[a]="string"!=typeof n?n.label:n,e}),{});e.add("sort",m(xe(),{buttonClassName:"Button",label:a[s().extensionManager.extensions.getParams().sort]||Object.keys(t).map((e=>a[e]))[0],accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label")},Object.keys(a).map((e=>{const t=a[e],n=s().extensionManager.extensions.getParams().sort===e;return m(l(),{icon:!n||"fas fa-check",onclick:()=>s().extensionManager.extensions.changeSort(e),active:n},t)}))));const n=(s().extensionManager.extensions.getParams().filter?.is?.[0]??null)||"all";return e.add("party",m(xe(),{buttonClassName:"Button",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+n),accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label")},["all","premium"].map((e=>m(l(),{icon:n!==e||"fas fa-check",onclick:()=>{s().extensionManager.extensions.changeFilter("is","all"===e?void 0:[e])},active:n===e},s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+e)))))),e}extensionList(){return!s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()?m(C(),{display:"block"}):s().extensionManager.extensions.hasItems()?m("div",{className:Y()("ExtensionManager-DiscoverSection-list",{"loading-container":s().extensionManager.extensions.isLoading()})},m("div",{className:"ExtensionManager-DiscoverSection-list-inner"},s().extensionManager.extensions.getPages().map((e=>e.items.map((e=>m(ve,{extension:e,key:e.name()})))))),s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()&&m(C(),{size:"large"})):m("div",{className:"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty"},m(Ne(),{icon:"fas fa-plug-circle-exclamation"},s().translator.trans("flarum-extension-manager.admin.sections.discover.empty_results")))}footerItems(){const e=new(L());return e.add("pagination",m(O(),{total:s().extensionManager.extensions.totalItems,perPage:s().extensionManager.extensions.pageSize,currentPage:s().extensionManager.extensions.getLocation().page,onChange:e=>{s().extensionManager.extensions.getLocation().page!==e&&this.load(e)}})),e.add("premiumTermsLink",m(ye(),{className:"Button Button--link",href:"https://flarum.org/terms/premium-extensions",external:!0,target:"_blank",icon:"fas fa-circle-info"},s().translator.trans("flarum-extension-manager.admin.sections.discover.premium_extension_terms"))),e}setWarningDismissed(e){this.warningsDismissed(e),localStorage.setItem("flarum-extension-manager.warningsDismissed",e?"true":"false")}}flarum.reg.add("flarum-extension-manager","admin/components/DiscoverSection",Re);class Ye extends(o()){content(){const e=s().registry.getSettings(this.extension.id);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},e?[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.settings.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.settings.description"))),m("div",{className:"FormSectionGroup ExtensionManager-SettingsGroups"},m("div",{className:"FormSection"},m("label",null,s().translator.trans("flarum-extension-manager.admin.settings.title")),m("div",{className:"Form"},e.map(this.buildSettingComponent.bind(this))),m("div",{className:"Form-group Form--controls"},this.submitButton())),m(Te,{buildSettingComponent:this.buildSettingComponent}),m(Fe,{buildSettingComponent:this.buildSettingComponent}))]:m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("core.admin.extension.no_settings"))))}sections(e){const t=super.sections(e);return t.add("discover",m(Re,null),15),t.add("control",m(Se,null),10),t.setPriority("content",8),"0"!==s().data.settings["flarum-extension-manager.queue_jobs"]&&s().data.settings["flarum-extension-manager.queue_jobs"]&&t.add("queue",m(Z,null),5),t.remove("permissions"),t}onsaved(){super.onsaved(),m.redraw()}}flarum.reg.add("flarum-extension-manager","admin/components/SettingsPage",Ye);const We=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ge=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ve=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],He=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],ze=(e,t,a)=>{let n=e;return"string"==typeof t||Array.isArray(t)?n=e.toLocaleString(t,a):!0!==t&&void 0===a||(n=e.toLocaleString(void 0,a)),n};class Qe extends(de()){status(){return de().attribute("status").call(this)}operation(){return de().attribute("operation").call(this)}command(){return de().attribute("command").call(this)}package(){return de().attribute("package").call(this)}output(){return de().attribute("output").call(this)}guessedCause(){return de().attribute("guessedCause").call(this)}createdAt(){return de().attribute("createdAt",de().transformDate).call(this)}startedAt(){return de().attribute("startedAt",de().transformDate).call(this)}finishedAt(){return de().attribute("finishedAt",de().transformDate).call(this)}peakMemoryUsed(){return function(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const a=(t={bits:!1,binary:!1,space:!0,...t}).bits?t.binary?He:Ve:t.binary?Ge:We,n=t.space?" ":"";if(t.signed&&0===e)return` 0${n}${a[0]}`;const s=e<0,r=s?"-":t.signed?"+":"";let o;if(s&&(e=-e),void 0!==t.minimumFractionDigits&&(o={minimumFractionDigits:t.minimumFractionDigits}),void 0!==t.maximumFractionDigits&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1)return r+ze(e,t.locale,o)+n+a[0];const i=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),a.length-1);return e/=(t.binary?1024:1e3)**i,o||(e=e.toPrecision(3)),r+ze(Number(e),t.locale,o)+n+a[i]}(1024*de().attribute("peakMemoryUsed").call(this))}}flarum.reg.add("flarum-extension-manager","admin/models/Task",Qe);const Je=[(new(S().Store)).add("extension-manager-tasks",Qe).add("external-extensions",he),(new(S().Admin)).setting((()=>({setting:"flarum-extension-manager.queue_jobs",label:s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs"),help:s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs_help",{basic_impl_link:m("a",{href:"https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting"}),adv_impl_link:m("a",{href:"https://discuss.flarum.org/d/21873-redis-sessions-cache-queues"}),php_version:m("strong",null,s().data.phpVersion),folder_perms_link:m("a",{href:"https://docs.flarum.org/install#folder-ownership"})}),type:"boolean",disabled:s().data["flarum-extension-manager.using_sync_queue"]}))).setting((()=>({setting:"flarum-extension-manager.task_retention_days",label:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days"),help:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days_help"),type:"number"}))).page(Ye).generalIndexItems("settings",(()=>[{id:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help",{},!0)},{id:"repositories",label:s().translator.trans("flarum-extension-manager.admin.composer.repositories.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.repositories.help",{},!0)},{id:"composer-auth",label:s().translator.trans("flarum-extension-manager.admin.auth_config.title",{},!0)},{id:"updates",label:s().translator.trans("flarum-extension-manager.admin.updater.updater_title",{},!0),help:s().translator.trans("flarum-extension-manager.admin.updater.updater_help",{},!0)}]))];s().initializers.add("flarum-extension-manager",(t=>{t.extensionManager=new w,t.data["flarum-extension-manager.using_sync_queue"]&&(t.data.settings["flarum-extension-manager.queue_jobs"]="0"),(0,e.extend)(o().prototype,"topItems",(function(e){"flarum-extension-manager"===this.extension.id||g()(this.extension.id)||e.add("remove",m(l(),{className:"Button Button--danger",icon:"fas fa-times",onclick:()=>{t.modal.show(d()),t.request({url:`${t.forum.attribute("apiUrl")}/extension-manager/extensions/${this.extension.id}`,method:"DELETE"}).then((e=>{e?.processing?p():(t.alerts.show({type:"success"},t.translator.trans("flarum-extension-manager.admin.extensions.successful_remove")),window.location=t.forum.attribute("adminUrl"))})).finally((()=>{t.modal.close()}))}},t.translator.trans("flarum-extension-manager.admin.extensions.remove")))}))}))})(),module.exports=n})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/package-manager/js/dist/admin.js.map b/extensions/package-manager/js/dist/admin.js.map index bb835325b6..71c2b845bf 100755 --- a/extensions/package-manager/js/dist/admin.js.map +++ b/extensions/package-manager/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"6BAAoEA,EAAOC,QAAmJ,WAAW,aAAa,IAAIC,EAAEC,EAAEC,EAAE,IAAIC,EAAE,IAAIC,EAAE,KAAKC,EAAE,MAAMC,EAAE,sFAA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+H,MAAO,eAAe/D,MAAM,6DAA8D,CAAC,GAAG,GAC9F0N,KAAM,eAAe1N,MAAM,4DAA6D,CAAC,GAAG,IAC3F,CACDhE,GAAI,gBACJ+H,MAAO,eAAe/D,MAAM,mDAAoD,CAAC,GAAG,IACnF,CACDhE,GAAI,UACJ+H,MAAO,eAAe/D,MAAM,uDAAwD,CAAC,GAAG,GACxF0N,KAAM,eAAe1N,MAAM,sDAAuD,CAAC,GAAG,QCjCxF,iBAAiB5G,IAAI,4BAA4B8a,IAC/CA,EAAIC,iBAAmB,IAAInQ,EACvBkQ,EAAIvW,KAAK,+CACXuW,EAAIvW,KAAK0C,SAAS,uCAAyC,MAE7D,IAAA6E,QAAO,cAAyB,YAAY,SAAUS,GAC1B,6BAAtBxO,KAAKqK,UAAUxF,IAAqC,IAAmB7E,KAAKqK,UAAUxF,KAG1F2J,EAAMvM,IAAI,SAAU7C,EAAE,IAAQ,CAC5B6N,UAAW,wBACXnB,KAAM,eACNsC,QAAS,KACP2O,EAAIE,MAAMtU,KAAK,KACfoU,EAAIG,QAAQ,CACVlT,IAAK,GAAG+S,EAAII,MAAMlT,UAAU,0CAA0CjK,KAAKqK,UAAUxF,KACrFkF,OAAQ,WACPxD,MAAK8B,IACFA,GAAU8B,WACZ1F,KAEAsY,EAAIK,OAAOzU,KAAK,CACdC,KAAM,WACLmU,EAAIM,WAAWxU,MAAM,gEACxB/C,OAAOsB,SAAW2V,EAAII,MAAMlT,UAAU,YACxC,IACCQ,SAAQ,KACTsS,EAAIE,MAAMvY,OAAO,GACjB,GAEHqY,EAAIM,WAAWxU,MAAM,qDAC1B,GAAE,G","sources":["webpack://@flarum/extension-manager/../../../node_modules/dayjs/plugin/duration.js","webpack://@flarum/extension-manager/webpack/bootstrap","webpack://@flarum/extension-manager/webpack/runtime/compat get default export","webpack://@flarum/extension-manager/webpack/runtime/define property getters","webpack://@flarum/extension-manager/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/extension-manager/webpack/runtime/make namespace object","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/LoadingModal')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/utils/isExtensionEnabled')\"","webpack://@flarum/extension-manager/./src/admin/utils/jumpToQueue.ts","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/extension-manager/./src/admin/states/QueueState.ts","webpack://@flarum/extension-manager/./src/admin/utils/errorHandler.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/extension-manager/./src/admin/states/ControlSectionState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/extension-manager/./src/admin/states/ExtensionListState.ts","webpack://@flarum/extension-manager/./src/admin/states/ExtensionManagerState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Pagination')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/extension-manager/./src/admin/components/Label.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/extension-manager/./src/admin/components/TaskOutputModal.tsx","webpack://@flarum/extension-manager/./src/admin/utils/humanDuration.ts","webpack://@flarum/extension-manager/./src/admin/components/QueueSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Alert')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/extension-manager/./src/admin/components/Installer.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/extension-manager/./src/admin/components/WhyNotModal.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/formatAmount')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/extension-manager/./src/admin/utils/versions.ts","webpack://@flarum/extension-manager/./src/admin/models/ExternalExtension.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/extension-manager/./src/admin/components/ExtensionCard.tsx","webpack://@flarum/extension-manager/./src/admin/components/MajorUpdater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/InfoTile')\"","webpack://@flarum/extension-manager/./src/admin/components/Updater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/extension-manager/./src/admin/components/ControlSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/extension-manager/./src/admin/components/ConfigureJson.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Select')\"","webpack://@flarum/extension-manager/./src/admin/components/RepositoryModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureComposer.tsx","webpack://@flarum/extension-manager/./src/admin/components/AuthMethodModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureAuth.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Input')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/listItems')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/throttleDebounce')\"","webpack://@flarum/extension-manager/./src/admin/components/DiscoverSection.tsx","webpack://@flarum/extension-manager/./src/admin/components/SettingsPage.tsx","webpack://@flarum/extension-manager/../../../node_modules/pretty-bytes/index.js","webpack://@flarum/extension-manager/./src/admin/models/Task.ts","webpack://@flarum/extension-manager/./src/admin/extend.tsx","webpack://@flarum/extension-manager/./src/admin/index.tsx"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/LoadingModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/utils/isExtensionEnabled');","import app from 'flarum/admin/app';\n\n// @ts-ignore\nwindow.jumpToQueue = jumpToQueue;\nexport default function jumpToQueue() {\n app.modal.close();\n m.route.set(app.route('extension', {\n id: 'flarum-extension-manager'\n }));\n app.extensionManager.queue.load({}, true);\n setTimeout(() => {\n document.getElementById('ExtensionManager-queueSection')?.scrollIntoView({\n block: 'nearest'\n });\n }, 200);\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/jumpToQueue', jumpToQueue);","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nexport default class QueueState {\n constructor() {\n _defineProperty(this, \"polling\", null);\n _defineProperty(this, \"tasks\", null);\n _defineProperty(this, \"limit\", 20);\n _defineProperty(this, \"offset\", 0);\n _defineProperty(this, \"total\", 0);\n _defineProperty(this, \"loading\", false);\n }\n load(params, actionTaken) {\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n this.loading = true;\n params = {\n page: {\n limit: this.limit,\n offset: this.offset,\n ...params?.page\n },\n ...params\n };\n return app.store.find('extension-manager-tasks', params || {}).then(data => {\n this.tasks = data;\n this.total = data.payload.meta?.page?.total || 0;\n m.redraw();\n\n // Check if there is a pending or running task\n const pendingTask = data?.find(task => task.status() === 'pending' || task.status() === 'running');\n if (pendingTask) {\n this.pollQueue(actionTaken);\n } else if (actionTaken) {\n app.extensionManager.control.setLoading(null);\n\n // Refresh the page\n window.location.reload();\n } else if (app.extensionManager.control.isLoading()) {\n app.extensionManager.control.setLoading(null);\n }\n this.loading = false;\n return data;\n });\n }\n isLoading() {\n return this.loading;\n }\n getItems() {\n return this.tasks;\n }\n getTotalItems() {\n return this.total;\n }\n getTotalPages() {\n return Math.ceil(this.total / this.limit);\n }\n pageNumber() {\n return Math.ceil(this.offset / this.limit);\n }\n getPerPage() {\n return this.limit;\n }\n hasPrev() {\n return this.pageNumber() !== 0;\n }\n hasNext() {\n return this.offset + this.limit < this.total;\n }\n prev() {\n if (this.hasPrev()) {\n this.offset -= this.limit;\n this.load();\n }\n }\n next() {\n if (this.hasNext()) {\n this.offset += this.limit;\n this.load();\n }\n }\n goto(page) {\n this.offset = (page - 1) * this.limit;\n this.load();\n }\n pollQueue(actionTaken) {\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n if (this.polling) {\n clearTimeout(this.polling);\n }\n this.polling = setTimeout(() => {\n this.load({}, actionTaken);\n }, 6000);\n }\n hasPending() {\n return !!this.tasks?.find(task => task.status() === 'pending' || task.status() === 'running');\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/QueueState', QueueState);","import app from 'flarum/admin/app';\nexport default function (e) {\n app.extensionManager.control.setLoading(null);\n const error = e.response.errors[0];\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n app.alerts.clear();\n switch (error.code) {\n case 'composer_command_failure':\n if (error.guessed_cause) {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans(`flarum-extension-manager.admin.exceptions.guessed_cause.${error.guessed_cause}`));\n app.modal.close();\n } else {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.composer_command_failure'));\n }\n break;\n case 'extension_already_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n case 'extension_not_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport errorHandler from '../utils/errorHandler';\nimport jumpToQueue from '../utils/jumpToQueue';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ControlSectionState {\n get lastUpdateRun() {\n const lastUpdateRun = JSON.parse(app.data.settings['flarum-extension-manager.last_update_run']);\n lastUpdateRun.limitedPackages = () => [...lastUpdateRun.major.limitedPackages, ...lastUpdateRun.minor.limitedPackages, ...lastUpdateRun.global.limitedPackages];\n return lastUpdateRun;\n }\n constructor() {\n _defineProperty(this, \"loading\", null);\n _defineProperty(this, \"packageUpdates\", {});\n _defineProperty(this, \"lastUpdateCheck\", void 0);\n _defineProperty(this, \"extensionUpdates\", void 0);\n _defineProperty(this, \"coreUpdate\", null);\n this.lastUpdateCheck = JSON.parse(app.data.settings['flarum-extension-manager.last_update_check']);\n this.extensionUpdates = this.formatExtensionUpdates(this.lastUpdateCheck);\n this.coreUpdate = this.formatCoreUpdate(this.lastUpdateCheck);\n }\n isLoading(name) {\n if (name === void 0) {\n name = null;\n }\n return name && this.loading === name || !name && this.loading !== null;\n }\n hasOperationRunning() {\n return this.isLoading() || app.extensionManager.queue.hasPending();\n }\n setLoading(name) {\n this.loading = name;\n }\n requirePackage(data) {\n app.extensionManager.control.setLoading('extension-install');\n app.modal.show(LoadingModal);\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/extensions`,\n body: {\n data\n }\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n const extensionId = response.id;\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_install', {\n extension: extensionId\n }));\n window.location.href = `${app.forum.attribute('adminUrl')}#/extension/${extensionId}`;\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n checkForUpdates() {\n this.setLoading('check');\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/check-for-updates`\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n this.lastUpdateCheck = response;\n this.extensionUpdates = this.formatExtensionUpdates(response);\n this.coreUpdate = this.formatCoreUpdate(response);\n this.setLoading(null);\n m.redraw();\n }\n }).catch(errorHandler).finally(() => {\n m.redraw();\n });\n }\n updateCoreMinor() {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.minor_update_confirmation.content')))) {\n app.modal.show(LoadingModal);\n this.setLoading('minor-update');\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/minor-update`\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n }\n updateExtension(extension, updateMode) {\n app.modal.show(LoadingModal);\n this.setLoading('extension-update');\n app.request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/extensions/${extension.id}`,\n body: {\n data: {\n updateMode\n }\n }\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_update', {\n extension: extension.extra['flarum-extension'].title\n }));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.setLoading('global-update');\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/global-update`\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.updater.global_update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n formatExtensionUpdates(lastUpdateCheck) {\n this.packageUpdates = {};\n lastUpdateCheck?.updates?.installed?.filter(composerPackage => {\n const id = composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '');\n const extension = app.data.extensions[id];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n if (extension && safeToUpdate) {\n this.packageUpdates[extension.id] = composerPackage;\n }\n return extension && safeToUpdate;\n });\n return Object.values(app.data.extensions).filter(extension => this.packageUpdates[extension.id]);\n }\n formatCoreUpdate(lastUpdateCheck) {\n const core = lastUpdateCheck?.updates?.installed?.filter(composerPackage => composerPackage.name === 'flarum/core').pop();\n if (!core) return null;\n return {\n package: core,\n extension: {\n id: 'flarum-core',\n name: 'flarum/core',\n version: app.data.settings.version,\n icon: {\n name: '',\n // @ts-ignore\n backgroundImage: `url(${app.data.resources[0]['attributes']['baseUrl']}/assets/extensions/flarum-extension-manager/flarum.svg`\n },\n extra: {\n 'flarum-extension': {\n title: extractText(app.translator.trans('flarum-extension-manager.admin.updater.flarum'))\n }\n },\n links: {}\n }\n };\n }\n majorUpdate(_ref) {\n let {\n dryRun\n } = _ref;\n app.extensionManager.control.setLoading(dryRun ? 'major-update-dry-run' : 'major-update');\n app.modal.show(LoadingModal);\n const updateState = this.lastUpdateRun.major;\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/major-update`,\n body: {\n data: {\n dryRun\n }\n }\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).catch(e => {\n app.modal.close();\n updateState.status = 'failure';\n updateState.incompatibleExtensions = e.response?.errors?.pop()?.incompatible_extensions;\n }).finally(() => {\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ControlSectionState', ControlSectionState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import app from 'flarum/admin/app';\nimport PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class ExtensionListState extends PaginatedListState {\n get type() {\n return 'external-extensions';\n }\n constructor() {\n super({\n sort: '-downloads'\n }, 1, 12);\n }\n sortMap() {\n return {\n '-createdAt': {\n sort: '-createdAt',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.latest', {}, true)\n },\n '-downloads': {\n sort: '-downloads',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.top', {}, true)\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionListState', ExtensionListState);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport QueueState from './QueueState';\nimport ControlSectionState from './ControlSectionState';\nimport ExtensionListState from './ExtensionListState';\nexport default class ExtensionManagerState {\n constructor() {\n _defineProperty(this, \"queue\", new QueueState());\n _defineProperty(this, \"control\", new ControlSectionState());\n _defineProperty(this, \"extensions\", new ExtensionListState());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionManagerState', ExtensionManagerState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Pagination');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class Label extends Component {\n view(vnode) {\n const {\n className,\n type,\n ...attrs\n } = this.attrs;\n return m(\"span\", Object.assign({\n className: classList(['Label', `Label--${this.attrs.type}`, className])\n }, attrs), vnode.children);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Label', Label);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nexport default class TaskOutputModal extends Modal {\n className() {\n return 'Modal--large QuickModal';\n }\n title() {\n return app.translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${this.attrs.task.operation()}`);\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(\"div\", {\n className: \"TaskOutputModal-data\"\n }, this.attrs.task.status() === 'failure' && m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-guessed-cause\"\n }, this.attrs.task.guessedCause() && app.translator.trans('flarum-extension-manager.admin.exceptions.guessed_cause.' + this.attrs.task.guessedCause()) || app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown'))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.command')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-command\"\n }, m(\"code\", null, \"$ composer \", this.attrs.task.command()))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.output')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-output\"\n }, m(\"code\", null, m(\"pre\", null, this.attrs.task.output()))))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/TaskOutputModal', TaskOutputModal);","import duration from 'dayjs/plugin/duration';\nexport default function humanDuration(start, end) {\n dayjs.extend(duration);\n const durationTime = dayjs(end).diff(start);\n return dayjs.duration(durationTime).humanize();\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/humanDuration', humanDuration);","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Icon from 'flarum/common/components/Icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport extractText from 'flarum/common/utils/extractText';\nimport Link from 'flarum/common/components/Link';\nimport Pagination from 'flarum/common/components/Pagination';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport TaskOutputModal from './TaskOutputModal';\nimport humanDuration from '../utils/humanDuration';\nexport default class QueueSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.queue.load();\n }\n view() {\n return m(\"section\", {\n id: \"ExtensionManager-queueSection\",\n className: \"ExtensionPage-settings ExtensionManager-queueSection\"\n }, m(\"div\", {\n className: \"ExtensionPage-permissions-header ExtensionManager-queueSection-header\"\n }, m(\"div\", {\n className: \"container\"\n }, m(\"h2\", {\n className: \"ExtensionTitle\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.title')), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.queue.load(),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.refresh'),\n disabled: app.extensionManager.control.isLoading()\n }))), m(\"div\", {\n className: \"container\"\n }, this.queueTable()));\n }\n columns() {\n const items = new ItemList();\n items.add('operation', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.operation')),\n content: task => m(\"div\", {\n className: \"ExtensionManager-queueTable-operation\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-icon\"\n }, this.operationIcon(task.operation())), m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-name\"\n }, app.translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${task.operation()}`)))\n }, 80);\n items.add('package', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.package')),\n content: task => {\n const extension = app.data.extensions[task.package()?.replace(/(\\/flarum-|\\/flarum-ext-|\\/)/g, '-')];\n return extension ? m(Link, {\n className: \"ExtensionManager-queueTable-package\",\n href: app.route('extension', {\n id: extension.id\n })\n }, m(\"div\", {\n className: \"ExtensionManager-queueTable-package-icon ExtensionIcon\",\n style: extension.icon\n }, !!extension.icon && m(Icon, {\n name: extension.icon.name\n })), m(\"div\", {\n className: \"ExtensionManager-queueTable-package-details\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-package-title\"\n }, extension.extra['flarum-extension'].title), m(\"span\", {\n className: \"ExtensionManager-queueTable-package-name\"\n }, task.package()))) : task.package();\n }\n }, 75);\n items.add('status', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.status')),\n content: task => m('[', null, m(Label, {\n className: \"ExtensionManager-queueTable-status\",\n type: {\n running: 'neutral',\n failure: 'error',\n pending: 'warning',\n success: 'success'\n }[task.status()]\n }, app.translator.trans(`flarum-extension-manager.admin.sections.queue.statuses.${task.status()}`)), ['pending', 'running'].includes(task.status()) && m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }))\n }, 70);\n items.add('elapsedTime', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.elapsed_time')),\n content: task => !task.startedAt() || !task.finishedAt() ? app.translator.trans('flarum-extension-manager.admin.sections.queue.task_just_started') : m(Tooltip, {\n text: `${dayjs(task.startedAt()).format('LL LTS')} ${dayjs(task.finishedAt()).format('LL LTS')}`\n }, m(\"span\", null, humanDuration(task.startedAt(), task.finishedAt())))\n }, 65);\n items.add('memoryUsed', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.peak_memory_used')),\n content: task => m(\"span\", null, task.peakMemoryUsed())\n }, 60);\n items.add('details', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')),\n content: task => m(Button, {\n className: \"Button Button--icon Table-controls-item\",\n icon: \"fas fa-file-alt\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')\n // @todo fix in core\n // @ts-ignore\n ,\n onclick: () => app.modal.show(TaskOutputModal, {\n task\n }),\n disabled: ['pending', 'running'].includes(task.status())\n }),\n className: 'Table-controls'\n }, 55);\n return items;\n }\n queueTable() {\n const tasks = app.extensionManager.queue.getItems();\n if (!tasks) {\n return m(LoadingIndicator, null);\n }\n if (tasks && !tasks.length) {\n return m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.none'));\n }\n const columns = this.columns();\n return m('[', null, m(\"div\", {\n className: classList('Table-container', {\n 'loading-container': tasks && app.extensionManager.queue.isLoading()\n })\n }, m(\"table\", {\n className: \"Table ExtensionManager-queueTable\"\n }, m(\"thead\", null, m(\"tr\", null, columns.toArray().map((item, index) => m(\"th\", {\n key: index\n }, item.label)))), m(\"tbody\", null, tasks.map((task, index) => m(\"tr\", {\n key: index\n }, columns.toArray().map((item, index) => {\n const {\n label,\n content,\n ...attrs\n } = item;\n return m(\"td\", Object.assign({\n key: index\n }, attrs), content(task));\n }))))), tasks && app.extensionManager.queue.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n })), m(Pagination, {\n total: app.extensionManager.queue.getTotalItems(),\n currentPage: app.extensionManager.queue.pageNumber() + 1,\n perPage: app.extensionManager.queue.getPerPage(),\n onChange: page => app.extensionManager.queue.goto(page)\n }));\n }\n operationIcon(operation) {\n return m(Icon, {\n name: {\n update_check: 'fas fa-sync-alt',\n update_major: 'fas fa-play',\n update_minor: 'fas fa-play',\n update_global: 'fas fa-play',\n extension_install: 'fas fa-download',\n extension_remove: 'fas fa-times',\n extension_update: 'fas fa-arrow-alt-circle-up',\n why_not: 'fas fa-exclamation-circle'\n }[operation]\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/QueueSection', QueueSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Alert');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nexport default class Installer extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"packageName\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.packageName = Stream('');\n }\n view() {\n return m(\"div\", {\n className: \"Form-group ExtensionManager-installer\"\n }, m(\"label\", {\n htmlFor: \"install-extension\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install_help', {\n link: m(\"a\", {\n href: \"https://flarum.org/extensions\"\n }, \"flarum.org\"),\n semantic_link: m(\"a\", {\n href: \"https://devhints.io/semver\"\n }),\n code: m(\"code\", null)\n })), m(\"div\", {\n className: \"FormControl-container\"\n }, m(\"input\", {\n className: \"FormControl\",\n id: \"install-extension\",\n placeholder: \"vendor/package-name\",\n bidi: this.packageName\n }), m(Button, {\n className: \"Button\",\n icon: \"fas fa-download\",\n onclick: this.onsubmit.bind(this),\n loading: app.extensionManager.control.isLoading('extension-install'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.extensions.proceed'))));\n }\n data() {\n return {\n package: this.packageName()\n };\n }\n onsubmit() {\n app.extensionManager.control.requirePackage(this.data());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Installer', Installer);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport errorHandler from '../utils/errorHandler';\nexport default class WhyNotModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"loading\", true);\n _defineProperty(this, \"whyNot\", null);\n }\n className() {\n return 'Modal--large WhyNotModal';\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.why_not_modal.title');\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.requestWhyNot();\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, this.loading ? m(LoadingIndicator, null) : m(\"pre\", {\n className: \"WhyNotModal-contents\"\n }, this.whyNot));\n }\n requestWhyNot() {\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/why-not`,\n body: {\n data: {\n package: this.attrs.package\n }\n }\n }).then(response => {\n this.loading = false;\n this.whyNot = response.data.reason;\n m.redraw();\n }).catch(errorHandler);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/WhyNotModal', WhyNotModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/formatAmount');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","export let VersionStability = /*#__PURE__*/function (VersionStability) {\n VersionStability[\"Stable\"] = \"stable\";\n VersionStability[\"Alpha\"] = \"alpha\";\n VersionStability[\"Beta\"] = \"beta\";\n VersionStability[\"RC\"] = \"rc\";\n VersionStability[\"Dev\"] = \"dev\";\n return VersionStability;\n}({});\nexport function isProductionReady(version) {\n return [VersionStability.Stable, VersionStability.RC].includes(stability(version));\n}\nexport function stability(version) {\n const split = version.split('-');\n if (split.length === 1) {\n return VersionStability.Stable;\n }\n const stab = split[1].split('.')[0].toLowerCase();\n switch (stab) {\n case 'alpha':\n return VersionStability.Alpha;\n case 'beta':\n return VersionStability.Beta;\n case 'rc':\n return VersionStability.RC;\n default:\n return VersionStability.Dev;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/versions', { VersionStability: VersionStability,isProductionReady: isProductionReady,stability: stability, });","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Model from 'flarum/common/Model';\nimport app from 'flarum/admin/app';\nimport { isProductionReady } from '../utils/versions';\nexport default class ExternalExtension extends Model {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"extensionId\", Model.attribute('extensionId'));\n _defineProperty(this, \"name\", Model.attribute('name'));\n _defineProperty(this, \"title\", Model.attribute('title'));\n _defineProperty(this, \"description\", Model.attribute('description'));\n _defineProperty(this, \"iconUrl\", Model.attribute('iconUrl'));\n _defineProperty(this, \"icon\", Model.attribute('icon'));\n _defineProperty(this, \"highestVersion\", Model.attribute('highestVersion'));\n _defineProperty(this, \"httpUri\", Model.attribute('httpUri'));\n _defineProperty(this, \"discussUri\", Model.attribute('discussUri'));\n _defineProperty(this, \"vendor\", Model.attribute('vendor'));\n _defineProperty(this, \"isPremium\", Model.attribute('isPremium'));\n _defineProperty(this, \"isLocale\", Model.attribute('isLocale'));\n _defineProperty(this, \"locale\", Model.attribute('locale'));\n _defineProperty(this, \"latestFlarumVersionSupported\", Model.attribute('latestFlarumVersionSupported'));\n _defineProperty(this, \"downloads\", Model.attribute('downloads'));\n _defineProperty(this, \"installed\", false);\n }\n isSupported() {\n const currentVersion = app.data.settings.version;\n const latestCompatibleVersion = this.latestFlarumVersionSupported();\n\n // If stability is not the same, it's not compatible.\n if (currentVersion.split('-')[1] !== latestCompatibleVersion.split('-')[1]) {\n return false;\n }\n\n // Minor versions are compatible.\n return currentVersion.split('.')[0] === latestCompatibleVersion.split('.')[0];\n }\n isProductionReady() {\n return isProductionReady(this.highestVersion());\n }\n toLocalExtension() {\n return {\n id: this.extensionId(),\n name: this.name(),\n version: this.highestVersion(),\n description: this.description(),\n icon: this.icon() || {\n name: 'fas fa-box-open',\n backgroundColor: '#117187',\n color: '#fff'\n },\n links: {\n discuss: this.discussUri(),\n website: this.httpUri()\n },\n extra: {\n 'flarum-extension': {\n title: this.title()\n }\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/ExternalExtension', ExternalExtension);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Component from 'flarum/common/Component';\nimport Icon from 'flarum/common/components/Icon';\nimport Badge from 'flarum/common/components/Badge';\nimport app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport formatAmount from 'flarum/common/utils/formatAmount';\nimport ExternalExtension from '../models/ExternalExtension';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport WhyNotModal from './WhyNotModal';\nimport LinkButton from 'flarum/common/components/LinkButton';\nexport default class ExtensionCard extends Component {\n getExtension() {\n return this.attrs.extension instanceof ExternalExtension ? this.attrs.extension.toLocalExtension() : this.attrs.extension;\n }\n view() {\n const extension = this.getExtension();\n const {\n isCore,\n isDanger\n } = this.attrs;\n return m(\"div\", {\n className: classList('ExtensionCard', {\n 'ExtensionCard--core': isCore,\n 'ExtensionCard--danger': isDanger\n })\n }, m(\"div\", {\n className: \"ExtensionCard-header\"\n }, this.icon(), m(Tooltip, {\n text: extension.name\n }, m(\"h4\", null, extension.extra['flarum-extension'].title)), this.attrs.extension instanceof ExternalExtension && m(\"div\", {\n className: \"ExtensionCard-badges\"\n }, this.badges().toArray()), m(\"div\", {\n className: \"ExtensionCard-actions\"\n }, this.actionItems().toArray())), m(\"div\", {\n className: \"ExtensionCard-body\"\n }, m(\"p\", null, extension.description)), m(\"div\", {\n className: \"ExtensionCard-footer\"\n }, m(\"div\", {\n className: \"ExtensionCard-meta\"\n }, this.metaItems().toArray())));\n }\n icon() {\n const extension = this.getExtension();\n if (this.attrs.extension instanceof ExternalExtension && extension.id in app.data.extensions) {\n extension.icon = app.data.extensions[extension.id].icon;\n }\n const style = extension.icon || {};\n if (!extension.icon?.name && this.attrs.extension instanceof ExternalExtension && !(extension.id in app.data.extensions) && this.attrs.extension.iconUrl()) {\n style.backgroundImage = `url(${this.attrs.extension.iconUrl()})`;\n }\n return m(\"span\", {\n className: \"ExtensionIcon\",\n style: extension.icon\n }, extension.icon?.name ? m(Icon, {\n name: extension.icon.name\n }) : null);\n }\n badges() {\n const items = new ItemList();\n const extension = this.attrs.extension;\n if (extension.isSupported()) {\n items.add('compatible', m(Badge, {\n icon: \"fas fa-check\",\n type: \"success\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.compatible'),\n className: \"Badge--flat Badge--square\"\n }));\n } else {\n items.add('incompatible', m(Badge, {\n icon: \"fas fa-times\",\n type: \"danger\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.incompatible'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.isPremium()) {\n items.add('premium', m(Badge, {\n icon: \"fas fa-dollar-sign\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.premium'),\n className: \"ExtensionCard-badge--premium Badge--flat Badge--square\"\n }));\n }\n if (!extension.isProductionReady()) {\n items.add('unstable', m(Badge, {\n icon: \"fas fa-flask\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.unstable'),\n className: \"Badge--flat Badge--square Badge--danger\"\n }));\n }\n if (extension.name().split('/')[0] === 'fof') {\n items.add('fof', m(Badge, {\n icon: \"fas fa-users\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.fof'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.name().split('/')[0] === 'flarum') {\n items.add('flarum', m(Badge, {\n icon: \"fab fa-flarum\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.flarum'),\n className: \"ExtensionCard-badge--flarum Badge--flat Badge--square\"\n }));\n }\n return items;\n }\n metaItems() {\n const items = new ItemList();\n const {\n updates,\n isCore\n } = this.attrs;\n const latestVersion = updates ? updates['latest-minor'] ?? (updates['latest-major'] && !isCore ? updates['latest-major'] : null) : null;\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('downloads', m(\"span\", null, m(Icon, {\n name: \"fas fa-circle-down\"\n }), app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.downloads', {\n count: this.attrs.extension.downloads(),\n formattedCount: formatAmount(this.attrs.extension.downloads())\n })));\n } else {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, m(\"span\", {\n className: \"ExtensionCard-version-current\"\n }, this.version(updates['version'])), latestVersion ? m('[', null, m(Icon, {\n name: \"fas fa-arrow-right\"\n }), m(Label, {\n className: \"ExtensionCard-version-latest\",\n type: updates['latest-minor'] ? 'success' : 'warning'\n }, this.version(latestVersion))) : null));\n }\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, \"v\", this.version(this.attrs.extension.highestVersion())));\n items.add('link', m(LinkButton, {\n className: \"Button Button--ua-reset Button--link Button--icon\",\n href: this.attrs.extension.httpUri(),\n target: \"_blank\",\n icon: \"fas fa-external-link-alt\",\n external: true\n }));\n }\n return items;\n }\n actionItems() {\n const items = new ItemList();\n const {\n updates,\n extension,\n onClickUpdate,\n whyNotWarning\n } = this.attrs;\n if (extension instanceof ExternalExtension) {\n if (!(extension.extensionId() in app.data.extensions)) {\n items.add('install', m(Button, {\n className: \"Button Button--icon Button--flat\",\n icon: \"fas fa-cloud-arrow-down\",\n onclick: () => {\n app.extensionManager.control.requirePackage({\n package: extension.name()\n });\n }\n }));\n } else {\n items.add('installed', m(Button, {\n className: \"Button Button--icon Button--flat Button--success\",\n icon: \"fas fa-check-circle\",\n disabled: true\n }));\n }\n } else {\n if (onClickUpdate && typeof onClickUpdate === 'function') {\n items.add('update', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n className: \"Button Button--icon Button--flat\",\n onclick: onClickUpdate,\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.update')\n })));\n } else if (onClickUpdate) {\n items.add('update', m(Dropdown, {\n buttonClassName: \"Button Button--icon Button--flat\",\n icon: \"fas fa-ellipsis\",\n label: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n onclick: onClickUpdate.soft\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_soft_label')), m(Button, {\n icon: \"fas fa-rotate\",\n onclick: onClickUpdate.hard,\n disabled: !updates['direct-dependency']\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_hard_label'))));\n }\n if (whyNotWarning) items.add('whyNot', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n }, m(Button, {\n icon: \"fas fa-exclamation-circle\",\n className: \"Button Button--icon Button--flat Button--danger\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: extension.name\n }),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n })));\n }\n return items;\n }\n version(v) {\n return v.charAt(0) === 'v' ? v.substring(1) : v;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ExtensionCard', ExtensionCard);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Alert from 'flarum/common/components/Alert';\nimport WhyNotModal from './WhyNotModal';\nimport ExtensionCard from './ExtensionCard';\nimport classList from 'flarum/common/utils/classList';\nexport default class MajorUpdater extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"updateState\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.updateState = this.attrs.updateState;\n }\n view() {\n return m(\"div\", {\n className: classList('Form-group Form-group--danger ExtensionManager-majorUpdate', {\n 'ExtensionManager-majorUpdate--failed': this.updateState.status === 'failure',\n 'ExtensionManager-majorUpdate--incompatibleExtensions': this.updateState.incompatibleExtensions.length\n })\n }, m(\"img\", {\n alt: \"flarum logo\",\n src: app.forum.attribute('baseUrl') + '/assets/extensions/flarum-extension-manager/flarum.svg'\n }), m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.major_updater.title', {\n version: this.attrs.coreUpdate['latest-major']\n })), m(\"p\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.description')), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run_help')\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-vial\",\n onclick: this.update.bind(this, true),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run'))), m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-play\",\n onclick: this.update.bind(this, false),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.update'))), this.updateState.incompatibleExtensions.length ? m(\"div\", {\n className: \"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid\"\n }, this.updateState.incompatibleExtensions.map(extension => m(ExtensionCard, {\n extension: app.data.extensions[extension.replace('flarum-', '').replace('flarum-ext-', '').replace('/', '-')],\n updates: {},\n onClickUpdate: null,\n isDanger: true\n }))) : null, this.updateState.status === 'failure' ? m(Alert, {\n type: \"error\",\n className: \"ExtensionManager-majorUpdate-failure\",\n dismissible: false,\n controls: [m(Button, {\n className: \"Button Button--text ExtensionManager-majorUpdate-failure-details\",\n icon: \"fas fa-question-circle\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: 'flarum/core'\n })\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.why'))]\n }, m(\"p\", {\n className: \"ExtensionManager-majorUpdate-failure-desc\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.desc'))) : null);\n }\n update(dryRun) {\n app.extensionManager.control.majorUpdate({\n dryRun\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/MajorUpdater', MajorUpdater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/InfoTile');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MajorUpdater from './MajorUpdater';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport ExtensionCard from './ExtensionCard';\nimport { isProductionReady } from '../utils/versions';\nexport default class Updater extends Component {\n view() {\n const core = app.extensionManager.control.coreUpdate;\n return [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.updater.updater_title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.updater_help')), this.lastUpdateCheckView(), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, this.controlItems().toArray()), this.availableUpdatesView()), core && core.package['latest-major'] && isProductionReady(core.package['latest-major']) ? m(MajorUpdater, {\n coreUpdate: core.package,\n updateState: app.extensionManager.control.lastUpdateRun.major\n }) : null];\n }\n lastUpdateCheckView() {\n return app.extensionManager.control.lastUpdateCheck?.checkedAt && m(\"p\", {\n className: \"ExtensionManager-lastUpdatedAt\"\n }, m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-label\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.last_update_checked_at')), m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-value\"\n }, humanTime(app.extensionManager.control.lastUpdateCheck.checkedAt))) || null;\n }\n availableUpdatesView() {\n const state = app.extensionManager.control;\n if (app.extensionManager.control.isLoading('check') || app.extensionManager.control.isLoading('global-update')) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(LoadingIndicator, null));\n }\n const hasMinorCoreUpdate = state.coreUpdate && state.coreUpdate.package['latest-minor'];\n if (!(state.extensionUpdates.length || hasMinorCoreUpdate)) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions ExtensionManager-extensions--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-check\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.up_to_date')));\n }\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(\"div\", {\n className: \"ExtensionManager-extensions-grid\"\n }, hasMinorCoreUpdate ? m(ExtensionCard, {\n extension: state.coreUpdate.extension,\n updates: state.coreUpdate.package,\n isCore: true,\n onClickUpdate: () => state.updateCoreMinor(),\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes('flarum/core')\n }) : null, state.extensionUpdates.map(extension => m(ExtensionCard, {\n extension: extension,\n updates: state.packageUpdates[extension.id],\n onClickUpdate: {\n soft: () => state.updateExtension(extension, 'soft'),\n hard: () => state.updateExtension(extension, 'hard')\n },\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes(extension.name)\n }))));\n }\n controlItems() {\n const items = new ItemList();\n items.add('updateCheck', m(Button, {\n className: \"Button\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.control.checkForUpdates(),\n loading: app.extensionManager.control.isLoading('check'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.check_for_updates')), 100);\n items.add('globalUpdate', m(Button, {\n className: \"Button\",\n icon: \"fas fa-play\",\n onclick: () => app.extensionManager.control.updateGlobally(),\n loading: app.extensionManager.control.isLoading('global-update'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.run_global_update')));\n return items;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Updater', Updater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Installer from './Installer';\nimport Updater from './Updater';\nimport Form from 'flarum/common/components/Form';\nexport default class ControlSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-controlSection\"\n }, m(\"div\", {\n className: \"container\"\n }, app.data['flarum-extension-manager.writable_dirs'] ? m(Form, null, m(Installer, null), m(Updater, null)) : m(\"div\", {\n className: \"Form-group\"\n }, m(Alert, {\n type: \"warning\",\n dismissible: false\n }, app.translator.trans('flarum-extension-manager.admin.file_permissions')))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ControlSection', ControlSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport FormGroup from 'flarum/common/components/FormGroup';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nexport default class ConfigureJson extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"settings\", {});\n _defineProperty(this, \"initialSettings\", null);\n _defineProperty(this, \"loading\", false);\n _defineProperty(this, \"type\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.submit(true);\n }\n className() {\n return '';\n }\n view() {\n return m(\"div\", {\n className: classList('FormSection', this.className())\n }, m(\"label\", null, this.title()), this.content(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton()));\n }\n submitButton() {\n return [m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n onclick: () => this.submit(false),\n disabled: !this.isDirty()\n }, app.translator.trans('core.admin.settings.submit_button'))];\n }\n customSettingComponents() {\n return FormGroup.prototype.customFieldComponents();\n }\n setting(key) {\n return this.settings[key] ?? (this.settings[key] = Stream());\n }\n submit(readOnly) {\n this.loading = true;\n const configuration = {};\n Object.keys(this.settings).forEach(key => {\n configuration[key] = this.settings[key]();\n });\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/extension-manager/composer',\n body: {\n type: this.type,\n data: readOnly ? null : configuration\n }\n }).then(_ref => {\n let {\n data\n } = _ref;\n Object.keys(data).forEach(key => {\n this.settings[key] = Stream(data[key]);\n });\n this.initialSettings = Array.isArray(data) ? {} : data;\n }).finally(() => {\n this.loading = false;\n m.redraw();\n });\n }\n isDirty() {\n return JSON.stringify(this.initialSettings) !== JSON.stringify(this.settings);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureJson', ConfigureJson);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Select');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport Form from 'flarum/common/components/Form';\nexport default class RepositoryModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"repository\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.name = Stream(this.attrs.name || '');\n this.repository = Stream(this.attrs.repository || {\n type: 'composer',\n url: ''\n });\n }\n className() {\n return 'RepositoryModal Modal--small';\n }\n title() {\n const context = this.attrs.repository ? 'edit' : 'add';\n return app.translator.trans(`flarum-extension-manager.admin.composer.${context}_repository_label`);\n }\n content() {\n const types = {\n composer: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.composer'),\n vcs: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.vcs'),\n path: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.path')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.name_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.name\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.type_label')), m(Select, {\n options: types,\n value: this.repository().type,\n onchange: value => this.repository({\n ...this.repository(),\n type: value\n })\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.url')), m(\"input\", {\n className: \"FormControl\",\n onchange: e => this.repository({\n ...this.repository(),\n url: e.target.value\n }),\n value: this.repository().url\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.repository(), this.name());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/RepositoryModal', RepositoryModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport RepositoryModal from './RepositoryModal';\nexport default class ConfigureComposer extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'composer');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.composer.title');\n }\n className() {\n return 'ConfigureComposer';\n }\n content() {\n return m(\"div\", {\n className: \"Form ExtensionManager-SettingsGroups-content\"\n }, this.attrs.buildSettingComponent.call(this, {\n setting: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label'),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help'),\n type: 'select',\n options: {\n stable: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.stable'),\n RC: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.rc'),\n beta: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.beta'),\n alpha: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.alpha'),\n dev: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.dev')\n }\n }), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.help')), m(\"div\", {\n className: \"ConfigureComposer-repositories\"\n }, Object.keys(this.setting('repositories')() || {}).map(name => {\n const repository = this.setting('repositories')()[name];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: {\n composer: 'fas fa-cubes',\n vcs: 'fas fa-code-branch',\n path: 'fas fa-folder'\n }[repository.type],\n onclick: () => app.modal.show(RepositoryModal, {\n name,\n repository,\n onsubmit: (repository, newName) => {\n const repositories = this.setting('repositories')();\n delete repositories[name];\n this.setting('repositories')(repositories);\n this.onchange(repository, newName);\n }\n })\n }, name, \" (\", repository.type, \")\"), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_confirmation')))) {\n const repositories = {\n ...this.setting('repositories')()\n };\n delete repositories[name];\n this.setting('repositories')(repositories);\n }\n }\n }));\n }))));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(RepositoryModal, {\n onsubmit: this.onchange.bind(this)\n })\n }, app.translator.trans('flarum-extension-manager.admin.composer.add_repository_label')));\n return items;\n }\n onchange(repository, name) {\n this.setting('repositories')({\n ...this.setting('repositories')(),\n [name]: repository\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureComposer', ConfigureComposer);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nexport default class AuthMethodModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", void 0);\n _defineProperty(this, \"host\", void 0);\n _defineProperty(this, \"token\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.type = Stream(this.attrs.type || 'bearer');\n this.host = Stream(this.attrs.host || '');\n this.token = Stream(this.attrs.token || '');\n }\n className() {\n return 'AuthMethodModal Modal--small';\n }\n title() {\n const context = this.attrs.host ? 'edit' : 'add';\n return app.translator.trans(`flarum-extension-manager.admin.auth_config.${context}_label`);\n }\n content() {\n const types = {\n 'github-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.github-oauth'),\n 'gitlab-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-oauth'),\n 'gitlab-token': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-token'),\n bearer: app.translator.trans('flarum-extension-manager.admin.auth_config.types.bearer')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.type_label')), m(Select, {\n options: types,\n value: this.type(),\n onchange: this.type\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.host,\n placeholder: app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_placeholder')\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.token_label')), m(\"textarea\", {\n className: \"FormControl\",\n oninput: e => this.token(e.target.value),\n rows: \"6\",\n placeholder: this.token().startsWith('unchanged:') ? extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder')) : ''\n }, this.token().startsWith('unchanged:') ? '' : this.token())), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.type(), this.host(), this.token());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/AuthMethodModal', AuthMethodModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport AuthMethodModal from './AuthMethodModal';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ConfigureAuth extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'auth');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.auth_config.title');\n }\n className() {\n return 'ConfigureAuth';\n }\n content() {\n const authSettings = Object.keys(this.settings);\n const hasAuthSettings = authSettings.length && authSettings.every(type => {\n const data = this.settings[type]();\n return Array.isArray(data) ? data.length : Object.keys(data).length;\n });\n return m(\"div\", {\n className: \"ExtensionManager-SettingsGroups-content\"\n }, hasAuthSettings ? authSettings.map(type => {\n const hosts = this.settings[type]();\n return m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans(`flarum-extension-manager.admin.auth_config.types.${type}`)), m(\"div\", {\n className: \"ConfigureAuth-hosts\"\n }, Object.keys(hosts).map(host => {\n const data = hosts[host];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-key\",\n onclick: () => app.modal.show(AuthMethodModal, {\n type,\n host,\n token: data,\n onsubmit: this.onchange.bind(this, host)\n })\n }, host), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.auth_config.delete_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.delete_confirmation')))) {\n const newType = {\n ...this.setting(type)()\n };\n delete newType[host];\n if (Object.keys(newType).length) {\n this.setting(type)(newType);\n } else {\n delete this.settings[type];\n }\n }\n }\n }));\n })));\n }) : m(\"span\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.no_auth_methods_configured')));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n loading: this.loading,\n onclick: () => app.modal.show(AuthMethodModal, {\n onsubmit: this.onchange.bind(this, null)\n })\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_label')));\n return items;\n }\n onchange(oldHost, type, host, token) {\n const data = {\n ...this.setting(type)()\n };\n if (oldHost) {\n delete data[oldHost];\n }\n data[host] = token;\n this.setting(type)(data);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureAuth', ConfigureAuth);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Input');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/listItems');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Form from 'flarum/common/components/Form';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Input from 'flarum/common/components/Input';\nimport Stream from 'flarum/common/utils/Stream';\nimport Alert from 'flarum/common/components/Alert';\nimport listItems from 'flarum/common/helpers/listItems';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ExtensionCard from './ExtensionCard';\nimport Pagination from 'flarum/common/components/Pagination';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport classList from 'flarum/common/utils/classList';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nexport default class DiscoverSection extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"search\", Stream(''));\n _defineProperty(this, \"warningsDismissed\", Stream(false));\n _defineProperty(this, \"applySearch\", throttle(1200, value => {\n const params = app.extensionManager.extensions.getParams();\n app.extensionManager.extensions.refreshParams({\n ...params,\n filter: {\n ...params.filter,\n q: value\n }\n }, 1);\n }));\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.extensions.goto(1);\n this.warningsDismissed(localStorage.getItem('flarum-extension-manager.warningsDismissed') === 'true');\n }\n load(page) {\n if (page === void 0) {\n page = 1;\n }\n app.extensionManager.extensions.goto(page);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-DiscoverSection\"\n }, m(\"div\", {\n className: \"container\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.discover.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.description'), this.warningsDismissed() && m(Button, {\n className: \"Button Button--text Button--warning Button--more\",\n icon: \"fas fa-exclamation-triangle\",\n onclick: () => this.setWarningDismissed(false)\n }))), !this.warningsDismissed() && m(\"div\", {\n className: \"ExtensionManager-warnings Form-group\"\n }, m(Alert, {\n className: \"ExtensionManager-primaryWarning\",\n type: \"warning\",\n dismissible: true,\n ondismiss: () => this.setWarningDismissed(true)\n }, m(\"ul\", null, listItems(this.warningItems().toArray())))), m(\"div\", {\n className: \"Tabs\"\n }, m(\"div\", {\n className: \"Tabs-nav\"\n }, this.tabItems().toArray()), m(\"div\", {\n className: \"Tabs-content\"\n }, m(\"hr\", {\n className: \"Tabs-divider\"\n }), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar\"\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-primary\"\n }, this.toolbarPrimaryItems().toArray()), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-secondary\"\n }, this.toolbarSecondaryItems().toArray())), this.extensionList(), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-footer\"\n }, this.footerItems().toArray()))))));\n }\n tabFilters() {\n return {\n '': {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.discover'),\n active: () => !app.extensionManager.extensions.getParams().filter?.type\n },\n extension: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.extensions'),\n active: () => app.extensionManager.extensions.getParams().filter?.type === 'extension'\n },\n locale: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.languages'),\n active: () => app.extensionManager.extensions.getParams().filter?.type === 'locale'\n },\n theme: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.themes'),\n active: () => app.extensionManager.extensions.getParams().filter?.type === 'theme'\n }\n };\n }\n tabItems() {\n const items = new ItemList();\n const tabs = this.tabFilters();\n Object.keys(tabs).forEach(key => {\n const tab = tabs[key];\n items.add(key, m(Button, {\n className: \"Button Button--link\",\n active: tab.active(),\n onclick: () => {\n app.extensionManager.extensions.changeFilter('type', key);\n }\n }, tab.label));\n });\n return items;\n }\n warningItems() {\n const items = new ItemList();\n items.add('accessWarning', app.translator.trans('flarum-extension-manager.admin.settings.access_warning'));\n if (app.data.debugEnabled) {\n items.add('devModeWarning', app.translator.trans('flarum-extension-manager.admin.settings.debug_mode_warning'));\n }\n return items;\n }\n toolbarPrimaryItems() {\n const items = new ItemList();\n items.add('search', m(Input, {\n value: this.search(),\n onchange: value => {\n this.search(value);\n this.applySearch(value);\n },\n inputAttrs: {\n className: 'FormControl-alt'\n },\n clearable: true,\n placeholder: app.translator.trans('flarum-extension-manager.admin.sections.discover.search'),\n prefixIcon: \"fas fa-search\"\n }));\n return items;\n }\n toolbarSecondaryItems() {\n const items = new ItemList();\n const sortMap = app.extensionManager.extensions.sortMap();\n const sortOptions = Object.keys(sortMap).reduce((acc, sortId) => {\n const sort = sortMap[sortId];\n acc[sortId] = typeof sort !== 'string' ? sort.label : sort;\n return acc;\n }, {});\n items.add('sort', m(Dropdown, {\n buttonClassName: \"Button\",\n label: sortOptions[app.extensionManager.extensions.getParams().sort] || Object.keys(sortMap).map(key => sortOptions[key])[0],\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label')\n }, Object.keys(sortOptions).map(value => {\n const label = sortOptions[value];\n const active = app.extensionManager.extensions.getParams().sort === value;\n return m(Button, {\n icon: active ? 'fas fa-check' : true,\n onclick: () => app.extensionManager.extensions.changeSort(value),\n active: active\n }, label);\n })));\n const is = app.extensionManager.extensions.getParams().filter?.is?.[0] ?? null;\n const activeType = is || 'all';\n items.add('party', m(Dropdown, {\n buttonClassName: \"Button\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + activeType),\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label')\n }, ['all', 'premium'].map(party => m(Button, {\n icon: activeType === party ? 'fas fa-check' : true,\n onclick: () => {\n app.extensionManager.extensions.changeFilter('is', party === 'all' ? undefined : [party]);\n },\n active: activeType === party\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + party)))));\n return items;\n }\n extensionList() {\n if (!app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading()) {\n return m(LoadingIndicator, {\n display: \"block\"\n });\n }\n if (!app.extensionManager.extensions.hasItems()) {\n return m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-exclamation\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.empty_results')));\n }\n return m(\"div\", {\n className: classList('ExtensionManager-DiscoverSection-list', {\n 'loading-container': app.extensionManager.extensions.isLoading()\n })\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list-inner\"\n }, app.extensionManager.extensions.getPages().map(page => page.items.map(extension => m(ExtensionCard, {\n extension: extension,\n key: extension.name()\n })))), app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n }));\n }\n footerItems() {\n const items = new ItemList();\n items.add('pagination', m(Pagination, {\n total: app.extensionManager.extensions.totalItems,\n perPage: app.extensionManager.extensions.pageSize,\n currentPage: app.extensionManager.extensions.getLocation().page,\n onChange: page => {\n const current = app.extensionManager.extensions.getLocation().page;\n if (current === page) {\n return;\n }\n this.load(page);\n }\n }));\n items.add('premiumTermsLink', m(LinkButton, {\n className: \"Button Button--link\",\n href: \"https://flarum.org/terms/premium-extensions\",\n external: true,\n target: \"_blank\",\n icon: \"fas fa-circle-info\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.premium_extension_terms')));\n return items;\n }\n setWarningDismissed(dismissed) {\n this.warningsDismissed(dismissed);\n localStorage.setItem('flarum-extension-manager.warningsDismissed', dismissed ? 'true' : 'false');\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/DiscoverSection', DiscoverSection);","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport QueueSection from './QueueSection';\nimport ControlSection from './ControlSection';\nimport ConfigureComposer from './ConfigureComposer';\nimport ConfigureAuth from './ConfigureAuth';\nimport DiscoverSection from './DiscoverSection';\nexport default class SettingsPage extends ExtensionPage {\n content() {\n const settings = app.registry.getSettings(this.extension.id);\n return m(\"div\", {\n className: \"ExtensionPage-settings\"\n }, m(\"div\", {\n className: \"container\"\n }, settings ? [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.settings.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.settings.description'))), m(\"div\", {\n className: \"FormSectionGroup ExtensionManager-SettingsGroups\"\n }, m(\"div\", {\n className: \"FormSection\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.settings.title')), m(\"div\", {\n className: \"Form\"\n }, settings.map(this.buildSettingComponent.bind(this))), m(\"div\", {\n className: \"Form-group Form--controls\"\n }, this.submitButton())), m(ConfigureComposer, {\n buildSettingComponent: this.buildSettingComponent\n }), m(ConfigureAuth, {\n buildSettingComponent: this.buildSettingComponent\n }))] : m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('core.admin.extension.no_settings'))));\n }\n sections(vnode) {\n const items = super.sections(vnode);\n items.add('discover', m(DiscoverSection, null), 15);\n items.add('control', m(ControlSection, null), 10);\n items.setPriority('content', 8);\n if (app.data.settings['flarum-extension-manager.queue_jobs'] !== '0' && app.data.settings['flarum-extension-manager.queue_jobs']) {\n items.add('queue', m(QueueSection, null), 5);\n }\n items.remove('permissions');\n return items;\n }\n onsaved() {\n super.onsaved();\n m.redraw();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/SettingsPage', SettingsPage);","const BYTE_UNITS = [\n\t'B',\n\t'kB',\n\t'MB',\n\t'GB',\n\t'TB',\n\t'PB',\n\t'EB',\n\t'ZB',\n\t'YB',\n];\n\nconst BIBYTE_UNITS = [\n\t'B',\n\t'KiB',\n\t'MiB',\n\t'GiB',\n\t'TiB',\n\t'PiB',\n\t'EiB',\n\t'ZiB',\n\t'YiB',\n];\n\nconst BIT_UNITS = [\n\t'b',\n\t'kbit',\n\t'Mbit',\n\t'Gbit',\n\t'Tbit',\n\t'Pbit',\n\t'Ebit',\n\t'Zbit',\n\t'Ybit',\n];\n\nconst BIBIT_UNITS = [\n\t'b',\n\t'kibit',\n\t'Mibit',\n\t'Gibit',\n\t'Tibit',\n\t'Pibit',\n\t'Eibit',\n\t'Zibit',\n\t'Yibit',\n];\n\n/*\nFormats the given number using `Number#toLocaleString`.\n- If locale is a string, the value is expected to be a locale-key (for example: `de`).\n- If locale is true, the system default locale is used for translation.\n- If no value for locale is specified, the number is returned unmodified.\n*/\nconst toLocaleString = (number, locale, options) => {\n\tlet result = number;\n\tif (typeof locale === 'string' || Array.isArray(locale)) {\n\t\tresult = number.toLocaleString(locale, options);\n\t} else if (locale === true || options !== undefined) {\n\t\tresult = number.toLocaleString(undefined, options);\n\t}\n\n\treturn result;\n};\n\nexport default function prettyBytes(number, options) {\n\tif (!Number.isFinite(number)) {\n\t\tthrow new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);\n\t}\n\n\toptions = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\tspace: true,\n\t\t...options,\n\t};\n\n\tconst UNITS = options.bits\n\t\t? (options.binary ? BIBIT_UNITS : BIT_UNITS)\n\t\t: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);\n\n\tconst separator = options.space ? ' ' : '';\n\n\tif (options.signed && number === 0) {\n\t\treturn ` 0${separator}${UNITS[0]}`;\n\t}\n\n\tconst isNegative = number < 0;\n\tconst prefix = isNegative ? '-' : (options.signed ? '+' : '');\n\n\tif (isNegative) {\n\t\tnumber = -number;\n\t}\n\n\tlet localeOptions;\n\n\tif (options.minimumFractionDigits !== undefined) {\n\t\tlocaleOptions = {minimumFractionDigits: options.minimumFractionDigits};\n\t}\n\n\tif (options.maximumFractionDigits !== undefined) {\n\t\tlocaleOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};\n\t}\n\n\tif (number < 1) {\n\t\tconst numberString = toLocaleString(number, options.locale, localeOptions);\n\t\treturn prefix + numberString + separator + UNITS[0];\n\t}\n\n\tconst exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);\n\tnumber /= (options.binary ? 1024 : 1000) ** exponent;\n\n\tif (!localeOptions) {\n\t\tnumber = number.toPrecision(3);\n\t}\n\n\tconst numberString = toLocaleString(Number(number), options.locale, localeOptions);\n\n\tconst unit = UNITS[exponent];\n\n\treturn prefix + numberString + separator + unit;\n}\n","import Model from 'flarum/common/Model';\nimport prettyBytes from 'pretty-bytes';\nexport default class Task extends Model {\n status() {\n return Model.attribute('status').call(this);\n }\n operation() {\n return Model.attribute('operation').call(this);\n }\n command() {\n return Model.attribute('command').call(this);\n }\n package() {\n return Model.attribute('package').call(this);\n }\n output() {\n return Model.attribute('output').call(this);\n }\n guessedCause() {\n return Model.attribute('guessedCause').call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n startedAt() {\n return Model.attribute('startedAt', Model.transformDate).call(this);\n }\n finishedAt() {\n return Model.attribute('finishedAt', Model.transformDate).call(this);\n }\n peakMemoryUsed() {\n return prettyBytes(Model.attribute('peakMemoryUsed').call(this) * 1024);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/Task', Task);","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nimport SettingsPage from './components/SettingsPage';\nimport Task from './models/Task';\nimport ExternalExtension from './models/ExternalExtension';\nexport default [new Extend.Store() //\n.add('extension-manager-tasks', Task).add('external-extensions', ExternalExtension), new Extend.Admin().setting(() => ({\n setting: 'flarum-extension-manager.queue_jobs',\n label: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs'),\n help: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs_help', {\n basic_impl_link: m(\"a\", {\n href: \"https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting\"\n }),\n adv_impl_link: m(\"a\", {\n href: \"https://discuss.flarum.org/d/21873-redis-sessions-cache-queues\"\n }),\n php_version: m(\"strong\", null, app.data.phpVersion),\n folder_perms_link: m(\"a\", {\n href: \"https://docs.flarum.org/install#folder-ownership\"\n })\n }),\n type: 'boolean',\n disabled: app.data['flarum-extension-manager.using_sync_queue']\n})).setting(() => ({\n setting: 'flarum-extension-manager.task_retention_days',\n label: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days'),\n help: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days_help'),\n type: 'number'\n})).page(SettingsPage).generalIndexItems('settings', () => [{\n id: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help', {}, true)\n}, {\n id: 'repositories',\n label: app.translator.trans('flarum-extension-manager.admin.composer.repositories.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.repositories.help', {}, true)\n}, {\n id: 'composer-auth',\n label: app.translator.trans('flarum-extension-manager.admin.auth_config.title', {}, true)\n}, {\n id: 'updates',\n label: app.translator.trans('flarum-extension-manager.admin.updater.updater_title', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.updater.updater_help', {}, true)\n}])];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport isExtensionEnabled from 'flarum/admin/utils/isExtensionEnabled';\nimport jumpToQueue from './utils/jumpToQueue';\nimport ExtensionManagerState from './states/ExtensionManagerState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-extension-manager', app => {\n app.extensionManager = new ExtensionManagerState();\n if (app.data['flarum-extension-manager.using_sync_queue']) {\n app.data.settings['flarum-extension-manager.queue_jobs'] = '0';\n }\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'flarum-extension-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n items.add('remove', m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-times\",\n onclick: () => {\n app.modal.show(LoadingModal);\n app.request({\n url: `${app.forum.attribute('apiUrl')}/extension-manager/extensions/${this.extension.id}`,\n method: 'DELETE'\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n }\n }).finally(() => {\n app.modal.close();\n });\n }\n }, app.translator.trans('flarum-extension-manager.admin.extensions.remove')));\n });\n});"],"names":["module","exports","t","s","n","i","e","r","o","u","d","a","h","years","months","days","hours","minutes","seconds","milliseconds","weeks","c","g","f","$l","m","p","l","$","Math","ceil","floor","y","abs","v","negative","format","this","$d","$ms","parseFromMilliseconds","Object","keys","forEach","calMilliseconds","match","slice","map","Number","prototype","reduce","toISOString","round","toJSON","Y","YY","YYYY","M","MM","D","DD","H","HH","mm","ss","SSS","replace","String","as","get","add","subtract","locale","clone","humanize","fromNow","valueOf","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","$utils","duration","isDuration","bind","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","getter","__esModule","definition","key","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","reg","jumpToQueue","close","route","set","id","queue","load","setTimeout","document","getElementById","scrollIntoView","block","_typeof","iterator","constructor","_defineProperty","toPrimitive","TypeError","toPropertyKey","configurable","writable","window","QueueState","params","actionTaken","loading","page","limit","offset","find","then","data","tasks","total","payload","meta","redraw","pendingTask","task","status","pollQueue","control","setLoading","location","reload","isLoading","getItems","getTotalItems","getTotalPages","pageNumber","getPerPage","hasPrev","hasNext","prev","next","goto","polling","clearTimeout","hasPending","error","response","errors","includes","code","clear","guessed_cause","show","type","trans","ControlSectionState","lastUpdateRun","JSON","parse","settings","limitedPackages","major","minor","global","lastUpdateCheck","extensionUpdates","formatExtensionUpdates","coreUpdate","formatCoreUpdate","name","hasOperationRunning","requirePackage","method","url","attribute","body","processing","extensionId","extension","href","catch","errorHandler","finally","checkForUpdates","updateCoreMinor","confirm","updateExtension","updateMode","extra","title","updateGlobally","packageUpdates","updates","installed","filter","composerPackage","extensions","safeToUpdate","values","core","pop","package","version","icon","backgroundImage","resources","links","majorUpdate","_ref","dryRun","updateState","incompatibleExtensions","incompatible_extensions","ExtensionListState","super","sort","sortMap","label","ExtensionManagerState","Label","view","vnode","className","attrs","assign","children","TaskOutputModal","operation","content","guessedCause","command","output","humanDuration","start","end","dayjs","extend","durationTime","diff","QueueSection","oninit","onclick","disabled","queueTable","columns","items","operationIcon","style","running","failure","pending","success","size","display","startedAt","finishedAt","text","peakMemoryUsed","length","toArray","item","index","currentPage","perPage","onChange","update_check","update_major","update_minor","update_global","extension_install","extension_remove","extension_update","why_not","Installer","arguments","packageName","htmlFor","link","semantic_link","placeholder","bidi","onsubmit","WhyNotModal","oncreate","requestWhyNot","whyNot","reason","VersionStability","isProductionReady","Stable","RC","stability","split","toLowerCase","Alpha","Beta","Dev","ExternalExtension","isSupported","currentVersion","latestCompatibleVersion","latestFlarumVersionSupported","highestVersion","toLocalExtension","description","backgroundColor","color","discuss","discussUri","website","httpUri","ExtensionCard","getExtension","isCore","isDanger","badges","actionItems","metaItems","iconUrl","isPremium","latestVersion","count","downloads","formattedCount","target","external","onClickUpdate","whyNotWarning","buttonClassName","soft","hard","charAt","substring","MajorUpdater","alt","src","update","dismissible","controls","Updater","lastUpdateCheckView","controlItems","availableUpdatesView","checkedAt","state","hasMinorCoreUpdate","ControlSection","ConfigureJson","submit","submitButton","isDirty","customSettingComponents","customFieldComponents","setting","readOnly","configuration","initialSettings","Array","isArray","stringify","RepositoryModal","repository","context","types","composer","vcs","path","options","onchange","hide","ConfigureComposer","buildSettingComponent","help","stable","beta","alpha","dev","newName","repositories","push","AuthMethodModal","host","token","bearer","oninput","rows","startsWith","ConfigureAuth","authSettings","hasAuthSettings","every","hosts","newType","oldHost","DiscoverSection","throttle","getParams","refreshParams","q","warningsDismissed","localStorage","getItem","setWarningDismissed","ondismiss","warningItems","tabItems","toolbarPrimaryItems","toolbarSecondaryItems","extensionList","footerItems","tabFilters","active","theme","tabs","tab","changeFilter","debugEnabled","search","applySearch","inputAttrs","clearable","prefixIcon","sortOptions","acc","sortId","accessibleToggleLabel","changeSort","activeType","is","party","hasItems","getPages","totalItems","pageSize","getLocation","dismissed","setItem","SettingsPage","getSettings","sections","setPriority","remove","onsaved","BYTE_UNITS","BIBYTE_UNITS","BIT_UNITS","BIBIT_UNITS","toLocaleString","number","result","Task","createdAt","isFinite","UNITS","bits","binary","space","separator","signed","isNegative","prefix","localeOptions","minimumFractionDigits","maximumFractionDigits","exponent","min","log","log10","toPrecision","prettyBytes","basic_impl_link","adv_impl_link","php_version","phpVersion","folder_perms_link","generalIndexItems","app","extensionManager","modal","request","forum","alerts","translator"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"6BAAoEA,EAAOC,QAAmJ,WAAW,aAAa,IAAIC,EAAEC,EAAEC,EAAE,IAAIC,EAAE,IAAIC,EAAE,KAAKC,EAAE,MAAMC,EAAE,sFAAsFC,EAAE,QAAQC,EAAE,OAAOC,EAAE,sKAAsKC,EAAE,CAACC,MAAMJ,EAAEK,OAAOJ,EAAEK,KAAKR,EAAES,MAAMV,EAAEW,QAAQZ,EAAEa,QAAQd,EAAEe,aAAa,EAAEC,MAAM,QAAQC,EAAE,SAASnB,GAAG,OAAOA,aAAaoB,CAAC,EAAEC,EAAE,SAASrB,EAAEC,EAAEC,GAAG,OAAO,IAAIkB,EAAEpB,EAAEE,EAAED,EAAEqB,GAAG,EAAEC,EAAE,SAASvB,GAAG,OAAOC,EAAEuB,EAAExB,GAAG,GAAG,EAAEyB,EAAE,SAASzB,GAAG,OAAOA,EAAE,CAAC,EAAE0B,EAAE,SAAS1B,GAAG,OAAOyB,EAAEzB,GAAG2B,KAAKC,KAAK5B,GAAG2B,KAAKE,MAAM7B,EAAE,EAAE8B,EAAE,SAAS9B,GAAG,OAAO2B,KAAKI,IAAI/B,EAAE,EAAEgC,EAAE,SAAShC,EAAEC,GAAG,OAAOD,EAAEyB,EAAEzB,GAAG,CAACiC,UAAS,EAAGC,OAAO,GAAGJ,EAAE9B,GAAGC,GAAG,CAACgC,UAAS,EAAGC,OAAO,GAAGlC,EAAEC,GAAG,CAACgC,UAAS,EAAGC,OAAO,GAAG,EAAEd,EAAE,WAAW,SAASK,EAAEzB,EAAEC,EAAEC,GAAG,IAAIC,EAAEgC,KAAK,GAAGA,KAAKC,GAAG,CAAC,EAAED,KAAK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xC,IACCQ,SAAQ,KACTsS,EAAIE,MAAMvY,OAAO,GACjB,GAEHqY,EAAIM,WAAWxU,MAAM,qDAC1B,GAAE,G","sources":["webpack://@flarum/extension-manager/../../../node_modules/dayjs/plugin/duration.js","webpack://@flarum/extension-manager/webpack/bootstrap","webpack://@flarum/extension-manager/webpack/runtime/compat get default export","webpack://@flarum/extension-manager/webpack/runtime/define property getters","webpack://@flarum/extension-manager/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/extension-manager/webpack/runtime/make namespace object","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/LoadingModal')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/utils/isExtensionEnabled')\"","webpack://@flarum/extension-manager/./src/admin/utils/jumpToQueue.ts","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/extension-manager/./src/admin/states/QueueState.ts","webpack://@flarum/extension-manager/./src/admin/utils/errorHandler.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/extension-manager/./src/admin/states/ControlSectionState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/extension-manager/./src/admin/states/ExtensionListState.ts","webpack://@flarum/extension-manager/./src/admin/states/ExtensionManagerState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Pagination')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/extension-manager/./src/admin/components/Label.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/extension-manager/./src/admin/components/TaskOutputModal.tsx","webpack://@flarum/extension-manager/./src/admin/utils/humanDuration.ts","webpack://@flarum/extension-manager/./src/admin/components/QueueSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Alert')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/extension-manager/./src/admin/components/Installer.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/extension-manager/./src/admin/components/WhyNotModal.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/formatAmount')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/extension-manager/./src/admin/utils/versions.ts","webpack://@flarum/extension-manager/./src/admin/models/ExternalExtension.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/extension-manager/./src/admin/components/ExtensionCard.tsx","webpack://@flarum/extension-manager/./src/admin/components/MajorUpdater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/InfoTile')\"","webpack://@flarum/extension-manager/./src/admin/components/Updater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/extension-manager/./src/admin/components/ControlSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/extension-manager/./src/admin/components/ConfigureJson.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Select')\"","webpack://@flarum/extension-manager/./src/admin/components/RepositoryModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureComposer.tsx","webpack://@flarum/extension-manager/./src/admin/components/AuthMethodModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureAuth.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Input')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/listItems')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/throttleDebounce')\"","webpack://@flarum/extension-manager/./src/admin/components/DiscoverSection.tsx","webpack://@flarum/extension-manager/./src/admin/components/SettingsPage.tsx","webpack://@flarum/extension-manager/../../../node_modules/pretty-bytes/index.js","webpack://@flarum/extension-manager/./src/admin/models/Task.ts","webpack://@flarum/extension-manager/./src/admin/extend.tsx","webpack://@flarum/extension-manager/./src/admin/index.tsx"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\tflarum.reg._webpack_runtimes[\"flarum-extension-manager\"] ||= __webpack_require__;// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/LoadingModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/utils/isExtensionEnabled');","import app from 'flarum/admin/app';\n\n// @ts-ignore\nwindow.jumpToQueue = jumpToQueue;\nexport default function jumpToQueue() {\n app.modal.close();\n m.route.set(app.route('extension', {\n id: 'flarum-extension-manager'\n }));\n app.extensionManager.queue.load({}, true);\n setTimeout(() => {\n document.getElementById('ExtensionManager-queueSection')?.scrollIntoView({\n block: 'nearest'\n });\n }, 200);\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/jumpToQueue', jumpToQueue);","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nexport default class QueueState {\n constructor() {\n _defineProperty(this, \"polling\", null);\n _defineProperty(this, \"tasks\", null);\n _defineProperty(this, \"limit\", 20);\n _defineProperty(this, \"offset\", 0);\n _defineProperty(this, \"total\", 0);\n _defineProperty(this, \"loading\", false);\n }\n load(params, actionTaken) {\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n this.loading = true;\n params = {\n page: {\n limit: this.limit,\n offset: this.offset,\n ...params?.page\n },\n ...params\n };\n return app.store.find('extension-manager-tasks', params || {}).then(data => {\n this.tasks = data;\n this.total = data.payload.meta?.page?.total || 0;\n m.redraw();\n\n // Check if there is a pending or running task\n const pendingTask = data?.find(task => task.status() === 'pending' || task.status() === 'running');\n if (pendingTask) {\n this.pollQueue(actionTaken);\n } else if (actionTaken) {\n app.extensionManager.control.setLoading(null);\n\n // Refresh the page\n window.location.reload();\n } else if (app.extensionManager.control.isLoading()) {\n app.extensionManager.control.setLoading(null);\n }\n this.loading = false;\n return data;\n });\n }\n isLoading() {\n return this.loading;\n }\n getItems() {\n return this.tasks;\n }\n getTotalItems() {\n return this.total;\n }\n getTotalPages() {\n return Math.ceil(this.total / this.limit);\n }\n pageNumber() {\n return Math.ceil(this.offset / this.limit);\n }\n getPerPage() {\n return this.limit;\n }\n hasPrev() {\n return this.pageNumber() !== 0;\n }\n hasNext() {\n return this.offset + this.limit < this.total;\n }\n prev() {\n if (this.hasPrev()) {\n this.offset -= this.limit;\n this.load();\n }\n }\n next() {\n if (this.hasNext()) {\n this.offset += this.limit;\n this.load();\n }\n }\n goto(page) {\n this.offset = (page - 1) * this.limit;\n this.load();\n }\n pollQueue(actionTaken) {\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n if (this.polling) {\n clearTimeout(this.polling);\n }\n this.polling = setTimeout(() => {\n this.load({}, actionTaken);\n }, 6000);\n }\n hasPending() {\n return !!this.tasks?.find(task => task.status() === 'pending' || task.status() === 'running');\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/QueueState', QueueState);","import app from 'flarum/admin/app';\nexport default function (e) {\n app.extensionManager.control.setLoading(null);\n const error = e.response.errors[0];\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n app.alerts.clear();\n switch (error.code) {\n case 'composer_command_failure':\n if (error.guessed_cause) {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans(`flarum-extension-manager.admin.exceptions.guessed_cause.${error.guessed_cause}`));\n app.modal.close();\n } else {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.composer_command_failure'));\n }\n break;\n case 'extension_already_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n case 'extension_not_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport errorHandler from '../utils/errorHandler';\nimport jumpToQueue from '../utils/jumpToQueue';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ControlSectionState {\n get lastUpdateRun() {\n const lastUpdateRun = JSON.parse(app.data.settings['flarum-extension-manager.last_update_run']);\n lastUpdateRun.limitedPackages = () => [...lastUpdateRun.major.limitedPackages, ...lastUpdateRun.minor.limitedPackages, ...lastUpdateRun.global.limitedPackages];\n return lastUpdateRun;\n }\n constructor() {\n _defineProperty(this, \"loading\", null);\n _defineProperty(this, \"packageUpdates\", {});\n _defineProperty(this, \"lastUpdateCheck\", void 0);\n _defineProperty(this, \"extensionUpdates\", void 0);\n _defineProperty(this, \"coreUpdate\", null);\n this.lastUpdateCheck = JSON.parse(app.data.settings['flarum-extension-manager.last_update_check']);\n this.extensionUpdates = this.formatExtensionUpdates(this.lastUpdateCheck);\n this.coreUpdate = this.formatCoreUpdate(this.lastUpdateCheck);\n }\n isLoading(name) {\n if (name === void 0) {\n name = null;\n }\n return name && this.loading === name || !name && this.loading !== null;\n }\n hasOperationRunning() {\n return this.isLoading() || app.extensionManager.queue.hasPending();\n }\n setLoading(name) {\n this.loading = name;\n }\n requirePackage(data) {\n app.extensionManager.control.setLoading('extension-install');\n app.modal.show(LoadingModal);\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/extensions`,\n body: {\n data\n }\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n const extensionId = response.id;\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_install', {\n extension: extensionId\n }));\n window.location.href = `${app.forum.attribute('adminUrl')}#/extension/${extensionId}`;\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n checkForUpdates() {\n this.setLoading('check');\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/check-for-updates`\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n this.lastUpdateCheck = response;\n this.extensionUpdates = this.formatExtensionUpdates(response);\n this.coreUpdate = this.formatCoreUpdate(response);\n this.setLoading(null);\n m.redraw();\n }\n }).catch(errorHandler).finally(() => {\n m.redraw();\n });\n }\n updateCoreMinor() {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.minor_update_confirmation.content')))) {\n app.modal.show(LoadingModal);\n this.setLoading('minor-update');\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/minor-update`\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n }\n updateExtension(extension, updateMode) {\n app.modal.show(LoadingModal);\n this.setLoading('extension-update');\n app.request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/extensions/${extension.id}`,\n body: {\n data: {\n updateMode\n }\n }\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_update', {\n extension: extension.extra['flarum-extension'].title\n }));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.setLoading('global-update');\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/global-update`\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.updater.global_update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n formatExtensionUpdates(lastUpdateCheck) {\n this.packageUpdates = {};\n lastUpdateCheck?.updates?.installed?.filter(composerPackage => {\n const id = composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '');\n const extension = app.data.extensions[id];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n if (extension && safeToUpdate) {\n this.packageUpdates[extension.id] = composerPackage;\n }\n return extension && safeToUpdate;\n });\n return Object.values(app.data.extensions).filter(extension => this.packageUpdates[extension.id]);\n }\n formatCoreUpdate(lastUpdateCheck) {\n const core = lastUpdateCheck?.updates?.installed?.filter(composerPackage => composerPackage.name === 'flarum/core').pop();\n if (!core) return null;\n return {\n package: core,\n extension: {\n id: 'flarum-core',\n name: 'flarum/core',\n version: app.data.settings.version,\n icon: {\n name: '',\n // @ts-ignore\n backgroundImage: `url(${app.data.resources[0]['attributes']['baseUrl']}/assets/extensions/flarum-extension-manager/flarum.svg`\n },\n extra: {\n 'flarum-extension': {\n title: extractText(app.translator.trans('flarum-extension-manager.admin.updater.flarum'))\n }\n },\n links: {}\n }\n };\n }\n majorUpdate(_ref) {\n let {\n dryRun\n } = _ref;\n app.extensionManager.control.setLoading(dryRun ? 'major-update-dry-run' : 'major-update');\n app.modal.show(LoadingModal);\n const updateState = this.lastUpdateRun.major;\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/major-update`,\n body: {\n data: {\n dryRun\n }\n }\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).catch(e => {\n app.modal.close();\n updateState.status = 'failure';\n updateState.incompatibleExtensions = e.response?.errors?.pop()?.incompatible_extensions;\n }).finally(() => {\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ControlSectionState', ControlSectionState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import app from 'flarum/admin/app';\nimport PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class ExtensionListState extends PaginatedListState {\n get type() {\n return 'external-extensions';\n }\n constructor() {\n super({\n sort: '-downloads'\n }, 1, 12);\n }\n sortMap() {\n return {\n '-createdAt': {\n sort: '-createdAt',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.latest', {}, true)\n },\n '-downloads': {\n sort: '-downloads',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.top', {}, true)\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionListState', ExtensionListState);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport QueueState from './QueueState';\nimport ControlSectionState from './ControlSectionState';\nimport ExtensionListState from './ExtensionListState';\nexport default class ExtensionManagerState {\n constructor() {\n _defineProperty(this, \"queue\", new QueueState());\n _defineProperty(this, \"control\", new ControlSectionState());\n _defineProperty(this, \"extensions\", new ExtensionListState());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionManagerState', ExtensionManagerState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Pagination');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class Label extends Component {\n view(vnode) {\n const {\n className,\n type,\n ...attrs\n } = this.attrs;\n return m(\"span\", Object.assign({\n className: classList(['Label', `Label--${this.attrs.type}`, className])\n }, attrs), vnode.children);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Label', Label);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nexport default class TaskOutputModal extends Modal {\n className() {\n return 'Modal--large QuickModal';\n }\n title() {\n return app.translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${this.attrs.task.operation()}`);\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(\"div\", {\n className: \"TaskOutputModal-data\"\n }, this.attrs.task.status() === 'failure' && m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-guessed-cause\"\n }, this.attrs.task.guessedCause() && app.translator.trans('flarum-extension-manager.admin.exceptions.guessed_cause.' + this.attrs.task.guessedCause()) || app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown'))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.command')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-command\"\n }, m(\"code\", null, \"$ composer \", this.attrs.task.command()))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.output')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-output\"\n }, m(\"code\", null, m(\"pre\", null, this.attrs.task.output()))))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/TaskOutputModal', TaskOutputModal);","import duration from 'dayjs/plugin/duration';\nexport default function humanDuration(start, end) {\n dayjs.extend(duration);\n const durationTime = dayjs(end).diff(start);\n return dayjs.duration(durationTime).humanize();\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/humanDuration', humanDuration);","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Icon from 'flarum/common/components/Icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport extractText from 'flarum/common/utils/extractText';\nimport Link from 'flarum/common/components/Link';\nimport Pagination from 'flarum/common/components/Pagination';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport TaskOutputModal from './TaskOutputModal';\nimport humanDuration from '../utils/humanDuration';\nexport default class QueueSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.queue.load();\n }\n view() {\n return m(\"section\", {\n id: \"ExtensionManager-queueSection\",\n className: \"ExtensionPage-settings ExtensionManager-queueSection\"\n }, m(\"div\", {\n className: \"ExtensionPage-permissions-header ExtensionManager-queueSection-header\"\n }, m(\"div\", {\n className: \"container\"\n }, m(\"h2\", {\n className: \"ExtensionTitle\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.title')), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.queue.load(),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.refresh'),\n disabled: app.extensionManager.control.isLoading()\n }))), m(\"div\", {\n className: \"container\"\n }, this.queueTable()));\n }\n columns() {\n const items = new ItemList();\n items.add('operation', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.operation')),\n content: task => m(\"div\", {\n className: \"ExtensionManager-queueTable-operation\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-icon\"\n }, this.operationIcon(task.operation())), m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-name\"\n }, app.translator.trans(`flarum-extension-manager.admin.sections.queue.operations.${task.operation()}`)))\n }, 80);\n items.add('package', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.package')),\n content: task => {\n const extension = app.data.extensions[task.package()?.replace(/(\\/flarum-|\\/flarum-ext-|\\/)/g, '-')];\n return extension ? m(Link, {\n className: \"ExtensionManager-queueTable-package\",\n href: app.route('extension', {\n id: extension.id\n })\n }, m(\"div\", {\n className: \"ExtensionManager-queueTable-package-icon ExtensionIcon\",\n style: extension.icon\n }, !!extension.icon && m(Icon, {\n name: extension.icon.name\n })), m(\"div\", {\n className: \"ExtensionManager-queueTable-package-details\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-package-title\"\n }, extension.extra['flarum-extension'].title), m(\"span\", {\n className: \"ExtensionManager-queueTable-package-name\"\n }, task.package()))) : task.package();\n }\n }, 75);\n items.add('status', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.status')),\n content: task => m('[', null, m(Label, {\n className: \"ExtensionManager-queueTable-status\",\n type: {\n running: 'neutral',\n failure: 'error',\n pending: 'warning',\n success: 'success'\n }[task.status()]\n }, app.translator.trans(`flarum-extension-manager.admin.sections.queue.statuses.${task.status()}`)), ['pending', 'running'].includes(task.status()) && m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }))\n }, 70);\n items.add('elapsedTime', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.elapsed_time')),\n content: task => !task.startedAt() || !task.finishedAt() ? app.translator.trans('flarum-extension-manager.admin.sections.queue.task_just_started') : m(Tooltip, {\n text: `${dayjs(task.startedAt()).format('LL LTS')} ${dayjs(task.finishedAt()).format('LL LTS')}`\n }, m(\"span\", null, humanDuration(task.startedAt(), task.finishedAt())))\n }, 65);\n items.add('memoryUsed', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.peak_memory_used')),\n content: task => m(\"span\", null, task.peakMemoryUsed())\n }, 60);\n items.add('details', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')),\n content: task => m(Button, {\n className: \"Button Button--icon Table-controls-item\",\n icon: \"fas fa-file-alt\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')\n // @todo fix in core\n // @ts-ignore\n ,\n onclick: () => app.modal.show(TaskOutputModal, {\n task\n }),\n disabled: ['pending', 'running'].includes(task.status())\n }),\n className: 'Table-controls'\n }, 55);\n return items;\n }\n queueTable() {\n const tasks = app.extensionManager.queue.getItems();\n if (!tasks) {\n return m(LoadingIndicator, null);\n }\n if (tasks && !tasks.length) {\n return m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.none'));\n }\n const columns = this.columns();\n return m('[', null, m(\"div\", {\n className: classList('Table-container', {\n 'loading-container': tasks && app.extensionManager.queue.isLoading()\n })\n }, m(\"table\", {\n className: \"Table ExtensionManager-queueTable\"\n }, m(\"thead\", null, m(\"tr\", null, columns.toArray().map((item, index) => m(\"th\", {\n key: index\n }, item.label)))), m(\"tbody\", null, tasks.map((task, index) => m(\"tr\", {\n key: index\n }, columns.toArray().map((item, index) => {\n const {\n label,\n content,\n ...attrs\n } = item;\n return m(\"td\", Object.assign({\n key: index\n }, attrs), content(task));\n }))))), tasks && app.extensionManager.queue.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n })), m(Pagination, {\n total: app.extensionManager.queue.getTotalItems(),\n currentPage: app.extensionManager.queue.pageNumber() + 1,\n perPage: app.extensionManager.queue.getPerPage(),\n onChange: page => app.extensionManager.queue.goto(page)\n }));\n }\n operationIcon(operation) {\n return m(Icon, {\n name: {\n update_check: 'fas fa-sync-alt',\n update_major: 'fas fa-play',\n update_minor: 'fas fa-play',\n update_global: 'fas fa-play',\n extension_install: 'fas fa-download',\n extension_remove: 'fas fa-times',\n extension_update: 'fas fa-arrow-alt-circle-up',\n why_not: 'fas fa-exclamation-circle'\n }[operation]\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/QueueSection', QueueSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Alert');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nexport default class Installer extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"packageName\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.packageName = Stream('');\n }\n view() {\n return m(\"div\", {\n className: \"Form-group ExtensionManager-installer\"\n }, m(\"label\", {\n htmlFor: \"install-extension\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install_help', {\n link: m(\"a\", {\n href: \"https://flarum.org/extensions\"\n }, \"flarum.org\"),\n semantic_link: m(\"a\", {\n href: \"https://devhints.io/semver\"\n }),\n code: m(\"code\", null)\n })), m(\"div\", {\n className: \"FormControl-container\"\n }, m(\"input\", {\n className: \"FormControl\",\n id: \"install-extension\",\n placeholder: \"vendor/package-name\",\n bidi: this.packageName\n }), m(Button, {\n className: \"Button\",\n icon: \"fas fa-download\",\n onclick: this.onsubmit.bind(this),\n loading: app.extensionManager.control.isLoading('extension-install'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.extensions.proceed'))));\n }\n data() {\n return {\n package: this.packageName()\n };\n }\n onsubmit() {\n app.extensionManager.control.requirePackage(this.data());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Installer', Installer);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport errorHandler from '../utils/errorHandler';\nexport default class WhyNotModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"loading\", true);\n _defineProperty(this, \"whyNot\", null);\n }\n className() {\n return 'Modal--large WhyNotModal';\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.why_not_modal.title');\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.requestWhyNot();\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, this.loading ? m(LoadingIndicator, null) : m(\"pre\", {\n className: \"WhyNotModal-contents\"\n }, this.whyNot));\n }\n requestWhyNot() {\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/extension-manager/why-not`,\n body: {\n data: {\n package: this.attrs.package\n }\n }\n }).then(response => {\n this.loading = false;\n this.whyNot = response.data.reason;\n m.redraw();\n }).catch(errorHandler);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/WhyNotModal', WhyNotModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/formatAmount');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","export let VersionStability = /*#__PURE__*/function (VersionStability) {\n VersionStability[\"Stable\"] = \"stable\";\n VersionStability[\"Alpha\"] = \"alpha\";\n VersionStability[\"Beta\"] = \"beta\";\n VersionStability[\"RC\"] = \"rc\";\n VersionStability[\"Dev\"] = \"dev\";\n return VersionStability;\n}({});\nexport function isProductionReady(version) {\n return [VersionStability.Stable, VersionStability.RC].includes(stability(version));\n}\nexport function stability(version) {\n const split = version.split('-');\n if (split.length === 1) {\n return VersionStability.Stable;\n }\n const stab = split[1].split('.')[0].toLowerCase();\n switch (stab) {\n case 'alpha':\n return VersionStability.Alpha;\n case 'beta':\n return VersionStability.Beta;\n case 'rc':\n return VersionStability.RC;\n default:\n return VersionStability.Dev;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/versions', { VersionStability: VersionStability,isProductionReady: isProductionReady,stability: stability, });","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Model from 'flarum/common/Model';\nimport app from 'flarum/admin/app';\nimport { isProductionReady } from '../utils/versions';\nexport default class ExternalExtension extends Model {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"extensionId\", Model.attribute('extensionId'));\n _defineProperty(this, \"name\", Model.attribute('name'));\n _defineProperty(this, \"title\", Model.attribute('title'));\n _defineProperty(this, \"description\", Model.attribute('description'));\n _defineProperty(this, \"iconUrl\", Model.attribute('iconUrl'));\n _defineProperty(this, \"icon\", Model.attribute('icon'));\n _defineProperty(this, \"highestVersion\", Model.attribute('highestVersion'));\n _defineProperty(this, \"httpUri\", Model.attribute('httpUri'));\n _defineProperty(this, \"discussUri\", Model.attribute('discussUri'));\n _defineProperty(this, \"vendor\", Model.attribute('vendor'));\n _defineProperty(this, \"isPremium\", Model.attribute('isPremium'));\n _defineProperty(this, \"isLocale\", Model.attribute('isLocale'));\n _defineProperty(this, \"locale\", Model.attribute('locale'));\n _defineProperty(this, \"latestFlarumVersionSupported\", Model.attribute('latestFlarumVersionSupported'));\n _defineProperty(this, \"downloads\", Model.attribute('downloads'));\n _defineProperty(this, \"installed\", false);\n }\n isSupported() {\n const currentVersion = app.data.settings.version;\n const latestCompatibleVersion = this.latestFlarumVersionSupported();\n\n // If stability is not the same, it's not compatible.\n if (currentVersion.split('-')[1] !== latestCompatibleVersion.split('-')[1]) {\n return false;\n }\n\n // Minor versions are compatible.\n return currentVersion.split('.')[0] === latestCompatibleVersion.split('.')[0];\n }\n isProductionReady() {\n return isProductionReady(this.highestVersion());\n }\n toLocalExtension() {\n return {\n id: this.extensionId(),\n name: this.name(),\n version: this.highestVersion(),\n description: this.description(),\n icon: this.icon() || {\n name: 'fas fa-box-open',\n backgroundColor: '#117187',\n color: '#fff'\n },\n links: {\n discuss: this.discussUri(),\n website: this.httpUri()\n },\n extra: {\n 'flarum-extension': {\n title: this.title()\n }\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/ExternalExtension', ExternalExtension);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Component from 'flarum/common/Component';\nimport Icon from 'flarum/common/components/Icon';\nimport Badge from 'flarum/common/components/Badge';\nimport app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport formatAmount from 'flarum/common/utils/formatAmount';\nimport ExternalExtension from '../models/ExternalExtension';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport WhyNotModal from './WhyNotModal';\nimport LinkButton from 'flarum/common/components/LinkButton';\nexport default class ExtensionCard extends Component {\n getExtension() {\n return this.attrs.extension instanceof ExternalExtension ? this.attrs.extension.toLocalExtension() : this.attrs.extension;\n }\n view() {\n const extension = this.getExtension();\n const {\n isCore,\n isDanger\n } = this.attrs;\n return m(\"div\", {\n className: classList('ExtensionCard', {\n 'ExtensionCard--core': isCore,\n 'ExtensionCard--danger': isDanger\n })\n }, m(\"div\", {\n className: \"ExtensionCard-header\"\n }, this.icon(), m(Tooltip, {\n text: extension.name\n }, m(\"h4\", null, extension.extra['flarum-extension'].title)), this.attrs.extension instanceof ExternalExtension && m(\"div\", {\n className: \"ExtensionCard-badges\"\n }, this.badges().toArray()), m(\"div\", {\n className: \"ExtensionCard-actions\"\n }, this.actionItems().toArray())), m(\"div\", {\n className: \"ExtensionCard-body\"\n }, m(\"p\", null, extension.description)), m(\"div\", {\n className: \"ExtensionCard-footer\"\n }, m(\"div\", {\n className: \"ExtensionCard-meta\"\n }, this.metaItems().toArray())));\n }\n icon() {\n const extension = this.getExtension();\n if (this.attrs.extension instanceof ExternalExtension && extension.id in app.data.extensions) {\n extension.icon = app.data.extensions[extension.id].icon;\n }\n const style = extension.icon || {};\n if (!extension.icon?.name && this.attrs.extension instanceof ExternalExtension && !(extension.id in app.data.extensions) && this.attrs.extension.iconUrl()) {\n style.backgroundImage = `url(${this.attrs.extension.iconUrl()})`;\n }\n return m(\"span\", {\n className: \"ExtensionIcon\",\n style: extension.icon\n }, extension.icon?.name ? m(Icon, {\n name: extension.icon.name\n }) : null);\n }\n badges() {\n const items = new ItemList();\n const extension = this.attrs.extension;\n if (extension.isSupported()) {\n items.add('compatible', m(Badge, {\n icon: \"fas fa-check\",\n type: \"success\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.compatible'),\n className: \"Badge--flat Badge--square\"\n }));\n } else {\n items.add('incompatible', m(Badge, {\n icon: \"fas fa-times\",\n type: \"danger\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.incompatible'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.isPremium()) {\n items.add('premium', m(Badge, {\n icon: \"fas fa-dollar-sign\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.premium'),\n className: \"ExtensionCard-badge--premium Badge--flat Badge--square\"\n }));\n }\n if (!extension.isProductionReady()) {\n items.add('unstable', m(Badge, {\n icon: \"fas fa-flask\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.unstable'),\n className: \"Badge--flat Badge--square Badge--danger\"\n }));\n }\n if (extension.name().split('/')[0] === 'fof') {\n items.add('fof', m(Badge, {\n icon: \"fas fa-users\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.fof'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.name().split('/')[0] === 'flarum') {\n items.add('flarum', m(Badge, {\n icon: \"fab fa-flarum\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.flarum'),\n className: \"ExtensionCard-badge--flarum Badge--flat Badge--square\"\n }));\n }\n return items;\n }\n metaItems() {\n const items = new ItemList();\n const {\n updates,\n isCore\n } = this.attrs;\n const latestVersion = updates ? updates['latest-minor'] ?? (updates['latest-major'] && !isCore ? updates['latest-major'] : null) : null;\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('downloads', m(\"span\", null, m(Icon, {\n name: \"fas fa-circle-down\"\n }), app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.downloads', {\n count: this.attrs.extension.downloads(),\n formattedCount: formatAmount(this.attrs.extension.downloads())\n })));\n } else {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, m(\"span\", {\n className: \"ExtensionCard-version-current\"\n }, this.version(updates['version'])), latestVersion ? m('[', null, m(Icon, {\n name: \"fas fa-arrow-right\"\n }), m(Label, {\n className: \"ExtensionCard-version-latest\",\n type: updates['latest-minor'] ? 'success' : 'warning'\n }, this.version(latestVersion))) : null));\n }\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, \"v\", this.version(this.attrs.extension.highestVersion())));\n items.add('link', m(LinkButton, {\n className: \"Button Button--ua-reset Button--link Button--icon\",\n href: this.attrs.extension.httpUri(),\n target: \"_blank\",\n icon: \"fas fa-external-link-alt\",\n external: true\n }));\n }\n return items;\n }\n actionItems() {\n const items = new ItemList();\n const {\n updates,\n extension,\n onClickUpdate,\n whyNotWarning\n } = this.attrs;\n if (extension instanceof ExternalExtension) {\n if (!(extension.extensionId() in app.data.extensions)) {\n items.add('install', m(Button, {\n className: \"Button Button--icon Button--flat\",\n icon: \"fas fa-cloud-arrow-down\",\n onclick: () => {\n app.extensionManager.control.requirePackage({\n package: extension.name()\n });\n }\n }));\n } else {\n items.add('installed', m(Button, {\n className: \"Button Button--icon Button--flat Button--success\",\n icon: \"fas fa-check-circle\",\n disabled: true\n }));\n }\n } else {\n if (onClickUpdate && typeof onClickUpdate === 'function') {\n items.add('update', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n className: \"Button Button--icon Button--flat\",\n onclick: onClickUpdate,\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.update')\n })));\n } else if (onClickUpdate) {\n items.add('update', m(Dropdown, {\n buttonClassName: \"Button Button--icon Button--flat\",\n icon: \"fas fa-ellipsis\",\n label: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n onclick: onClickUpdate.soft\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_soft_label')), m(Button, {\n icon: \"fas fa-rotate\",\n onclick: onClickUpdate.hard,\n disabled: !updates['direct-dependency']\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_hard_label'))));\n }\n if (whyNotWarning) items.add('whyNot', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n }, m(Button, {\n icon: \"fas fa-exclamation-circle\",\n className: \"Button Button--icon Button--flat Button--danger\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: extension.name\n }),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n })));\n }\n return items;\n }\n version(v) {\n return v.charAt(0) === 'v' ? v.substring(1) : v;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ExtensionCard', ExtensionCard);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Alert from 'flarum/common/components/Alert';\nimport WhyNotModal from './WhyNotModal';\nimport ExtensionCard from './ExtensionCard';\nimport classList from 'flarum/common/utils/classList';\nexport default class MajorUpdater extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"updateState\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.updateState = this.attrs.updateState;\n }\n view() {\n return m(\"div\", {\n className: classList('Form-group Form-group--danger ExtensionManager-majorUpdate', {\n 'ExtensionManager-majorUpdate--failed': this.updateState.status === 'failure',\n 'ExtensionManager-majorUpdate--incompatibleExtensions': this.updateState.incompatibleExtensions.length\n })\n }, m(\"img\", {\n alt: \"flarum logo\",\n src: app.forum.attribute('baseUrl') + '/assets/extensions/flarum-extension-manager/flarum.svg'\n }), m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.major_updater.title', {\n version: this.attrs.coreUpdate['latest-major']\n })), m(\"p\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.description')), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run_help')\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-vial\",\n onclick: this.update.bind(this, true),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run'))), m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-play\",\n onclick: this.update.bind(this, false),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.update'))), this.updateState.incompatibleExtensions.length ? m(\"div\", {\n className: \"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid\"\n }, this.updateState.incompatibleExtensions.map(extension => m(ExtensionCard, {\n extension: app.data.extensions[extension.replace('flarum-', '').replace('flarum-ext-', '').replace('/', '-')],\n updates: {},\n onClickUpdate: null,\n isDanger: true\n }))) : null, this.updateState.status === 'failure' ? m(Alert, {\n type: \"error\",\n className: \"ExtensionManager-majorUpdate-failure\",\n dismissible: false,\n controls: [m(Button, {\n className: \"Button Button--text ExtensionManager-majorUpdate-failure-details\",\n icon: \"fas fa-question-circle\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: 'flarum/core'\n })\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.why'))]\n }, m(\"p\", {\n className: \"ExtensionManager-majorUpdate-failure-desc\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.desc'))) : null);\n }\n update(dryRun) {\n app.extensionManager.control.majorUpdate({\n dryRun\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/MajorUpdater', MajorUpdater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/InfoTile');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MajorUpdater from './MajorUpdater';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport ExtensionCard from './ExtensionCard';\nimport { isProductionReady } from '../utils/versions';\nexport default class Updater extends Component {\n view() {\n const core = app.extensionManager.control.coreUpdate;\n return [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.updater.updater_title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.updater_help')), this.lastUpdateCheckView(), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, this.controlItems().toArray()), this.availableUpdatesView()), core && core.package['latest-major'] && isProductionReady(core.package['latest-major']) ? m(MajorUpdater, {\n coreUpdate: core.package,\n updateState: app.extensionManager.control.lastUpdateRun.major\n }) : null];\n }\n lastUpdateCheckView() {\n return app.extensionManager.control.lastUpdateCheck?.checkedAt && m(\"p\", {\n className: \"ExtensionManager-lastUpdatedAt\"\n }, m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-label\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.last_update_checked_at')), m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-value\"\n }, humanTime(app.extensionManager.control.lastUpdateCheck.checkedAt))) || null;\n }\n availableUpdatesView() {\n const state = app.extensionManager.control;\n if (app.extensionManager.control.isLoading('check') || app.extensionManager.control.isLoading('global-update')) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(LoadingIndicator, null));\n }\n const hasMinorCoreUpdate = state.coreUpdate && state.coreUpdate.package['latest-minor'];\n if (!(state.extensionUpdates.length || hasMinorCoreUpdate)) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions ExtensionManager-extensions--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-check\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.up_to_date')));\n }\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(\"div\", {\n className: \"ExtensionManager-extensions-grid\"\n }, hasMinorCoreUpdate ? m(ExtensionCard, {\n extension: state.coreUpdate.extension,\n updates: state.coreUpdate.package,\n isCore: true,\n onClickUpdate: () => state.updateCoreMinor(),\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes('flarum/core')\n }) : null, state.extensionUpdates.map(extension => m(ExtensionCard, {\n extension: extension,\n updates: state.packageUpdates[extension.id],\n onClickUpdate: {\n soft: () => state.updateExtension(extension, 'soft'),\n hard: () => state.updateExtension(extension, 'hard')\n },\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes(extension.name)\n }))));\n }\n controlItems() {\n const items = new ItemList();\n items.add('updateCheck', m(Button, {\n className: \"Button\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.control.checkForUpdates(),\n loading: app.extensionManager.control.isLoading('check'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.check_for_updates')), 100);\n items.add('globalUpdate', m(Button, {\n className: \"Button\",\n icon: \"fas fa-play\",\n onclick: () => app.extensionManager.control.updateGlobally(),\n loading: app.extensionManager.control.isLoading('global-update'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.run_global_update')));\n return items;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Updater', Updater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Installer from './Installer';\nimport Updater from './Updater';\nimport Form from 'flarum/common/components/Form';\nexport default class ControlSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-controlSection\"\n }, m(\"div\", {\n className: \"container\"\n }, app.data['flarum-extension-manager.writable_dirs'] ? m(Form, null, m(Installer, null), m(Updater, null)) : m(\"div\", {\n className: \"Form-group\"\n }, m(Alert, {\n type: \"warning\",\n dismissible: false\n }, app.translator.trans('flarum-extension-manager.admin.file_permissions')))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ControlSection', ControlSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport FormGroup from 'flarum/common/components/FormGroup';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nexport default class ConfigureJson extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"settings\", {});\n _defineProperty(this, \"initialSettings\", null);\n _defineProperty(this, \"loading\", false);\n _defineProperty(this, \"type\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.submit(true);\n }\n className() {\n return '';\n }\n view() {\n return m(\"div\", {\n className: classList('FormSection', this.className())\n }, m(\"label\", null, this.title()), this.content(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton()));\n }\n submitButton() {\n return [m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n onclick: () => this.submit(false),\n disabled: !this.isDirty()\n }, app.translator.trans('core.admin.settings.submit_button'))];\n }\n customSettingComponents() {\n return FormGroup.prototype.customFieldComponents();\n }\n setting(key) {\n return this.settings[key] ?? (this.settings[key] = Stream());\n }\n submit(readOnly) {\n this.loading = true;\n const configuration = {};\n Object.keys(this.settings).forEach(key => {\n configuration[key] = this.settings[key]();\n });\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/extension-manager/composer',\n body: {\n type: this.type,\n data: readOnly ? null : configuration\n }\n }).then(_ref => {\n let {\n data\n } = _ref;\n Object.keys(data).forEach(key => {\n this.settings[key] = Stream(data[key]);\n });\n this.initialSettings = Array.isArray(data) ? {} : data;\n }).finally(() => {\n this.loading = false;\n m.redraw();\n });\n }\n isDirty() {\n return JSON.stringify(this.initialSettings) !== JSON.stringify(this.settings);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureJson', ConfigureJson);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Select');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport Form from 'flarum/common/components/Form';\nexport default class RepositoryModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"repository\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.name = Stream(this.attrs.name || '');\n this.repository = Stream(this.attrs.repository || {\n type: 'composer',\n url: ''\n });\n }\n className() {\n return 'RepositoryModal Modal--small';\n }\n title() {\n const context = this.attrs.repository ? 'edit' : 'add';\n return app.translator.trans(`flarum-extension-manager.admin.composer.${context}_repository_label`);\n }\n content() {\n const types = {\n composer: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.composer'),\n vcs: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.vcs'),\n path: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.path')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.name_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.name\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.type_label')), m(Select, {\n options: types,\n value: this.repository().type,\n onchange: value => this.repository({\n ...this.repository(),\n type: value\n })\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.url')), m(\"input\", {\n className: \"FormControl\",\n onchange: e => this.repository({\n ...this.repository(),\n url: e.target.value\n }),\n value: this.repository().url\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.repository(), this.name());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/RepositoryModal', RepositoryModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport RepositoryModal from './RepositoryModal';\nexport default class ConfigureComposer extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'composer');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.composer.title');\n }\n className() {\n return 'ConfigureComposer';\n }\n content() {\n return m(\"div\", {\n className: \"Form ExtensionManager-SettingsGroups-content\"\n }, this.attrs.buildSettingComponent.call(this, {\n setting: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label'),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help'),\n type: 'select',\n options: {\n stable: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.stable'),\n RC: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.rc'),\n beta: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.beta'),\n alpha: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.alpha'),\n dev: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.dev')\n }\n }), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.help')), m(\"div\", {\n className: \"ConfigureComposer-repositories\"\n }, Object.keys(this.setting('repositories')() || {}).map(name => {\n const repository = this.setting('repositories')()[name];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: {\n composer: 'fas fa-cubes',\n vcs: 'fas fa-code-branch',\n path: 'fas fa-folder'\n }[repository.type],\n onclick: () => app.modal.show(RepositoryModal, {\n name,\n repository,\n onsubmit: (repository, newName) => {\n const repositories = this.setting('repositories')();\n delete repositories[name];\n this.setting('repositories')(repositories);\n this.onchange(repository, newName);\n }\n })\n }, name, \" (\", repository.type, \")\"), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_confirmation')))) {\n const repositories = {\n ...this.setting('repositories')()\n };\n delete repositories[name];\n this.setting('repositories')(repositories);\n }\n }\n }));\n }))));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(RepositoryModal, {\n onsubmit: this.onchange.bind(this)\n })\n }, app.translator.trans('flarum-extension-manager.admin.composer.add_repository_label')));\n return items;\n }\n onchange(repository, name) {\n this.setting('repositories')({\n ...this.setting('repositories')(),\n [name]: repository\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureComposer', ConfigureComposer);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nexport default class AuthMethodModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", void 0);\n _defineProperty(this, \"host\", void 0);\n _defineProperty(this, \"token\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.type = Stream(this.attrs.type || 'bearer');\n this.host = Stream(this.attrs.host || '');\n this.token = Stream(this.attrs.token || '');\n }\n className() {\n return 'AuthMethodModal Modal--small';\n }\n title() {\n const context = this.attrs.host ? 'edit' : 'add';\n return app.translator.trans(`flarum-extension-manager.admin.auth_config.${context}_label`);\n }\n content() {\n const types = {\n 'github-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.github-oauth'),\n 'gitlab-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-oauth'),\n 'gitlab-token': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-token'),\n bearer: app.translator.trans('flarum-extension-manager.admin.auth_config.types.bearer')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.type_label')), m(Select, {\n options: types,\n value: this.type(),\n onchange: this.type\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.host,\n placeholder: app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_placeholder')\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.token_label')), m(\"textarea\", {\n className: \"FormControl\",\n oninput: e => this.token(e.target.value),\n rows: \"6\",\n placeholder: this.token().startsWith('unchanged:') ? extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder')) : ''\n }, this.token().startsWith('unchanged:') ? '' : this.token())), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.type(), this.host(), this.token());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/AuthMethodModal', AuthMethodModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport AuthMethodModal from './AuthMethodModal';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ConfigureAuth extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'auth');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.auth_config.title');\n }\n className() {\n return 'ConfigureAuth';\n }\n content() {\n const authSettings = Object.keys(this.settings);\n const hasAuthSettings = authSettings.length && authSettings.every(type => {\n const data = this.settings[type]();\n return Array.isArray(data) ? data.length : Object.keys(data).length;\n });\n return m(\"div\", {\n className: \"ExtensionManager-SettingsGroups-content\"\n }, hasAuthSettings ? authSettings.map(type => {\n const hosts = this.settings[type]();\n return m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans(`flarum-extension-manager.admin.auth_config.types.${type}`)), m(\"div\", {\n className: \"ConfigureAuth-hosts\"\n }, Object.keys(hosts).map(host => {\n const data = hosts[host];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-key\",\n onclick: () => app.modal.show(AuthMethodModal, {\n type,\n host,\n token: data,\n onsubmit: this.onchange.bind(this, host)\n })\n }, host), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.auth_config.delete_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.delete_confirmation')))) {\n const newType = {\n ...this.setting(type)()\n };\n delete newType[host];\n if (Object.keys(newType).length) {\n this.setting(type)(newType);\n } else {\n delete this.settings[type];\n }\n }\n }\n }));\n })));\n }) : m(\"span\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.no_auth_methods_configured')));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n loading: this.loading,\n onclick: () => app.modal.show(AuthMethodModal, {\n onsubmit: this.onchange.bind(this, null)\n })\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_label')));\n return items;\n }\n onchange(oldHost, type, host, token) {\n const data = {\n ...this.setting(type)()\n };\n if (oldHost) {\n delete data[oldHost];\n }\n data[host] = token;\n this.setting(type)(data);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureAuth', ConfigureAuth);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Input');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/listItems');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Form from 'flarum/common/components/Form';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Input from 'flarum/common/components/Input';\nimport Stream from 'flarum/common/utils/Stream';\nimport Alert from 'flarum/common/components/Alert';\nimport listItems from 'flarum/common/helpers/listItems';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ExtensionCard from './ExtensionCard';\nimport Pagination from 'flarum/common/components/Pagination';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport classList from 'flarum/common/utils/classList';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nexport default class DiscoverSection extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"search\", Stream(''));\n _defineProperty(this, \"warningsDismissed\", Stream(false));\n _defineProperty(this, \"applySearch\", throttle(1200, value => {\n const params = app.extensionManager.extensions.getParams();\n app.extensionManager.extensions.refreshParams({\n ...params,\n filter: {\n ...params.filter,\n q: value\n }\n }, 1);\n }));\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.extensions.goto(1);\n this.warningsDismissed(localStorage.getItem('flarum-extension-manager.warningsDismissed') === 'true');\n }\n load(page) {\n if (page === void 0) {\n page = 1;\n }\n app.extensionManager.extensions.goto(page);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-DiscoverSection\"\n }, m(\"div\", {\n className: \"container\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.discover.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.description'), this.warningsDismissed() && m(Button, {\n className: \"Button Button--text Button--warning Button--more\",\n icon: \"fas fa-exclamation-triangle\",\n onclick: () => this.setWarningDismissed(false)\n }))), !this.warningsDismissed() && m(\"div\", {\n className: \"ExtensionManager-warnings Form-group\"\n }, m(Alert, {\n className: \"ExtensionManager-primaryWarning\",\n type: \"warning\",\n dismissible: true,\n ondismiss: () => this.setWarningDismissed(true)\n }, m(\"ul\", null, listItems(this.warningItems().toArray())))), m(\"div\", {\n className: \"Tabs\"\n }, m(\"div\", {\n className: \"Tabs-nav\"\n }, this.tabItems().toArray()), m(\"div\", {\n className: \"Tabs-content\"\n }, m(\"hr\", {\n className: \"Tabs-divider\"\n }), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar\"\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-primary\"\n }, this.toolbarPrimaryItems().toArray()), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-secondary\"\n }, this.toolbarSecondaryItems().toArray())), this.extensionList(), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-footer\"\n }, this.footerItems().toArray()))))));\n }\n tabFilters() {\n return {\n '': {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.discover'),\n active: () => !app.extensionManager.extensions.getParams().filter?.type\n },\n extension: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.extensions'),\n active: () => app.extensionManager.extensions.getParams().filter?.type === 'extension'\n },\n locale: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.languages'),\n active: () => app.extensionManager.extensions.getParams().filter?.type === 'locale'\n },\n theme: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.themes'),\n active: () => app.extensionManager.extensions.getParams().filter?.type === 'theme'\n }\n };\n }\n tabItems() {\n const items = new ItemList();\n const tabs = this.tabFilters();\n Object.keys(tabs).forEach(key => {\n const tab = tabs[key];\n items.add(key, m(Button, {\n className: \"Button Button--link\",\n active: tab.active(),\n onclick: () => {\n app.extensionManager.extensions.changeFilter('type', key);\n }\n }, tab.label));\n });\n return items;\n }\n warningItems() {\n const items = new ItemList();\n items.add('accessWarning', app.translator.trans('flarum-extension-manager.admin.settings.access_warning'));\n if (app.data.debugEnabled) {\n items.add('devModeWarning', app.translator.trans('flarum-extension-manager.admin.settings.debug_mode_warning'));\n }\n return items;\n }\n toolbarPrimaryItems() {\n const items = new ItemList();\n items.add('search', m(Input, {\n value: this.search(),\n onchange: value => {\n this.search(value);\n this.applySearch(value);\n },\n inputAttrs: {\n className: 'FormControl-alt'\n },\n clearable: true,\n placeholder: app.translator.trans('flarum-extension-manager.admin.sections.discover.search'),\n prefixIcon: \"fas fa-search\"\n }));\n return items;\n }\n toolbarSecondaryItems() {\n const items = new ItemList();\n const sortMap = app.extensionManager.extensions.sortMap();\n const sortOptions = Object.keys(sortMap).reduce((acc, sortId) => {\n const sort = sortMap[sortId];\n acc[sortId] = typeof sort !== 'string' ? sort.label : sort;\n return acc;\n }, {});\n items.add('sort', m(Dropdown, {\n buttonClassName: \"Button\",\n label: sortOptions[app.extensionManager.extensions.getParams().sort] || Object.keys(sortMap).map(key => sortOptions[key])[0],\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label')\n }, Object.keys(sortOptions).map(value => {\n const label = sortOptions[value];\n const active = app.extensionManager.extensions.getParams().sort === value;\n return m(Button, {\n icon: active ? 'fas fa-check' : true,\n onclick: () => app.extensionManager.extensions.changeSort(value),\n active: active\n }, label);\n })));\n const is = app.extensionManager.extensions.getParams().filter?.is?.[0] ?? null;\n const activeType = is || 'all';\n items.add('party', m(Dropdown, {\n buttonClassName: \"Button\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + activeType),\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label')\n }, ['all', 'premium'].map(party => m(Button, {\n icon: activeType === party ? 'fas fa-check' : true,\n onclick: () => {\n app.extensionManager.extensions.changeFilter('is', party === 'all' ? undefined : [party]);\n },\n active: activeType === party\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + party)))));\n return items;\n }\n extensionList() {\n if (!app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading()) {\n return m(LoadingIndicator, {\n display: \"block\"\n });\n }\n if (!app.extensionManager.extensions.hasItems()) {\n return m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-exclamation\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.empty_results')));\n }\n return m(\"div\", {\n className: classList('ExtensionManager-DiscoverSection-list', {\n 'loading-container': app.extensionManager.extensions.isLoading()\n })\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list-inner\"\n }, app.extensionManager.extensions.getPages().map(page => page.items.map(extension => m(ExtensionCard, {\n extension: extension,\n key: extension.name()\n })))), app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n }));\n }\n footerItems() {\n const items = new ItemList();\n items.add('pagination', m(Pagination, {\n total: app.extensionManager.extensions.totalItems,\n perPage: app.extensionManager.extensions.pageSize,\n currentPage: app.extensionManager.extensions.getLocation().page,\n onChange: page => {\n const current = app.extensionManager.extensions.getLocation().page;\n if (current === page) {\n return;\n }\n this.load(page);\n }\n }));\n items.add('premiumTermsLink', m(LinkButton, {\n className: \"Button Button--link\",\n href: \"https://flarum.org/terms/premium-extensions\",\n external: true,\n target: \"_blank\",\n icon: \"fas fa-circle-info\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.premium_extension_terms')));\n return items;\n }\n setWarningDismissed(dismissed) {\n this.warningsDismissed(dismissed);\n localStorage.setItem('flarum-extension-manager.warningsDismissed', dismissed ? 'true' : 'false');\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/DiscoverSection', DiscoverSection);","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport QueueSection from './QueueSection';\nimport ControlSection from './ControlSection';\nimport ConfigureComposer from './ConfigureComposer';\nimport ConfigureAuth from './ConfigureAuth';\nimport DiscoverSection from './DiscoverSection';\nexport default class SettingsPage extends ExtensionPage {\n content() {\n const settings = app.registry.getSettings(this.extension.id);\n return m(\"div\", {\n className: \"ExtensionPage-settings\"\n }, m(\"div\", {\n className: \"container\"\n }, settings ? [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.settings.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.settings.description'))), m(\"div\", {\n className: \"FormSectionGroup ExtensionManager-SettingsGroups\"\n }, m(\"div\", {\n className: \"FormSection\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.settings.title')), m(\"div\", {\n className: \"Form\"\n }, settings.map(this.buildSettingComponent.bind(this))), m(\"div\", {\n className: \"Form-group Form--controls\"\n }, this.submitButton())), m(ConfigureComposer, {\n buildSettingComponent: this.buildSettingComponent\n }), m(ConfigureAuth, {\n buildSettingComponent: this.buildSettingComponent\n }))] : m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('core.admin.extension.no_settings'))));\n }\n sections(vnode) {\n const items = super.sections(vnode);\n items.add('discover', m(DiscoverSection, null), 15);\n items.add('control', m(ControlSection, null), 10);\n items.setPriority('content', 8);\n if (app.data.settings['flarum-extension-manager.queue_jobs'] !== '0' && app.data.settings['flarum-extension-manager.queue_jobs']) {\n items.add('queue', m(QueueSection, null), 5);\n }\n items.remove('permissions');\n return items;\n }\n onsaved() {\n super.onsaved();\n m.redraw();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/SettingsPage', SettingsPage);","const BYTE_UNITS = [\n\t'B',\n\t'kB',\n\t'MB',\n\t'GB',\n\t'TB',\n\t'PB',\n\t'EB',\n\t'ZB',\n\t'YB',\n];\n\nconst BIBYTE_UNITS = [\n\t'B',\n\t'KiB',\n\t'MiB',\n\t'GiB',\n\t'TiB',\n\t'PiB',\n\t'EiB',\n\t'ZiB',\n\t'YiB',\n];\n\nconst BIT_UNITS = [\n\t'b',\n\t'kbit',\n\t'Mbit',\n\t'Gbit',\n\t'Tbit',\n\t'Pbit',\n\t'Ebit',\n\t'Zbit',\n\t'Ybit',\n];\n\nconst BIBIT_UNITS = [\n\t'b',\n\t'kibit',\n\t'Mibit',\n\t'Gibit',\n\t'Tibit',\n\t'Pibit',\n\t'Eibit',\n\t'Zibit',\n\t'Yibit',\n];\n\n/*\nFormats the given number using `Number#toLocaleString`.\n- If locale is a string, the value is expected to be a locale-key (for example: `de`).\n- If locale is true, the system default locale is used for translation.\n- If no value for locale is specified, the number is returned unmodified.\n*/\nconst toLocaleString = (number, locale, options) => {\n\tlet result = number;\n\tif (typeof locale === 'string' || Array.isArray(locale)) {\n\t\tresult = number.toLocaleString(locale, options);\n\t} else if (locale === true || options !== undefined) {\n\t\tresult = number.toLocaleString(undefined, options);\n\t}\n\n\treturn result;\n};\n\nexport default function prettyBytes(number, options) {\n\tif (!Number.isFinite(number)) {\n\t\tthrow new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);\n\t}\n\n\toptions = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\tspace: true,\n\t\t...options,\n\t};\n\n\tconst UNITS = options.bits\n\t\t? (options.binary ? BIBIT_UNITS : BIT_UNITS)\n\t\t: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);\n\n\tconst separator = options.space ? ' ' : '';\n\n\tif (options.signed && number === 0) {\n\t\treturn ` 0${separator}${UNITS[0]}`;\n\t}\n\n\tconst isNegative = number < 0;\n\tconst prefix = isNegative ? '-' : (options.signed ? '+' : '');\n\n\tif (isNegative) {\n\t\tnumber = -number;\n\t}\n\n\tlet localeOptions;\n\n\tif (options.minimumFractionDigits !== undefined) {\n\t\tlocaleOptions = {minimumFractionDigits: options.minimumFractionDigits};\n\t}\n\n\tif (options.maximumFractionDigits !== undefined) {\n\t\tlocaleOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};\n\t}\n\n\tif (number < 1) {\n\t\tconst numberString = toLocaleString(number, options.locale, localeOptions);\n\t\treturn prefix + numberString + separator + UNITS[0];\n\t}\n\n\tconst exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);\n\tnumber /= (options.binary ? 1024 : 1000) ** exponent;\n\n\tif (!localeOptions) {\n\t\tnumber = number.toPrecision(3);\n\t}\n\n\tconst numberString = toLocaleString(Number(number), options.locale, localeOptions);\n\n\tconst unit = UNITS[exponent];\n\n\treturn prefix + numberString + separator + unit;\n}\n","import Model from 'flarum/common/Model';\nimport prettyBytes from 'pretty-bytes';\nexport default class Task extends Model {\n status() {\n return Model.attribute('status').call(this);\n }\n operation() {\n return Model.attribute('operation').call(this);\n }\n command() {\n return Model.attribute('command').call(this);\n }\n package() {\n return Model.attribute('package').call(this);\n }\n output() {\n return Model.attribute('output').call(this);\n }\n guessedCause() {\n return Model.attribute('guessedCause').call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n startedAt() {\n return Model.attribute('startedAt', Model.transformDate).call(this);\n }\n finishedAt() {\n return Model.attribute('finishedAt', Model.transformDate).call(this);\n }\n peakMemoryUsed() {\n return prettyBytes(Model.attribute('peakMemoryUsed').call(this) * 1024);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/Task', Task);","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nimport SettingsPage from './components/SettingsPage';\nimport Task from './models/Task';\nimport ExternalExtension from './models/ExternalExtension';\nexport default [new Extend.Store() //\n.add('extension-manager-tasks', Task).add('external-extensions', ExternalExtension), new Extend.Admin().setting(() => ({\n setting: 'flarum-extension-manager.queue_jobs',\n label: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs'),\n help: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs_help', {\n basic_impl_link: m(\"a\", {\n href: \"https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting\"\n }),\n adv_impl_link: m(\"a\", {\n href: \"https://discuss.flarum.org/d/21873-redis-sessions-cache-queues\"\n }),\n php_version: m(\"strong\", null, app.data.phpVersion),\n folder_perms_link: m(\"a\", {\n href: \"https://docs.flarum.org/install#folder-ownership\"\n })\n }),\n type: 'boolean',\n disabled: app.data['flarum-extension-manager.using_sync_queue']\n})).setting(() => ({\n setting: 'flarum-extension-manager.task_retention_days',\n label: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days'),\n help: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days_help'),\n type: 'number'\n})).page(SettingsPage).generalIndexItems('settings', () => [{\n id: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help', {}, true)\n}, {\n id: 'repositories',\n label: app.translator.trans('flarum-extension-manager.admin.composer.repositories.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.repositories.help', {}, true)\n}, {\n id: 'composer-auth',\n label: app.translator.trans('flarum-extension-manager.admin.auth_config.title', {}, true)\n}, {\n id: 'updates',\n label: app.translator.trans('flarum-extension-manager.admin.updater.updater_title', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.updater.updater_help', {}, true)\n}])];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport isExtensionEnabled from 'flarum/admin/utils/isExtensionEnabled';\nimport jumpToQueue from './utils/jumpToQueue';\nimport ExtensionManagerState from './states/ExtensionManagerState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-extension-manager', app => {\n app.extensionManager = new ExtensionManagerState();\n if (app.data['flarum-extension-manager.using_sync_queue']) {\n app.data.settings['flarum-extension-manager.queue_jobs'] = '0';\n }\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'flarum-extension-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n items.add('remove', m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-times\",\n onclick: () => {\n app.modal.show(LoadingModal);\n app.request({\n url: `${app.forum.attribute('apiUrl')}/extension-manager/extensions/${this.extension.id}`,\n method: 'DELETE'\n }).then(response => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n }\n }).finally(() => {\n app.modal.close();\n });\n }\n }, app.translator.trans('flarum-extension-manager.admin.extensions.remove')));\n });\n});"],"names":["module","exports","t","s","n","i","e","r","o","u","d","a","h","years","months","days","hours","minutes","seconds","milliseconds","weeks","c","g","f","$l","m","p","l","$","Math","ceil","floor","y","abs","v","negative","format","this","$d","$ms","parseFromMilliseconds","Object","keys","forEach","calMilliseconds","match","slice","map","Number","prototype","reduce","toISOString","round","toJSON","Y","YY","YYYY","M","MM","D","DD","H","HH","mm","ss","SSS","replace","String","as","get","add","subtract","locale","clone","humanize","fromNow","valueOf","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","$utils","duration","isDuration","bind","__webpack_module_cache__","__webpack_require__","moduleId","flarum","reg","_webpack_runtimes","cachedModule","undefined","__webpack_modules__","call","getter","__esModule","definition","key","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","jumpToQueue","close","route","set","id","queue","load","setTimeout","document","getElementById","scrollIntoView","block","_typeof","iterator","constructor","_defineProperty","toPrimitive","TypeError","toPropertyKey","configurable","writable","window","QueueState","params","actionTaken","loading","page","limit","offset","find","then","data","tasks","total","payload","meta","redraw","pendingTask","task","status","pollQueue","control","setLoading","location","reload","isLoading","getItems","getTotalItems","getTotalPages","pageNumber","getPerPage","hasPrev","hasNext","prev","next","goto","polling","clearTimeout","hasPending","error","response","errors","includes","code","clear","guessed_cause","show","type","trans","ControlSectionState","lastUpdateRun","JSON","parse","settings","limitedPackages","major","minor","global","lastUpdateCheck","extensionUpdates","formatExtensionUpdates","coreUpdate","formatCoreUpdate","name","hasOperationRunning","requirePackage","method","url","attribute","body","processing","extensionId","extension","href","catch","errorHandler","finally","checkForUpdates","updateCoreMinor","confirm","updateExtension","updateMode","extra","title","updateGlobally","packageUpdates","updates","installed","filter","composerPackage","extensions","safeToUpdate","values","core","pop","package","version","icon","backgroundImage","resources","links","majorUpdate","_ref","dryRun","updateState","incompatibleExtensions","incompatible_extensions","ExtensionListState","super","sort","sortMap","label","ExtensionManagerState","Label","view","vnode","className","attrs","assign","children","TaskOutputModal","operation","content","guessedCause","command","output","humanDuration","start","end","dayjs","extend","durationTime","diff","QueueSection","oninit","onclick","disabled","queueTable","columns","items","operationIcon","style","running","failure","pending","success","size","display","startedAt","finishedAt","text","peakMemoryUsed","length","toArray","item","index","currentPage","perPage","onChange","update_check","update_major","update_minor","update_global","extension_install","extension_remove","extension_update","why_not","Installer","arguments","packageName","htmlFor","link","semantic_link","placeholder","bidi","onsubmit","WhyNotModal","oncreate","requestWhyNot","whyNot","reason","VersionStability","isProductionReady","Stable","RC","stability","split","toLowerCase","Alpha","Beta","Dev","ExternalExtension","isSupported","currentVersion","latestCompatibleVersion","latestFlarumVersionSupported","highestVersion","toLocalExtension","description","backgroundColor","color","discuss","discussUri","website","httpUri","ExtensionCard","getExtension","isCore","isDanger","badges","actionItems","metaItems","iconUrl","isPremium","latestVersion","count","downloads","formattedCount","target","external","onClickUpdate","whyNotWarning","buttonClassName","soft","hard","charAt","substring","MajorUpdater","alt","src","update","dismissible","controls","Updater","lastUpdateCheckView","controlItems","availableUpdatesView","checkedAt","state","hasMinorCoreUpdate","ControlSection","ConfigureJson","submit","submitButton","isDirty","customSettingComponents","customFieldComponents","setting","readOnly","configuration","initialSettings","Array","isArray","stringify","RepositoryModal","repository","context","types","composer","vcs","path","options","onchange","hide","ConfigureComposer","buildSettingComponent","help","stable","beta","alpha","dev","newName","repositories","push","AuthMethodModal","host","token","bearer","oninput","rows","startsWith","ConfigureAuth","authSettings","hasAuthSettings","every","hosts","newType","oldHost","DiscoverSection","throttle","getParams","refreshParams","q","warningsDismissed","localStorage","getItem","setWarningDismissed","ondismiss","warningItems","tabItems","toolbarPrimaryItems","toolbarSecondaryItems","extensionList","footerItems","tabFilters","active","theme","tabs","tab","changeFilter","debugEnabled","search","applySearch","inputAttrs","clearable","prefixIcon","sortOptions","acc","sortId","accessibleToggleLabel","changeSort","activeType","is","party","hasItems","getPages","totalItems","pageSize","getLocation","dismissed","setItem","SettingsPage","getSettings","sections","setPriority","remove","onsaved","BYTE_UNITS","BIBYTE_UNITS","BIT_UNITS","BIBIT_UNITS","toLocaleString","number","result","Task","createdAt","isFinite","UNITS","bits","binary","space","separator","signed","isNegative","prefix","localeOptions","minimumFractionDigits","maximumFractionDigits","exponent","min","log","log10","toPrecision","prettyBytes","basic_impl_link","adv_impl_link","php_version","phpVersion","folder_perms_link","generalIndexItems","app","extensionManager","modal","request","forum","alerts","translator"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/statistics/js/dist/admin.js b/extensions/statistics/js/dist/admin.js index 628a0cc72a..49f0a62afa 100644 --- a/extensions/statistics/js/dist/admin.js +++ b/extensions/statistics/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,i="millisecond",n="second",s="minute",a="hour",r="day",o="week",l="month",u="quarter",c="year",h="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},v=function(t,e,i){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(i)+t},g={s:v,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),n=Math.floor(i/60),s=i%60;return(e<=0?"+":"-")+v(n,2,"0")+":"+v(s,2,"0")},m:function t(e,i){if(e.date()1)return t(r[0])}else{var o=e.name;b[o]=e,s=o}return!n&&s&&(y=s),s||!n&&y},D=function(t,e){if(k(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new P(i)},M=g;M.l=w,M.i=k,M.w=function(t,e){return D(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var P=function(){function m(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[x]=!0}var v=m.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(f);if(n){var s=n[2]-1||0,a=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return M},v.isValid=function(){return!(this.$d.toString()===d)},v.isSame=function(t,e){var i=D(t);return this.startOf(e)<=i&&i<=this.endOf(e)},v.isAfter=function(t,e){return D(t)3&&void 0!==arguments[3]&&arguments[3];i||(i=n?t[0]:t[t.length-1]);var s=new Array(Math.abs(e)).fill(i);return n?s.concat(t):t.concat(s)}function l(t,e){return(t+"").length*e}function u(t,e){return{x:Math.sin(t*ht)*e,y:Math.cos(t*ht)*e}}function c(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(Number.isNaN(t)||void 0===t||!Number.isFinite(t)||e&&t<0)}function h(t){var e=void 0,i=void 0,n=void 0;if(t instanceof Date)return new Date(t.getTime());if("object"!==(void 0===t?"undefined":Z(t))||null===t)return t;for(n in e=Array.isArray(t)?[]:{},t)i=t[n],e[n]=h(i);return e}function d(t,e){var i=void 0,n=void 0;return t<=e?(i=e-t,n=t):(i=t-e,n=e),[i,n]}function f(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-t.length;return i>0?t=o(t,i):e=o(e,i),[t,e]}function p(t,e){if(t)return t.length>e?t.slice(0,e-3)+"...":t}function m(t,e){for(var i=[],n=0;n255?255:t<0?0:t}function g(t,e){var i=pt(t),n=!1;"#"==i[0]&&(i=i.slice(1),n=!0);var s=parseInt(i,16),a=v((s>>16)+e),r=v((s>>8&255)+e);return(n?"#":"")+(v((255&s)+e)|r<<8|a<<16).toString(16)}function y(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function b(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg",t);for(var n in e){var s=e[n];if("inside"===n)y(s).appendChild(i);else if("around"===n){var a=y(s);a.parentNode.insertBefore(i,a),i.appendChild(a)}else"styles"===n?"object"===(void 0===s?"undefined":Z(s))&&Object.keys(s).map((function(t){i.style[t]=s[t]})):("className"===n&&(n="class"),"innerHTML"===n?i.textContent=s:i.setAttribute(n,s))}return i}function x(t,e,i,n){return b("stop",{inside:t,style:"stop-color: "+i,offset:e,"stop-opacity":n})}function k(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i={className:t,transform:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return e&&(i.inside=e),b("g",i)}function w(t){return b("path",{className:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d:t,styles:{stroke:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",fill:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none","stroke-width":arguments.length>4&&void 0!==arguments[4]?arguments[4]:2}})}function D(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="path-fill-gradient-"+e+"-"+(i?"lighter":"default"),s=function(t,e){return b("linearGradient",{inside:t,id:e,x1:0,x2:0,y1:0,y2:1})}(t,n),a=[1,.6,.2];return i&&(a=[.4,.2,0]),x(s,"0%",e,a[0]),x(s,"50%",e,a[1]),x(s,"100%",e,a[2]),n}function M(t,e,i,n,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},r={className:t,x:e,y:i,width:n,height:n,rx:s,fill:arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none"};return Object.keys(a).map((function(t){r[t]=a[t]})),b("rect",r)}function P(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=s.fontSize||yt;return b("text",{className:t,x:e,y:i,dy:(void 0!==s.dy?s.dy:a/2)+"px","font-size":a+"px",fill:s.fill||xt,"text-anchor":s.textAnchor||"start",innerHTML:n})}function S(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};s.stroke||(s.stroke=bt),s.lineType||(s.lineType=""),s.shortenNumbers&&(e=function(t){var e=void 0;if("number"==typeof t)e=t;else if("string"==typeof t&&(e=Number(t),Number.isNaN(e)))return t;var i=Math.floor(Math.log10(Math.abs(e)));if(i<=2)return e;var n=Math.floor(i/3),s=Math.pow(10,i-3*n)*+(e/Math.pow(10,i)).toFixed(1);return Math.round(100*s)/100+" "+["","K","M","B","T"][n]}(e));var a=b("line",{className:"line-horizontal "+s.className+("dashed"===s.lineType?"dashed":""),x1:i,x2:n,y1:0,y2:0,styles:{stroke:s.stroke}}),r=b("text",{x:i3&&void 0!==arguments[3]?arguments[3]:{};c(t)||(t=0),n.pos||(n.pos="bottom"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=bt),n.className||(n.className="");var s=i+mt,a="span"===n.mode?-1*mt:i;return"tick"===n.mode&&"top"===n.pos&&(s=-1*mt,a=0),function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};s.stroke||(s.stroke=bt);var a=b("line",{className:"line-vertical "+s.className,x1:0,x2:0,y1:i,y2:n,styles:{stroke:s.stroke}}),r=b("text",{x:0,y:i>n?i+vt:i-vt-yt,dy:yt+"px","font-size":yt+"px","text-anchor":"middle",innerHTML:e+""}),o=b("g",{transform:"translate("+t+", 0)"});return o.appendChild(a),o.appendChild(r),o}(t,e,s,a,{stroke:n.stroke,className:n.className,lineType:n.lineType})}function T(t,e,i,n){var s="string"==typeof e?e:e.join(", ");return[t,{transform:i.join(", ")},n,At,"translate",{transform:s}]}function O(t,e,i){return T(t,[0,i],[0,e],Pt)}function L(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=d(i,(arguments.length>5&&void 0!==arguments[5]?arguments[5]:{}).zeroLine),r=nt(a,2),o=r[0],l=r[1];return l-=s,"rect"!==t.nodeName?[[t.childNodes[0],{width:n,height:o},Dt,At],T(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,l],Pt)]:[[t,{width:n,height:o,x:e,y:l},Dt,At]]}function C(t,e){return[t,{d:e},Dt,At]}function N(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"linear",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=t.cloneNode(!0),o=t.cloneNode(!0);for(var l in e){var u=void 0;u="transform"===l?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");var c=a[l]||t.getAttribute(l),h=e[l],d={attributeName:l,from:c,to:h,begin:"0s",dur:i/1e3+"s",values:c+";"+h,keySplines:Tt[n],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};for(var f in s&&(d.type=s),d)u.setAttribute(f,d[f]);r.appendChild(u),s?o.setAttribute(l,"translate("+h+")"):o.setAttribute(l,h)}return[r,o]}function _(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e}function $(t,e){var i=[],n=[];e.map((function(t){var e,s,a=t[0],r=a.parentNode;t[0]=a;var o=N.apply(void 0,st(t)),l=nt(o,2);e=l[0],s=l[1],i.push(s),n.push([e,r]),r&&r.replaceChild(e,a)}));var s=t.cloneNode(!0);return n.map((function(t,n){t[1]&&(t[1].replaceChild(i[n],t[0]),e[n][0]=i[n])})),s}function E(e){var i=e.cloneNode(!0);i.classList.add("chart-container"),i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");var n=t.create("style",{innerHTML:Ot});i.insertBefore(n,i.firstChild);var s=t.create("div");return s.appendChild(i),s.innerHTML}function Y(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function W(t){var e=t.getDate(),i=t.getMonth()+1;return[t.getFullYear(),(i>9?"":"0")+i,(e>9?"":"0")+e].join("-")}function z(t){return new Date(t.getTime())}function H(t,e){var i=R(t);return Math.ceil(function(t,e){var i=$t*_t;return(Y(e)-Y(t))/i}(i,e)/Nt)}function F(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function j(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Et[t];return e?i.slice(0,3):i}function I(t,e){return new Date(e,t+1,0)}function R(t){var e=z(t),i=e.getDay();return 0!==i&&U(e,-1*i),e}function U(t,e){t.setDate(t.getDate()+e)}function V(t,e,i){var n=Object.keys(zt).filter((function(e){return t.includes(e)})),s=zt[n[0]];return Object.assign(s,{constants:e,getData:i}),new Wt(s)}function B(t){if(0===t)return[0,0];if(isNaN(t))return{mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return{mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var i=Math.floor(Math.log10(t));return[e*(t/Math.pow(10,i)),i]}function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=B(t),n=nt(i,2),s=n[0],a=n[1],r=e?e/Math.pow(10,a):0,o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Math.ceil(t),n=Math.floor(e),s=i-n,a=s,r=1;s>5&&(s%2!=0&&(s=++i-n),a=s/2,r=2),s<=2&&(r=s/(a=4)),0===s&&(a=5,r=1);for(var o=[],l=0;l<=a;l++)o.push(n+r*l);return o}(s=s.toFixed(6),r);return o.map((function(t){return t*Math.pow(10,a)}))}function q(t){return t[1]-t[0]}function J(t,e){return r(e.zeroLine-t*e.scaleMultiplier)}function X(t,e){return e.filter((function(e){return e\n\t\t\t\t
    \n\t\t\t\t
    '}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",(function(){e.hideTip()}))}},{key:"fill",value:function(){var e,i=this;this.index&&this.container.setAttribute("data-point-index",this.index),e=this.titleValueFirst?""+this.titleValue+""+this.titleName:this.titleName+""+this.titleValue+"",this.title.innerHTML=e,this.dataPointList.innerHTML="",this.listValues.map((function(e,n){var s=i.colors[n]||"black",a=0===e.formatted||e.formatted?e.formatted:e.value,r=t.create("li",{styles:{"border-top":"3px solid "+s},innerHTML:''+(0===a||a?a:"")+"\n\t\t\t\t\t"+(e.title?e.title:"")});i.dataPointList.appendChild(r)}))}},{key:"calcPosition",value:function(){var t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight-5,this.left=this.x-t/2;var e=this.parent.offsetWidth-t,i=this.container.querySelector(".svg-pointer");if(this.left<0)i.style.left="calc(50% - "+-1*this.left+"px)",this.left=0;else if(this.left>e){var n="calc(50% + "+(this.left-e)+"px)";i.style.left=n,this.left=e}else i.style.left="50%"}},{key:"setValues",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;this.titleName=i.name,this.titleValue=i.value,this.listValues=n,this.x=t,this.y=e,this.titleValueFirst=i.valueFirst||0,this.index=s,this.refresh()}},{key:"hideTip",value:function(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0"}},{key:"showTip",value:function(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1"}}]),e}(),ft={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"},pt=function(t){return/rgb[a]{0,1}\([\d, ]+\)/gim.test(t)?/\D+(\d*)\D+(\d*)\D+(\d*)/gim.exec(t).map((function(t,e){return 0!==e?Number(t).toString(16):"#"})).reduce((function(t,e){return""+t+e})):ft[t]||t},mt=6,vt=4,gt=15,yt=10,bt="#dadada",xt="#555b51",kt={bar:function(t){var e=void 0;"rect"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode();return i.style.fill="#000000",i.style.opacity="0.4",e&&i.setAttribute("transform",e),i},dot:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),s=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",s),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i},heat_square:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),s=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",s),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i}},wt={bar:function(t,e){var i=void 0;"rect"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["x","y","width","height"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)},dot:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)},heat_square:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)}},Dt=350,Mt=350,Pt=Dt,St=250,At="easein",Tt={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"},Ot=".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}",Lt=function(){function e(t,i){if(K(this,e),i=h(i),this.parent="string"==typeof t?document.querySelector(t):t,!(this.parent instanceof HTMLElement))throw new Error("No `parent` element to render on was provided.");this.rawChartArgs=i,this.title=i.title||"",this.type=i.type||"",this.realData=this.prepareData(i.data),this.data=this.prepareFirstData(this.realData),this.colors=this.validateColors(i.colors,this.type),this.config={showTooltip:1,showLegend:1,isNavigable:i.isNavigable||0,animate:void 0!==i.animate?i.animate:1,truncateLegends:i.truncateLegends||1},this.measures=JSON.parse(JSON.stringify(at));var n=this.measures;this.setMeasures(i),this.title.length||(n.titleHeight=0),this.config.showLegend||(n.legendHeight=0),this.argHeight=i.height||n.baseHeight,this.state={},this.options={},this.initTimeout=700,this.config.isNavigable&&(this.overlays=[]),this.configure(i)}return Q(e,[{key:"prepareData",value:function(t){return t}},{key:"prepareFirstData",value:function(t){return t}},{key:"validateColors",value:function(t,e){var i=[];return(t=(t||[]).concat(ct[e])).forEach((function(t){var e=pt(t);!function(t){return/(^\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i.test(t)||/(^\s*)(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/i.test(t)}(e)?console.warn('"'+t+'" is not a valid color.'):i.push(e)})),i}},{key:"setMeasures",value:function(){}},{key:"configure",value:function(){var t=this,e=this.argHeight;this.baseHeight=e,this.height=e-s(this.measures),this.boundDrawFn=function(){return t.draw(!0)},ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.boundDrawFn),this.resizeObserver.observe(this.parent)),window.addEventListener("resize",this.boundDrawFn),window.addEventListener("orientationchange",this.boundDrawFn)}},{key:"destroy",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),window.removeEventListener("resize",this.boundDrawFn),window.removeEventListener("orientationchange",this.boundDrawFn)}},{key:"setup",value:function(){this.makeContainer(),this.updateWidth(),this.makeTooltip(),this.draw(!1,!0)}},{key:"makeContainer",value:function(){this.parent.innerHTML="";var e={inside:this.parent,className:"chart-container"};this.independentWidth&&(e.styles={width:this.independentWidth+"px"}),this.container=t.create("div",e)}},{key:"makeTooltip",value:function(){this.tip=new dt({parent:this.container,colors:this.colors}),this.bindTooltip()}},{key:"bindTooltip",value:function(){}},{key:"draw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&function(t){return null===t.offsetParent}(this.parent)||(this.updateWidth(),this.calc(e),this.makeChartArea(),this.setupComponents(),this.components.forEach((function(e){return e.setup(t.drawArea)})),this.render(this.components,!1),i&&(this.data=this.realData,setTimeout((function(){t.update(t.data)}),this.initTimeout)),this.renderLegend(),this.setupNavigation(i))}},{key:"calc",value:function(){}},{key:"updateWidth",value:function(){this.baseWidth=function(t){var e=window.getComputedStyle(t),i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-i}(this.parent),this.width=this.baseWidth-a(this.measures)}},{key:"makeChartArea",value:function(){this.svg&&this.container.removeChild(this.svg);var t=this.measures;this.svg=function(t,e,i,n){return b("svg",{className:e,inside:t,width:i,height:n})}(this.container,"frappe-chart chart",this.baseWidth,this.baseHeight),this.svgDefs=function(t){return b("defs",{inside:t})}(this.svg),this.title.length&&(this.titleEL=P("title",t.margins.left,t.margins.top,this.title,{fontSize:t.titleFontSize,fill:"#666666",dy:t.titleFontSize}));var e=i(t);this.drawArea=k(this.type+"-chart chart-draw-area","translate("+n(t)+", "+e+")"),this.config.showLegend&&(e+=this.height+t.paddings.bottom,this.legendArea=k("chart-legend","translate("+n(t)+", "+e+")")),this.title.length&&this.svg.appendChild(this.titleEL),this.svg.appendChild(this.drawArea),this.config.showLegend&&this.svg.appendChild(this.legendArea),this.updateTipOffset(n(t),i(t))}},{key:"updateTipOffset",value:function(t,e){this.tip.offset={x:t,y:e}}},{key:"setupComponents",value:function(){this.components=new Map}},{key:"update",value:function(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.calc(),this.render(this.components,this.config.animate),this.renderLegend()}},{key:"render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.components,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.config.isNavigable&&this.overlays.map((function(t){return t.parentNode.removeChild(t)}));var n=[];e.forEach((function(t){n=n.concat(t.update(i))})),n.length>0?(function(t,e,i){if(0!==i.length){var n=$(e,i);e.parentNode==t&&(t.removeChild(e),t.appendChild(n)),setTimeout((function(){n.parentNode==t&&(t.removeChild(n),t.appendChild(e))}),St)}}(this.container,this.svg,n),setTimeout((function(){e.forEach((function(t){return t.make()})),t.updateNav()}),400)):(e.forEach((function(t){return t.make()})),this.updateNav())}},{key:"updateNav",value:function(){this.config.isNavigable&&(this.makeOverlay(),this.bindUnits())}},{key:"renderLegend",value:function(){}},{key:"setupNavigation",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.config.isNavigable&&e&&(this.bindOverlay(),this.keyActions={13:this.onEnterKey.bind(this),37:this.onLeftArrow.bind(this),38:this.onUpArrow.bind(this),39:this.onRightArrow.bind(this),40:this.onDownArrow.bind(this)},document.addEventListener("keydown",(function(e){(function(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)})(t.container)&&(e=e||window.event,t.keyActions[e.keyCode]&&t.keyActions[e.keyCode]())})))}},{key:"makeOverlay",value:function(){}},{key:"updateOverlay",value:function(){}},{key:"bindOverlay",value:function(){}},{key:"bindUnits",value:function(){}},{key:"onLeftArrow",value:function(){}},{key:"onRightArrow",value:function(){}},{key:"onUpArrow",value:function(){}},{key:"onDownArrow",value:function(){}},{key:"onEnterKey",value:function(){}},{key:"addDataPoint",value:function(){}},{key:"removeDataPoint",value:function(){}},{key:"getDataPoint",value:function(){}},{key:"setCurrentDataPoint",value:function(){}},{key:"updateDataset",value:function(){}},{key:"export",value:function(){var t=E(this.svg);!function(t,e){var i=document.createElement("a");i.style="display: none";var n=new Blob(e,{type:"image/svg+xml; charset=utf-8"}),s=window.URL.createObjectURL(n);i.href=s,i.download=t,document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i),window.URL.revokeObjectURL(s)}),300)}(this.title||"Chart",[t])}}]),e}(),Ct=function(t){function e(t,i){return K(this,e),it(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i))}return et(e,t),Q(e,[{key:"configure",value:function(t){tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this,t),this.config.formatTooltipY=(t.tooltipOptions||{}).formatTooltipY,this.config.maxSlices=t.maxSlices||20,this.config.maxLegendPoints=t.maxLegendPoints||20}},{key:"calc",value:function(){var t=this,e=this.state,i=this.config.maxSlices;e.sliceTotals=[];var n=this.data.labels.map((function(e,i){var n=0;return t.data.datasets.map((function(t){n+=t.values[i]})),[n,e]})).filter((function(t){return t[0]>=0})),s=n;if(n.length>i){n.sort((function(t,e){return e[0]-t[0]})),s=n.slice(0,i-1);var a=0;n.slice(i-1).map((function(t){a+=t[0]})),s.push([a,"Rest"]),this.colors[i-1]="grey"}e.labels=[],s.map((function(t){e.sliceTotals.push(function(t){return Number(Math.round(t+"e4")+"e-4")}(t[0])),e.labels.push(t[1])})),e.grandTotal=e.sliceTotals.reduce((function(t,e){return t+e}),0),this.center={x:this.width/2,y:this.height/2}}},{key:"renderLegend",value:function(){var t=this,e=this.state;this.legendArea.textContent="",this.legendTotals=e.sliceTotals.slice(0,this.config.maxLegendPoints);var i=0,n=0;this.legendTotals.map((function(s,r){var o=150,l=Math.floor((t.width-a(t.measures))/o);t.legendTotals.lengthl&&(i=0,n+=20);var u=o*i+5,c=t.config.truncateLegends?p(e.labels[r],o/10):e.labels[r],h=t.config.formatTooltipY?t.config.formatTooltipY(s):s,d=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",s=arguments[4];s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?p(s,gt):s;var a={className:"legend-dot",cx:0,cy:0,r:i,fill:n},r=b("text",{className:"legend-dataset-text",x:0,y:0,dx:yt+"px",dy:yt/3+"px","font-size":1.2*yt+"px","text-anchor":"start",fill:xt,innerHTML:s}),o=b("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(b("circle",a)),o.appendChild(r),o}(u,n,5,t.colors[r],c+": "+h,!1);t.legendArea.appendChild(d),i++}))}}]),e}(Lt),Nt=7,_t=1e3,$t=86400,Et=["January","February","March","April","May","June","July","August","September","October","November","December"],Yt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Wt=function(){function t(e){var i=e.layerClass,n=void 0===i?"":i,s=e.layerTransform,a=void 0===s?"":s,r=e.constants,o=e.getData,l=e.makeElements,u=e.animateElements;K(this,t),this.layerTransform=a,this.constants=r,this.makeElements=l,this.getData=o,this.animateElements=u,this.store=[],this.labels=[],this.layerClass=n,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh()}return Q(t,[{key:"refresh",value:function(t){this.data=t||this.getData()}},{key:"setup",value:function(t){this.layer=k(this.layerClass,this.layerTransform,t)}},{key:"make",value:function(){this.render(this.data),this.oldData=this.data}},{key:"render",value:function(t){var e=this;this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach((function(t){e.layer.appendChild(t)})),this.labels.forEach((function(t){e.layer.appendChild(t)}))}},{key:"update",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.refresh();var e=[];return t&&(e=this.animateElements(this.data)||[]),e}}]),t}(),zt={donutSlices:{layerClass:"donut-slices",makeElements:function(t){return t.sliceStrings.map((function(e,i){var n=w(e,"donut-path",t.colors[i],"none",t.strokeWidth);return n.style.transition="transform .3s;",n}))},animateElements:function(t){return this.store.map((function(e,i){return C(e,t.sliceStrings[i])}))}},pieSlices:{layerClass:"pie-slices",makeElements:function(t){return t.sliceStrings.map((function(e,i){var n=w(e,"pie-path","none",t.colors[i]);return n.style.transition="transform .3s;",n}))},animateElements:function(t){return this.store.map((function(e,i){return C(e,t.sliceStrings[i])}))}},percentageBars:{layerClass:"percentage-bars",makeElements:function(t){var e=this;return t.xPositions.map((function(i,n){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ot,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none";return b("rect",{className:"percentage-bar",x:t,y:e,width:i,height:n,fill:a,styles:{stroke:g(a,-25),"stroke-dasharray":"0, "+(n+i)+", "+i+", "+n,"stroke-width":s}})}(i,0,t.widths[n],e.constants.barHeight,e.constants.barDepth,t.colors[n])}))},animateElements:function(t){if(t)return[]}},yAxis:{layerClass:"y axis",makeElements:function(t){var e=this;return t.positions.map((function(i,n){return function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};c(t)||(t=0),n.pos||(n.pos="left"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=bt),n.className||(n.className="");var s=-1*mt,a="span"===n.mode?i+mt:0;return"tick"===n.mode&&"right"===n.pos&&(s=i+mt,a=i),S(t,e,s+=n.offset,a+=n.offset,{stroke:n.stroke,className:n.className,lineType:n.lineType,shortenNumbers:n.shortenNumbers})}(i,t.labels[n],e.constants.width,{mode:e.constants.mode,pos:e.constants.pos,shortenNumbers:e.constants.shortenNumbers})}))},animateElements:function(t){var e=t.positions,i=t.labels,n=this.oldData.positions,s=this.oldData.labels,a=f(n,e),r=nt(a,2);n=r[0],e=r[1];var o=f(s,i),l=nt(o,2);return s=l[0],i=l[1],this.render({positions:n,labels:i}),this.store.map((function(t,i){return O(t,e[i],n[i])}))}},xAxis:{layerClass:"x axis",makeElements:function(t){var e=this;return t.positions.map((function(i,n){return A(i,t.calcLabels[n],e.constants.height,{mode:e.constants.mode,pos:e.constants.pos})}))},animateElements:function(t){var e=t.positions,i=t.calcLabels,n=this.oldData.positions,s=this.oldData.calcLabels,a=f(n,e),r=nt(a,2);n=r[0],e=r[1];var o=f(s,i),l=nt(o,2);return s=l[0],i=l[1],this.render({positions:n,calcLabels:i}),this.store.map((function(t,i){return function(t,e,i){return T(t,[i,0],[e,0],Pt)}(t,e[i],n[i])}))}},yMarkers:{layerClass:"y-markers",makeElements:function(t){var e=this;return t.map((function(t){return function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.labelPos||(n.labelPos="right");var s=b("text",{className:"chart-label",x:"left"===n.labelPos?vt:i-l(e,5)-vt,y:0,dy:yt/-2+"px","font-size":yt+"px","text-anchor":"start",innerHTML:e+""}),a=S(t,"",0,i,{stroke:n.stroke||bt,className:n.className||"",lineType:n.lineType});return a.appendChild(s),a}(t.position,t.label,e.constants.width,{labelPos:t.options.labelPos,mode:"span",lineType:"dashed"})}))},animateElements:function(t){var e=f(this.oldData,t),i=nt(e,2);this.oldData=i[0];var n=(t=i[1]).map((function(t){return t.position})),s=t.map((function(t){return t.label})),a=t.map((function(t){return t.options})),r=this.oldData.map((function(t){return t.position}));return this.render(r.map((function(t,e){return{position:r[e],label:s[e],options:a[e]}}))),this.store.map((function(t,e){return O(t,n[e],r[e])}))}},yRegions:{layerClass:"y-regions",makeElements:function(t){var e=this;return t.map((function(t){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=t-e,r=b("rect",{className:"bar mini",styles:{fill:"rgba(228, 234, 239, 0.49)",stroke:bt,"stroke-dasharray":i+", "+a},x:0,y:0,width:i,height:a});s.labelPos||(s.labelPos="right");var o=b("text",{className:"chart-label",x:"left"===s.labelPos?vt:i-l(n+"",4.5)-vt,y:0,dy:yt/-2+"px","font-size":yt+"px","text-anchor":"start",innerHTML:n+""}),u=b("g",{transform:"translate(0, "+e+")"});return u.appendChild(r),u.appendChild(o),u}(t.startPos,t.endPos,e.constants.width,t.label,{labelPos:t.options.labelPos})}))},animateElements:function(t){var e=f(this.oldData,t),i=nt(e,2);this.oldData=i[0];var n=(t=i[1]).map((function(t){return t.endPos})),s=t.map((function(t){return t.label})),a=t.map((function(t){return t.startPos})),r=t.map((function(t){return t.options})),o=this.oldData.map((function(t){return t.endPos})),l=this.oldData.map((function(t){return t.startPos}));this.render(o.map((function(t,e){return{startPos:l[e],endPos:o[e],label:s[e],options:r[e]}})));var u=[];return this.store.map((function(t,e){u=u.concat(function(t,e,i,n){var s=e-i,a=t.childNodes[0];return[[a,{height:s,"stroke-dasharray":a.getAttribute("width")+", "+s},Pt,At],T(t,[0,n],[0,i],Pt)]}(t,a[e],n[e],o[e]))})),u}},heatDomain:{layerClass:function(){return"heat-domain domain-"+this.constants.index},makeElements:function(t){var e=this,i=this.constants,n=i.index,s=i.colWidth,a=i.rowHeight,r=i.squareSize,o=i.radius,l=i.xTranslate,u=0;return this.serializedSubDomains=[],t.cols.map((function(t,i){1===i&&e.labels.push(P("domain-name",l,-12,j(n,!0).toUpperCase(),{fontSize:9})),t.map((function(t,i){if(t.fill){var n={"data-date":t.yyyyMmDd,"data-value":t.dataValue,"data-day":i},s=M("day",l,u,r,o,t.fill,n);e.serializedSubDomains.push(s)}u+=a})),u=0,l+=s})),this.serializedSubDomains},animateElements:function(t){if(t)return[]}},barGraph:{layerClass:function(){return"dataset-units dataset-bars dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="bar",this.units=t.yPositions.map((function(i,n){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},l=d(e,o.zeroLine),u=nt(l,2),h=u[0],f=u[1];f-=r,0===h&&(h=o.minHeight,f-=o.minHeight),c(t)||(t=0),c(f)||(f=0),c(h,!0)||(h=0),c(i,!0)||(i=0);var p=b("rect",{className:"bar mini",style:"fill: "+n,"data-point-index":a,x:t,y:f,width:i,height:h});if((s+="")||s.length){p.setAttribute("y",0),p.setAttribute("x",0);var m=b("text",{className:"data-point-value",x:i/2,y:0,dy:yt/2*-1+"px","font-size":yt+"px","text-anchor":"middle",innerHTML:s}),v=b("g",{"data-point-index":a,transform:"translate("+t+", "+f+")"});return v.appendChild(p),v.appendChild(m),v}return p}(t.xPositions[n],i,t.barWidth,e.color,t.labels[n],n,t.offsets[n],{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})})),this.units},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.offsets,s=t.labels,a=this.oldData.xPositions,r=this.oldData.yPositions,o=this.oldData.offsets,l=this.oldData.labels,u=f(a,e),c=nt(u,2);a=c[0],e=c[1];var h=f(r,i),d=nt(h,2);r=d[0],i=d[1];var p=f(o,n),m=nt(p,2);o=m[0],n=m[1];var v=f(l,s),g=nt(v,2);l=g[0],s=g[1],this.render({xPositions:a,yPositions:r,offsets:o,labels:s,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});var y=[];return this.store.map((function(s,a){y=y.concat(L(s,e[a],i[a],t.barWidth,n[a],{zeroLine:t.zeroLine}))})),y}},lineGraph:{layerClass:function(){return"dataset-units dataset-line dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="dot",this.paths={},e.hideLine||(this.paths=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=e.map((function(e,i){return t[i]+","+e})).join("L");n.spline&&(a=m(t,e));var r=w("M"+a,"line-graph-path",i);if(n.heatline){var o=D(s.svgDefs,i);r.style.stroke="url(#"+o+")"}var l={path:r};if(n.regionFill){var u=D(s.svgDefs,i,!0),c="M"+t[0]+","+s.zeroLine+"L"+a+"L"+t.slice(-1)[0]+","+s.zeroLine;l.region=w(c,"region-fill","none","url(#"+u+")")}return l}(t.xPositions,t.yPositions,e.color,{heatline:e.heatline,regionFill:e.regionFill,spline:e.spline},{svgDefs:e.svgDefs,zeroLine:t.zeroLine})),this.units=[],e.hideDots||(this.units=t.yPositions.map((function(i,n){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=b("circle",{style:"fill: "+n,"data-point-index":a,cx:t,cy:e,r:i});if((s+="")||s.length){r.setAttribute("cy",0),r.setAttribute("cx",0);var o=b("text",{className:"data-point-value",x:0,y:0,dy:yt/2*-1-i+"px","font-size":yt+"px","text-anchor":"middle",innerHTML:s}),l=b("g",{"data-point-index":a,transform:"translate("+t+", "+e+")"});return l.appendChild(r),l.appendChild(o),l}return r}(t.xPositions[n],i,t.radius,e.color,e.valuesOverPoints?t.values[n]:"",n)}))),Object.values(this.paths).concat(this.units)},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.values,s=this.oldData.xPositions,a=this.oldData.yPositions,r=this.oldData.values,o=f(s,e),l=nt(o,2);s=l[0],e=l[1];var u=f(a,i),c=nt(u,2);a=c[0],i=c[1];var h=f(r,n),d=nt(h,2);r=d[0],n=d[1],this.render({xPositions:s,yPositions:a,values:n,zeroLine:this.oldData.zeroLine,radius:this.oldData.radius});var p=[];return Object.keys(this.paths).length&&(p=p.concat(function(t,e,i,n,s){var a=[],r=i.map((function(t,i){return e[i]+","+t})).join("L");s&&(r=m(e,i));var o=[t.path,{d:"M"+r},Mt,At];if(a.push(o),t.region){var l=e[0]+","+n+"L",u="L"+e.slice(-1)[0]+", "+n,c=[t.region,{d:"M"+l+r+u},Mt,At];a.push(c)}return a}(this.paths,e,i,t.zeroLine,this.constants.spline))),this.units.length&&this.units.map((function(t,n){p=p.concat(function(t,e,i){return"circle"!==t.nodeName?[T(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,i],Pt)]:[[t,{cx:e,cy:i},Dt,At]]}(t,e[n],i[n]))})),p}}},Ht=function(t){function i(t,e){K(this,i);var n=it(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="percentage",n.setup(),n}return et(i,t),Q(i,[{key:"setMeasures",value:function(t){var e=this.measures;this.barOptions=t.barOptions||{};var i=this.barOptions;i.height=i.height||20,i.depth=i.depth||ot,e.paddings.right=30,e.legendHeight=60,e.baseHeight=8*(i.height+.5*i.depth)}},{key:"setupComponents",value:function(){var t=this.state,e=[["percentageBars",{barHeight:this.barOptions.height,barDepth:this.barOptions.depth},function(){return{xPositions:t.xPositions,widths:t.widths,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=V.apply(void 0,st(t));return[t[0],e]})))}},{key:"calc",value:function(){var t=this;tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;e.xPositions=[],e.widths=[];var n=0;e.sliceTotals.map((function(i){var s=t.width*i/e.grandTotal;e.widths.push(s),e.xPositions.push(n),n+=s}))}},{key:"makeDataByIndex",value:function(){}},{key:"bindTooltip",value:function(){var t=this,i=this.state;this.container.addEventListener("mousemove",(function(n){var s=t.components.get("percentageBars").store,a=n.target;if(s.includes(a)){var r=s.indexOf(a),o=e(t.container),l=e(a),u=l.left-o.left+parseInt(a.getAttribute("width"))/2,c=l.top-o.top,h=(t.formattedLabels&&t.formattedLabels.length>0?t.formattedLabels[r]:t.state.labels[r])+": ",d=i.sliceTotals[r]/i.grandTotal;t.tip.setValues(u,c,{name:h,value:(100*d).toFixed(1)+"%"}),t.tip.showTip()}}))}}]),i}(Ct),Ft=function(t){function i(t,e){K(this,i);var n=it(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="pie",n.initTimeout=0,n.init=1,n.setup(),n}return et(i,t),Q(i,[{key:"configure",value:function(t){tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1}},{key:"calc",value:function(){var t=this;tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x:this.center.y;var n=this.radius,s=this.clockWise,a=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map((function(i,o){var l=r,c=i/e.grandTotal*360,h=c>180?1:0,d=s?-c:c,f=r+=d,p=u(l,n),m=u(f,n),v=t.init&&a[o],g=void 0,y=void 0;t.init?(g=v?v.startPosition:p,y=v?v.endPosition:p):(g=p,y=m);var b=360===c?function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*i.y,c=i.y+e.y;return"M"+i.x+" "+i.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+u+" z\n\t\tL"+r+" "+u+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+c+" z"}(g,y,t.center,t.radius,s,h):function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=i.y+e.y;return"M"+i.x+" "+i.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+u+" z"}(g,y,t.center,t.radius,s,h);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:p,endPosition:m,value:i,total:e.grandTotal,startAngle:l,endAngle:f,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["pieSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=V.apply(void 0,st(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=u(t.startAngle+t.angle/2,e);return"translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,s){if(t){var a=this.colors[i];if(n){_(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.fill=g(a,50);var r=e(this.svg),o=s.pageX-r.left+10,l=s.pageY-r.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",c=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:c+"%"}),this.tip.showTip()}else _(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.fill=a}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("pieSlices").store,n=this.curActiveSliceIndex,s=this.curActiveSlice;if(i.includes(e)){var a=i.indexOf(e);this.hoverSlice(s,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=a,this.hoverSlice(e,a,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),i}(Ct),jt=function(t){function e(t,i){K(this,e);var n=it(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));n.type="heatmap",n.countLabel=i.countLabel||"";var s=["Sunday","Monday"],a=s.includes(i.startSubDomain)?i.startSubDomain:"Sunday";return n.startSubDomainIndex=s.indexOf(a),n.setup(),n}return et(e,t),Q(e,[{key:"setMeasures",value:function(t){var e=this.measures;this.discreteDomains=0===t.discreteDomains?0:1,e.paddings.top=36,e.paddings.bottom=0,e.legendHeight=24,e.baseHeight=12*Nt+s(e);var i=this.data,n=this.discreteDomains?12:0;this.independentWidth=12*(H(i.start,i.end)+n)+a(e)}},{key:"updateWidth",value:function(){var t=this.discreteDomains?12:0,e=this.state.noOfWeeks?this.state.noOfWeeks:52;this.baseWidth=12*(e+t)+a(this.measures)}},{key:"prepareData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;if(t.start&&t.end&&t.start>t.end)throw new Error("Start date cannot be greater than end date.");if(t.start||(t.start=new Date,t.start.setFullYear(t.start.getFullYear()-1)),t.end||(t.end=new Date),t.dataPoints=t.dataPoints||{},parseInt(Object.keys(t.dataPoints)[0])>1e5){var e={};Object.keys(t.dataPoints).forEach((function(i){var n=new Date(i*_t);e[W(n)]=t.dataPoints[i]})),t.dataPoints=e}return t}},{key:"calc",value:function(){var t=this.state;t.start=z(this.data.start),t.end=z(this.data.end),t.firstWeekStart=z(t.start),t.noOfWeeks=H(t.start,t.end),t.distribution=function(t,e){for(var i=Math.max.apply(Math,st(t)),n=1/(e-1),s=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:"",i=[t.getMonth(),t.getFullYear()],n=i[0],s=i[1],a=R(t),r={index:n,cols:[]};U(e=z(e)||I(n,s),1);for(var o=H(a,e),l=[],u=void 0,c=0;c2&&void 0!==arguments[2]&&arguments[2],n=this.state,s=z(t),a=[],r=0;r=n.start&&s<=n.end;i||s.getMonth()!==e||!l?o.yyyyMmDd=W(s):o=this.getSubDomainConfig(s),a.push(o)}return a}},{key:"getSubDomainConfig",value:function(t){var e=W(t),i=this.data.dataPoints[e];return{yyyyMmDd:e,dataValue:i||0,fill:this.colors[X(i,this.state.distribution)]}}}]),e}(Lt),It=function(t){function s(t,e){K(this,s);var i=it(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t,e));return i.barOptions=e.barOptions||{},i.lineOptions=e.lineOptions||{},i.type=e.type||"line",i.init=1,i.setup(),i}return et(s,t),Q(s,[{key:"setMeasures",value:function(){this.data.datasets.length<=1&&(this.config.showLegend=0,this.measures.paddings.bottom=30)}},{key:"configure",value:function(t){tt(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"configure",this).call(this,t),t.axisOptions=t.axisOptions||{},t.tooltipOptions=t.tooltipOptions||{},this.config.xAxisMode=t.axisOptions.xAxisMode||"span",this.config.yAxisMode=t.axisOptions.yAxisMode||"span",this.config.xIsSeries=t.axisOptions.xIsSeries||0,this.config.shortenYAxisNumbers=t.axisOptions.shortenYAxisNumbers||0,this.config.formatTooltipX=t.tooltipOptions.formatTooltipX,this.config.formatTooltipY=t.tooltipOptions.formatTooltipY,this.config.valuesOverPoints=t.valuesOverPoints}},{key:"prepareData",value:function(){return function(t,e){t.labels=t.labels||[];var i=t.labels.length,n=t.datasets,s=new Array(i).fill(0);return n||(n=[{values:s}]),n.map((function(t){if(t.values){var n=t.values;n=(n=n.map((function(t){return isNaN(t)?0:t}))).length>i?n.slice(0,i):o(n,i-n.length,0),t.values=n}else t.values=s;t.chartType||(rt.includes(e),t.chartType=e)})),t.yRegions&&t.yRegions.map((function(t){if(t.end0&&void 0!==arguments[0]?arguments[0]:this.data,this.type)}},{key:"prepareFirstData",value:function(){return function(t){var e=t.labels.length,i=new Array(e).fill(0),n={labels:t.labels.slice(0,-1),datasets:t.datasets.map((function(t){return{name:"",values:i.slice(0,-1),chartType:t.chartType}}))};return t.yMarkers&&(n.yMarkers=[{value:0,label:""}]),t.yRegions&&(n.yRegions=[{start:0,end:0,label:""}]),n}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data)}},{key:"calc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calcXPositions(),t||this.calcYAxisParameters(this.getAllYValues(),"line"===this.type),this.makeDataByIndex()}},{key:"calcXPositions",value:function(){var t=this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map((function(e,i){return r(t.xOffset+i*t.unitWidth)}))}}},{key:"calcYAxisParameters",value:function(t){var e=function(t){function e(t,e){for(var i=G(t),n=i[1]-i[0],s=0,a=1;s1&&void 0!==arguments[1]&&arguments[1],n=Math.max.apply(Math,st(t)),s=Math.min.apply(Math,st(t)),a=[];if(n>=0&&s>=0)B(n)[1],a=i?G(n,s):G(n);else if(n>0&&s<0){var r=Math.abs(s);n>=r?(B(n)[1],a=e(n,r)):(B(r)[1],a=e(r,n).reverse().map((function(t){return-1*t})))}else if(n<=0&&s<=0){var o=Math.abs(s),l=Math.abs(n);B(o)[1],a=(a=i?G(o,l):G(o)).reverse().map((function(t){return-1*t}))}return a}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"false"),i=this.height/function(t){return t[t.length-1]-t[0]}(e),n=q(e)*i,s=this.height-function(t){var e=q(t);return t.indexOf(0)>=0?t.indexOf(0):t[0]>0?-1*t[0]/e:-1*t[t.length-1]/e+(t.length-1)}(e)*n;this.state.yAxis={labels:e,positions:e.map((function(t){return s-t*i})),scaleMultiplier:i,zeroLine:s},this.calcDatasetPoints(),this.calcYExtremes(),this.calcYRegions()}},{key:"calcDatasetPoints",value:function(){var t=this.state,e=function(e){return e.map((function(e){return J(e,t.yAxis)}))};t.datasets=this.data.datasets.map((function(t,i){var n=t.values,s=t.cumulativeYs||[];return{name:t.name&&t.name.replace(/<|>|&/g,(function(t){return"&"==t?"&":"<"==t?"<":">"})),index:i,chartType:t.chartType,values:n,yPositions:e(n),cumulativeYs:s,cumulativeYPos:e(s)}}))}},{key:"calcYExtremes",value:function(){var t=this.state;this.barOptions.stacked?t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos:(t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map((function(e){e.yPositions.map((function(e,i){e1&&void 0!==arguments[1]?arguments[1]:[],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t/e.length;n<=0&&(n=1);var s=n/lt,a=void 0;if(i){var r=Math.max.apply(Math,st(e.map((function(t){return t.length}))));a=Math.ceil(r/s)}return e.map((function(t,e){return(t+="").length>s&&(i?e%a!=0&&(t=""):t=s-3>0?t.slice(0,s-3)+" ...":t.slice(0,s)+".."),t}))}(this.width,t.xAxis.labels,this.config.xIsSeries),t.xAxis}.bind(this)],["yRegions",{width:this.width,pos:"right"},function(){return this.state.yRegions}.bind(this)]],i=this.state.datasets.filter((function(t){return"bar"===t.chartType})),n=this.state.datasets.filter((function(t){return"line"===t.chartType})),s=i.map((function(e){var n=e.index;return["barGraph-"+e.index,{index:n,color:t.colors[n],stacked:t.barOptions.stacked,valuesOverPoints:t.config.valuesOverPoints,minHeight:0*t.height},function(){var t=this.state,e=t.datasets[n],s=this.barOptions.stacked,a=this.barOptions.spaceRatio||.5,r=t.unitWidth*(1-a),o=r/(s?1:i.length),l=t.xAxis.positions.map((function(t){return t-r/2}));s||(l=l.map((function(t){return t+o*n})));var u=new Array(t.datasetLength).fill("");this.config.valuesOverPoints&&(u=s&&e.index===t.datasets.length-1?e.cumulativeYs:e.values);var c=new Array(t.datasetLength).fill(0);return s&&(c=e.yPositions.map((function(t,i){return t-e.cumulativeYPos[i]}))),{xPositions:l,yPositions:e.yPositions,offsets:c,labels:u,zeroLine:t.yAxis.zeroLine,barsWidth:r,barWidth:o}}.bind(t)]})),a=n.map((function(e){var i=e.index;return["lineGraph-"+e.index,{index:i,color:t.colors[i],svgDefs:t.svgDefs,heatline:t.lineOptions.heatline,regionFill:t.lineOptions.regionFill,spline:t.lineOptions.spline,hideDots:t.lineOptions.hideDots,hideLine:t.lineOptions.hideLine,valuesOverPoints:t.config.valuesOverPoints},function(){var t=this.state,e=t.datasets[i],n=t.yAxis.positions[0]i(a)?t.mapTooltipXPosition(o):t.tip.hideTip()}))}},{key:"mapTooltipXPosition",value:function(t){var e=this.state;if(e.yExtremes){var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.reduce((function(e,i){return Math.abs(i-t)=0){var n=this.dataByIndex[i];this.tip.setValues(n.xPos+this.tip.offset.x,n.yExtreme+this.tip.offset.y,{name:n.formattedLabel,value:""},n.values,i),this.tip.showTip()}}}},{key:"renderLegend",value:function(){var t=this,e=this.data;e.datasets.length>1&&(this.legendArea.textContent="",e.datasets.map((function(e,i){var n=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",s=arguments[4];s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?p(s,gt):s;var a={className:"legend-bar",x:0,y:0,width:i,height:"2px",fill:n},r=b("text",{className:"legend-dataset-text",x:0,y:0,dy:2*yt+"px","font-size":1.2*yt+"px","text-anchor":"start",fill:xt,innerHTML:s}),o=b("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(b("rect",a)),o.appendChild(r),o}(100*i,"0",100,t.colors[i],e.name,t.config.truncateLegends);t.legendArea.appendChild(n)})))}},{key:"makeOverlay",value:function(){var t=this;this.init?this.init=0:(this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)})),this.overlayGuides=this.dataUnitComponents.map((function(t){return{type:t.unitType,overlay:void 0,units:t.units}})),void 0===this.state.currentIndex&&(this.state.currentIndex=this.state.datasetLength-1),this.overlayGuides.map((function(e){var i=e.units[t.state.currentIndex];e.overlay=kt[e.type](i),t.drawArea.appendChild(e.overlay)})))}},{key:"updateOverlayGuides",value:function(){this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)}))}},{key:"bindOverlay",value:function(){var t=this;this.parent.addEventListener("data-select",(function(){t.updateOverlay()}))}},{key:"bindUnits",value:function(){var t=this;this.dataUnitComponents.map((function(e){e.units.map((function(e){e.addEventListener("click",(function(){var i=e.getAttribute("data-point-index");t.setCurrentDataPoint(i)}))}))})),this.tip.container.addEventListener("click",(function(){var e=t.tip.container.getAttribute("data-point-index");t.setCurrentDataPoint(e)}))}},{key:"updateOverlay",value:function(){var t=this;this.overlayGuides.map((function(e){var i=e.units[t.state.currentIndex];wt[e.type](i,e.overlay)}))}},{key:"onLeftArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex-1)}},{key:"onRightArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex+1)}},{key:"getDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentIndex,e=this.state;return{index:t,label:e.xAxis.labels[t],values:e.datasets.map((function(e){return e.values[t]}))}}},{key:"setCurrentDataPoint",value:function(t){var e=this.state;(t=parseInt(t))<0&&(t=0),t>=e.xAxis.labels.length&&(t=e.xAxis.labels.length-1),t!==e.currentIndex&&(e.currentIndex=t,function(t,e,i){var n=document.createEvent("HTMLEvents");for(var s in n.initEvent(e,!0,!0),i)n[s]=i[s];t.dispatchEvent(n)}(this.parent,"data-select",this.getDataPoint()))}},{key:"addDataPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.state.datasetLength;tt(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"addDataPoint",this).call(this,t,e,i),this.data.labels.splice(i,0,t),this.data.datasets.map((function(t,n){t.values.splice(i,0,e[n])})),this.update(this.data)}},{key:"removeDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.datasetLength-1;this.data.labels.length<=1||(tt(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"removeDataPoint",this).call(this,t),this.data.labels.splice(t,1),this.data.datasets.map((function(e){e.values.splice(t,1)})),this.update(this.data))}},{key:"updateDataset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.data.datasets[e].values=t,this.update(this.data)}},{key:"updateDatasets",value:function(t){this.data.datasets.map((function(e,i){t[i]&&(e.values=t[i])})),this.update(this.data)}}]),s}(Lt),Rt=function(t){function i(t,e){K(this,i);var n=it(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="donut",n.initTimeout=0,n.init=1,n.setup(),n}return et(i,t),Q(i,[{key:"configure",value:function(t){tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1,this.strokeWidth=t.strokeWidth||30}},{key:"calc",value:function(){var t=this;tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x-this.strokeWidth/2:this.center.y-this.strokeWidth/2;var n=this.radius,s=this.clockWise,a=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map((function(i,o){var l=r,c=i/e.grandTotal*360,h=c>180?1:0,d=s?-c:c,f=r+=d,p=u(l,n),m=u(f,n),v=t.init&&a[o],g=void 0,y=void 0;t.init?(g=v?v.startPosition:p,y=v?v.endPosition:p):(g=p,y=m);var b=360===c?function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*n+o;return"M"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+u+"\n\t\tM"+r+" "+u+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+(i.y+t.y)}(g,y,t.center,t.radius,t.clockWise,h):function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return"M"+(i.x+t.x)+" "+(i.y+t.y)+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+(i.x+e.x)+" "+(i.y+e.y)}(g,y,t.center,t.radius,t.clockWise,h);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:p,endPosition:m,value:i,total:e.grandTotal,startAngle:l,endAngle:f,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["donutSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors,strokeWidth:this.strokeWidth}}.bind(this)]];this.components=new Map(e.map((function(t){var e=V.apply(void 0,st(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=u(t.startAngle+t.angle/2,e);return"translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,s){if(t){var a=this.colors[i];if(n){_(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.stroke=g(a,50);var r=e(this.svg),o=s.pageX-r.left+10,l=s.pageY-r.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",c=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:c+"%"}),this.tip.showTip()}else _(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.stroke=a}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("donutSlices").store,n=this.curActiveSliceIndex,s=this.curActiveSlice;if(i.includes(e)){var a=i.indexOf(e);this.hoverSlice(s,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=a,this.hoverSlice(e,a,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),i}(Ct),Ut={bar:It,line:It,percentage:Ht,heatmap:jt,pie:Ft,donut:Rt},Vt=Object.freeze({Chart:function t(e,i){return K(this,t),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"line",e=arguments[1],i=arguments[2];return"axis-mixed"===t?(i.type="line",new It(e,i)):Ut[t]?new Ut[t](e,i):void console.error("Undefined chart type: "+t)}(i.type,e,i)},PercentageChart:Ht,PieChart:Ft,Heatmap:jt,AxisChart:It});return Object.assign({},{NAME:"Frappe Charts",VERSION:"1.6.2"},Vt)}()}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{extend:()=>Z});const t=flarum.reg.get("core","admin/app");var e=i.n(t);const s=flarum.reg.get("core","common/extend"),a=flarum.reg.get("core","admin/components/DashboardPage");var r=i.n(a);function o(t){return o="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},o(t)}function l(t,e,i){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const u=flarum.reg.get("core","admin/components/DashboardWidget");var c=i.n(u);const h=flarum.reg.get("core","common/components/LoadingIndicator");var d=i.n(h);const f=flarum.reg.get("core","common/components/Link");var p=i.n(f);const v=flarum.reg.get("core","common/utils/abbreviateNumber");var g=i.n(v);class y extends(c()){constructor(){super(...arguments),l(this,"entities",["users","discussions","posts"]),l(this,"lifetimeData",void 0),l(this,"loadingLifetime",!0)}oncreate(t){super.oncreate(t),this.loadLifetimeData()}async loadLifetimeData(){this.loadingLifetime=!0,m.redraw();const t=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"lifetime"}});this.lifetimeData=t,this.loadingLifetime=!1,m.redraw()}className(){return"StatisticsWidget StatisticsWidget--mini"}content(){return m("div",{className:"StatisticsWidget-table"},m("h4",{className:"StatisticsWidget-title"},e().translator.trans("flarum-statistics.admin.statistics.mini_heading")),m("div",{className:"StatisticsWidget-entities"},m("div",{className:"StatisticsWidget-labels"},m("div",{className:"StatisticsWidget-label"},e().translator.trans("flarum-statistics.admin.statistics.total_label"))),this.entities.map((t=>{const i=this.loadingLifetime?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getTotalCount(t);return m("div",{className:"StatisticsWidget-entity"},m("h3",{className:"StatisticsWidget-heading"},e().translator.trans("flarum-statistics.admin.statistics."+t+"_heading")),m("div",{className:"StatisticsWidget-total",title:i},this.loadingLifetime?m(d(),{display:"inline"}):g()(i)))}))),m("div",{className:"StatisticsWidget-viewFull"},m(p(),{href:e().route("extension",{id:"flarum-statistics"})},e().translator.trans("flarum-statistics.admin.statistics.view_full"))))}getTotalCount(t){return this.lifetimeData[t]}}flarum.reg.add("flarum-statistics","admin/components/MiniStatisticsWidget",y);const b=flarum.reg.get("core","common/extenders");var x=i.n(b);const k=flarum.reg.get("core","admin/components/ExtensionPage");var w=i.n(k);const D=flarum.reg.get("core","common/components/SelectDropdown");var M=i.n(D);const P=flarum.reg.get("core","common/components/Button");var S=i.n(P);const A=flarum.reg.get("core","common/utils/extractText");var T=i.n(A);const O=flarum.reg.get("core","common/components/Placeholder");var L=i.n(O);const C=flarum.reg.get("core","common/components/Icon");var N=i.n(C);const _=flarum.reg.get("core","common/utils/classList");var $=i.n(_);const E=flarum.reg.get("core","common/utils/ItemList");var Y=i.n(E);const W=flarum.reg.get("core","common/utils/generateElementId");var z=i.n(W);const H=flarum.reg.get("core","common/components/FormModal");var F=i.n(H),j=i(720),I=i.n(j),R=i(153),U=i.n(R);I().extend(U());class V extends(F()){constructor(){super(...arguments),l(this,"state",{inputs:{startDateVal:I()().format("YYYY-MM-DD"),endDateVal:I()().format("YYYY-MM-DD")},ids:{startDate:z()(),endDate:z()()}})}oninit(t){super.oninit(t),this.attrs.value&&(this.state.inputs={startDateVal:I().utc(1e3*this.attrs.value.start).format("YYYY-MM-DD"),endDateVal:I().utc(1e3*this.attrs.value.end).format("YYYY-MM-DD")})}className(){return"StatisticsWidgetDateSelectionModal Modal--small"}title(){return e().translator.trans("flarum-statistics.admin.date_selection_modal.title")}content(){return m("div",{className:"Modal-body"},this.items().toArray())}items(){const t=new(Y());return t.add("intro",m("p",null,e().translator.trans("flarum-statistics.admin.date_selection_modal.description")),100),t.add("date_start",m("div",{className:"Form-group"},m("label",{htmlFor:this.state.ids.startDate},e().translator.trans("flarum-statistics.admin.date_selection_modal.start_date")),m("input",{type:"date",id:this.state.ids.startDate,value:this.state.inputs.startDateVal,onchange:this.updateState("startDateVal"),className:"FormControl"})),90),t.add("date_end",m("div",{className:"Form-group"},m("label",{htmlFor:this.state.ids.endDate},e().translator.trans("flarum-statistics.admin.date_selection_modal.end_date")),m("input",{type:"date",id:this.state.ids.endDate,value:this.state.inputs.endDateVal,onchange:this.updateState("endDateVal"),className:"FormControl"})),80),t.add("submit",m(S(),{className:"Button Button--primary",type:"submit"},e().translator.trans("flarum-statistics.admin.date_selection_modal.submit_button")),0),t}updateState(t){return e=>{this.state.inputs[t]=e.currentTarget.value}}submitData(){return{start:Math.floor(+I().utc(this.state.inputs.startDateVal+"Z")/1e3),end:Math.floor(+I().utc(this.state.inputs.endDateVal+"Z").hour(23).minute(59).second(59).millisecond(999)/1e3)}}onsubmit(t){t.preventDefault();const i=this.submitData();i.end(t[e]="unloaded",t)),{})),l(this,"loadingCustom",this.entities.reduce(((t,e)=>(t[e]="unloaded",t)),{})),l(this,"selectedEntity","users"),l(this,"selectedPeriod",void 0),l(this,"chartEntity",void 0),l(this,"chartPeriod",void 0)}oncreate(t){super.oncreate(t),this.loadLifetimeData()}async loadLifetimeData(){this.loadingLifetime=!0,m.redraw();const t=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"lifetime"}});this.lifetimeData=t,this.loadingLifetime=!1,m.redraw()}async loadTimedData(t){this.loadingTimed[t]="loading",m.redraw();try{const i=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"timed",model:t}});this.timedData[t]=i,this.loadingTimed[t]="loaded";let n=new Date;n.setUTCHours(0,0,0,0);const s=n.getTime()/1e3;this.periods={today:{start:s,end:s+86400,step:3600},last_7_days:{start:s-604800,end:s,step:86400},previous_7_days:{start:s-1209600,end:s-604800,step:86400},last_28_days:{start:s-2419200,end:s,step:86400},previous_28_days:{start:s-4838400,end:s-2419200,step:86400},last_12_months:{start:s-31449600,end:s,step:604800}},this.selectedPeriod="last_7_days"}catch(e){console.error(e),this.loadingTimed[t]="fail"}m.redraw()}async loadCustomRangeData(t){this.loadingCustom[t]="loading",m.redraw();const i={...this.customPeriod};try{const n=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"custom",model:t,dateRange:{start:i.start,end:i.end}}});if(JSON.stringify(i)!==JSON.stringify(this.customPeriod))return;this.customPeriodData[t]=n,this.loadingCustom[t]="loaded",m.redraw()}catch(e){if(JSON.stringify(i)!==JSON.stringify(this.customPeriod))return;console.error(e),this.loadingCustom[t]="fail"}}className(){return"StatisticsWidget"}content(){const t="loaded"!==("custom"===this.selectedPeriod?this.loadingCustom:this.loadingTimed)[this.selectedEntity],i=t?null:"custom"===this.selectedPeriod?{start:this.customPeriod?.end,end:this.customPeriod?.end,step:86400}:this.periods[this.selectedPeriod];return"custom"===this.selectedPeriod?this.customPeriodData[this.selectedEntity]||"unloaded"!==this.loadingCustom[this.selectedEntity]||this.loadCustomRangeData(this.selectedEntity):this.timedData[this.selectedEntity]||"unloaded"!==this.loadingTimed[this.selectedEntity]||this.loadTimedData(this.selectedEntity),m("div",{className:"StatisticsWidget-table"},m("div",{className:"StatisticsWidget-entities"},m("div",{className:"StatisticsWidget-labels"},m("div",{className:"StatisticsWidget-label"},e().translator.trans("flarum-statistics.admin.statistics.total_label")),m("div",{className:"StatisticsWidget-label"},t?m(d(),{size:"small",display:"inline"}):m(M(),{disabled:t,buttonClassName:"Button Button--text",caretIcon:"fas fa-caret-down"},Object.keys(this.periods).map((t=>m(S(),{key:t,active:t===this.selectedPeriod,onclick:this.changePeriod.bind(this,t),icon:t!==this.selectedPeriod||"fas fa-check"},e().translator.trans(`flarum-statistics.admin.statistics.${t}_label`)))).concat([m(S(),{key:"custom",active:"custom"===this.selectedPeriod,onclick:()=>{const t={onModalSubmit:t=>{JSON.stringify(t)!==JSON.stringify(this.customPeriod)&&(this.customPeriodData={},Object.keys(this.loadingCustom).forEach((t=>this.loadingCustom[t]="unloaded")),this.customPeriod=t,this.changePeriod("custom"))}};this.customPeriod&&(t.value=this.customPeriod),e().modal.show(V,t)},icon:"custom"!==this.selectedPeriod||"fas fa-check"},"custom"===this.selectedPeriod?T()(e().translator.trans("flarum-statistics.admin.statistics.custom_label_specified",{fromDate:I().utc(1e3*this.customPeriod.start).format("ll"),toDate:I().utc(1e3*this.customPeriod.end).format("ll")})):e().translator.trans("flarum-statistics.admin.statistics.custom_label"))])))),this.entities.map((n=>{const s=this.loadingLifetime?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getTotalCount(n),a=t?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getPeriodCount(n,i),r="custom"===this.selectedPeriod?null:t?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getPeriodCount(n,this.getLastPeriod(i)),o=t||0===r||null===r?0:(a-r)/r*100;return m("button",{className:$()("Button--ua-reset StatisticsWidget-entity",{active:this.selectedEntity===n}),onclick:this.changeEntity.bind(this,n)},m("h3",{className:"StatisticsWidget-heading"},e().translator.trans("flarum-statistics.admin.statistics."+n+"_heading")),m("div",{className:"StatisticsWidget-total",title:s},this.loadingLifetime?m(d(),{display:"inline"}):g()(s)),m("div",{className:"StatisticsWidget-period",title:a},t?m(d(),{display:"inline"}):g()(a),0!==o&&m("[",null," ",m("span",{className:"StatisticsWidget-change StatisticsWidget-change--"+(o>0?"up":"down")},m(N(),{name:"fas fa-arrow-"+(o>0?"up":"down")}),Math.abs(o).toFixed(1),"%"))))}))),m("[",null,t?m("div",{key:"loading",className:"StatisticsWidget-chart","data-loading":"true"},m(d(),{size:"large"})):m("div",{key:"loaded",className:"StatisticsWidget-chart","data-loading":"false",oncreate:this.drawChart.bind(this),onupdate:this.drawChart.bind(this)})),this.noData&&m(L(),{text:e().translator.trans("flarum-statistics.admin.statistics.no_data")}),!this.noData&&!!this.chart&&m(S(),{className:"StatisticsWidget-chartExport Button",icon:"fas fa-file-export",onclick:()=>{this.chart.export()}},e().translator.trans("flarum-statistics.admin.statistics.export_chart_button")))}drawChart(t){if(this.chart&&this.chartEntity===this.selectedEntity&&this.chartPeriod===this.selectedPeriod)return;const i="custom"===this.selectedPeriod?{start:this.customPeriod?.start,end:this.customPeriod?.end,step:86400}:this.periods[this.selectedPeriod],n=i.end-i.start,s=[],a=[],r=[];for(let t=i.start;t86400&&(e+=" - "+I().unix(t+i.step-1).utc().format("D MMM"))),s.push(e),a.push(this.getPeriodCount(this.selectedEntity,{start:t,end:t+i.step})),r.push(this.getPeriodCount(this.selectedEntity,{start:t-n,end:t-n}))}if(0===a.length)return this.noData=!0,void m.redraw();this.noData=!1,m.redraw();const o={labels:s,datasets:[{name:T()(e().translator.trans("flarum-statistics.admin.statistics.current_period")),values:a},{name:T()(e().translator.trans("flarum-statistics.admin.statistics.previous_period")),values:r}]};this.chart&&16&document.compareDocumentPosition(this.chart.parent)?this.chart.update(o):this.chart=new q.Chart(t.dom,{data:o,type:"line",height:280,axisOptions:{xAxisMode:"tick",yAxisMode:"span",xIsSeries:!0},lineOptions:{hideDots:1,regionFill:1},colors:[e().forum.attribute("themePrimaryColor"),"black"]}),this.chartEntity=this.selectedEntity,this.chartPeriod=this.selectedPeriod}changeEntity(t){this.selectedEntity=t}changePeriod(t){this.selectedPeriod=t}getTotalCount(t){return this.lifetimeData[t]}getPeriodCount(t,e){const i=("custom"===this.selectedPeriod?this.customPeriodData:this.timedData)[t];let n=0;for(const t in i){const s=parseInt(t);s>=e.start&&s{(0,s.extend)(r().prototype,"availableWidgets",(function(t){t.add("statistics",m(y,null),20)}))}))})(),module.exports=n})(); +(()=>{var t={720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,i="millisecond",n="second",s="minute",a="hour",r="day",o="week",l="month",u="quarter",c="year",h="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},v=function(t,e,i){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(i)+t},g={s:v,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),n=Math.floor(i/60),s=i%60;return(e<=0?"+":"-")+v(n,2,"0")+":"+v(s,2,"0")},m:function t(e,i){if(e.date()1)return t(r[0])}else{var o=e.name;b[o]=e,s=o}return!n&&s&&(y=s),s||!n&&y},D=function(t,e){if(k(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new P(i)},M=g;M.l=w,M.i=k,M.w=function(t,e){return D(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var P=function(){function m(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[x]=!0}var v=m.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(f);if(n){var s=n[2]-1||0,a=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return M},v.isValid=function(){return!(this.$d.toString()===d)},v.isSame=function(t,e){var i=D(t);return this.startOf(e)<=i&&i<=this.endOf(e)},v.isAfter=function(t,e){return D(t)3&&void 0!==arguments[3]&&arguments[3];i||(i=n?t[0]:t[t.length-1]);var s=new Array(Math.abs(e)).fill(i);return n?s.concat(t):t.concat(s)}function l(t,e){return(t+"").length*e}function u(t,e){return{x:Math.sin(t*ht)*e,y:Math.cos(t*ht)*e}}function c(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(Number.isNaN(t)||void 0===t||!Number.isFinite(t)||e&&t<0)}function h(t){var e=void 0,i=void 0,n=void 0;if(t instanceof Date)return new Date(t.getTime());if("object"!==(void 0===t?"undefined":Z(t))||null===t)return t;for(n in e=Array.isArray(t)?[]:{},t)i=t[n],e[n]=h(i);return e}function d(t,e){var i=void 0,n=void 0;return t<=e?(i=e-t,n=t):(i=t-e,n=e),[i,n]}function f(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-t.length;return i>0?t=o(t,i):e=o(e,i),[t,e]}function p(t,e){if(t)return t.length>e?t.slice(0,e-3)+"...":t}function m(t,e){for(var i=[],n=0;n255?255:t<0?0:t}function g(t,e){var i=pt(t),n=!1;"#"==i[0]&&(i=i.slice(1),n=!0);var s=parseInt(i,16),a=v((s>>16)+e),r=v((s>>8&255)+e);return(n?"#":"")+(v((255&s)+e)|r<<8|a<<16).toString(16)}function y(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function b(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg",t);for(var n in e){var s=e[n];if("inside"===n)y(s).appendChild(i);else if("around"===n){var a=y(s);a.parentNode.insertBefore(i,a),i.appendChild(a)}else"styles"===n?"object"===(void 0===s?"undefined":Z(s))&&Object.keys(s).map((function(t){i.style[t]=s[t]})):("className"===n&&(n="class"),"innerHTML"===n?i.textContent=s:i.setAttribute(n,s))}return i}function x(t,e,i,n){return b("stop",{inside:t,style:"stop-color: "+i,offset:e,"stop-opacity":n})}function k(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i={className:t,transform:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return e&&(i.inside=e),b("g",i)}function w(t){return b("path",{className:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d:t,styles:{stroke:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",fill:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none","stroke-width":arguments.length>4&&void 0!==arguments[4]?arguments[4]:2}})}function D(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="path-fill-gradient-"+e+"-"+(i?"lighter":"default"),s=function(t,e){return b("linearGradient",{inside:t,id:e,x1:0,x2:0,y1:0,y2:1})}(t,n),a=[1,.6,.2];return i&&(a=[.4,.2,0]),x(s,"0%",e,a[0]),x(s,"50%",e,a[1]),x(s,"100%",e,a[2]),n}function M(t,e,i,n,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},r={className:t,x:e,y:i,width:n,height:n,rx:s,fill:arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none"};return Object.keys(a).map((function(t){r[t]=a[t]})),b("rect",r)}function P(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=s.fontSize||yt;return b("text",{className:t,x:e,y:i,dy:(void 0!==s.dy?s.dy:a/2)+"px","font-size":a+"px",fill:s.fill||xt,"text-anchor":s.textAnchor||"start",innerHTML:n})}function S(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};s.stroke||(s.stroke=bt),s.lineType||(s.lineType=""),s.shortenNumbers&&(e=function(t){var e=void 0;if("number"==typeof t)e=t;else if("string"==typeof t&&(e=Number(t),Number.isNaN(e)))return t;var i=Math.floor(Math.log10(Math.abs(e)));if(i<=2)return e;var n=Math.floor(i/3),s=Math.pow(10,i-3*n)*+(e/Math.pow(10,i)).toFixed(1);return Math.round(100*s)/100+" "+["","K","M","B","T"][n]}(e));var a=b("line",{className:"line-horizontal "+s.className+("dashed"===s.lineType?"dashed":""),x1:i,x2:n,y1:0,y2:0,styles:{stroke:s.stroke}}),r=b("text",{x:i3&&void 0!==arguments[3]?arguments[3]:{};c(t)||(t=0),n.pos||(n.pos="bottom"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=bt),n.className||(n.className="");var s=i+mt,a="span"===n.mode?-1*mt:i;return"tick"===n.mode&&"top"===n.pos&&(s=-1*mt,a=0),function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};s.stroke||(s.stroke=bt);var a=b("line",{className:"line-vertical "+s.className,x1:0,x2:0,y1:i,y2:n,styles:{stroke:s.stroke}}),r=b("text",{x:0,y:i>n?i+vt:i-vt-yt,dy:yt+"px","font-size":yt+"px","text-anchor":"middle",innerHTML:e+""}),o=b("g",{transform:"translate("+t+", 0)"});return o.appendChild(a),o.appendChild(r),o}(t,e,s,a,{stroke:n.stroke,className:n.className,lineType:n.lineType})}function T(t,e,i,n){var s="string"==typeof e?e:e.join(", ");return[t,{transform:i.join(", ")},n,At,"translate",{transform:s}]}function O(t,e,i){return T(t,[0,i],[0,e],Pt)}function L(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=d(i,(arguments.length>5&&void 0!==arguments[5]?arguments[5]:{}).zeroLine),r=nt(a,2),o=r[0],l=r[1];return l-=s,"rect"!==t.nodeName?[[t.childNodes[0],{width:n,height:o},Dt,At],T(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,l],Pt)]:[[t,{width:n,height:o,x:e,y:l},Dt,At]]}function C(t,e){return[t,{d:e},Dt,At]}function N(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"linear",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=t.cloneNode(!0),o=t.cloneNode(!0);for(var l in e){var u=void 0;u="transform"===l?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");var c=a[l]||t.getAttribute(l),h=e[l],d={attributeName:l,from:c,to:h,begin:"0s",dur:i/1e3+"s",values:c+";"+h,keySplines:Tt[n],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};for(var f in s&&(d.type=s),d)u.setAttribute(f,d[f]);r.appendChild(u),s?o.setAttribute(l,"translate("+h+")"):o.setAttribute(l,h)}return[r,o]}function _(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e}function $(t,e){var i=[],n=[];e.map((function(t){var e,s,a=t[0],r=a.parentNode;t[0]=a;var o=N.apply(void 0,st(t)),l=nt(o,2);e=l[0],s=l[1],i.push(s),n.push([e,r]),r&&r.replaceChild(e,a)}));var s=t.cloneNode(!0);return n.map((function(t,n){t[1]&&(t[1].replaceChild(i[n],t[0]),e[n][0]=i[n])})),s}function E(e){var i=e.cloneNode(!0);i.classList.add("chart-container"),i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");var n=t.create("style",{innerHTML:Ot});i.insertBefore(n,i.firstChild);var s=t.create("div");return s.appendChild(i),s.innerHTML}function Y(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function W(t){var e=t.getDate(),i=t.getMonth()+1;return[t.getFullYear(),(i>9?"":"0")+i,(e>9?"":"0")+e].join("-")}function z(t){return new Date(t.getTime())}function H(t,e){var i=R(t);return Math.ceil(function(t,e){var i=$t*_t;return(Y(e)-Y(t))/i}(i,e)/Nt)}function F(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function j(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Et[t];return e?i.slice(0,3):i}function I(t,e){return new Date(e,t+1,0)}function R(t){var e=z(t),i=e.getDay();return 0!==i&&U(e,-1*i),e}function U(t,e){t.setDate(t.getDate()+e)}function V(t,e,i){var n=Object.keys(zt).filter((function(e){return t.includes(e)})),s=zt[n[0]];return Object.assign(s,{constants:e,getData:i}),new Wt(s)}function B(t){if(0===t)return[0,0];if(isNaN(t))return{mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return{mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var i=Math.floor(Math.log10(t));return[e*(t/Math.pow(10,i)),i]}function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=B(t),n=nt(i,2),s=n[0],a=n[1],r=e?e/Math.pow(10,a):0,o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Math.ceil(t),n=Math.floor(e),s=i-n,a=s,r=1;s>5&&(s%2!=0&&(s=++i-n),a=s/2,r=2),s<=2&&(r=s/(a=4)),0===s&&(a=5,r=1);for(var o=[],l=0;l<=a;l++)o.push(n+r*l);return o}(s=s.toFixed(6),r);return o.map((function(t){return t*Math.pow(10,a)}))}function q(t){return t[1]-t[0]}function J(t,e){return r(e.zeroLine-t*e.scaleMultiplier)}function X(t,e){return e.filter((function(e){return e\n\t\t\t\t
      \n\t\t\t\t
      '}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",(function(){e.hideTip()}))}},{key:"fill",value:function(){var e,i=this;this.index&&this.container.setAttribute("data-point-index",this.index),e=this.titleValueFirst?""+this.titleValue+""+this.titleName:this.titleName+""+this.titleValue+"",this.title.innerHTML=e,this.dataPointList.innerHTML="",this.listValues.map((function(e,n){var s=i.colors[n]||"black",a=0===e.formatted||e.formatted?e.formatted:e.value,r=t.create("li",{styles:{"border-top":"3px solid "+s},innerHTML:''+(0===a||a?a:"")+"\n\t\t\t\t\t"+(e.title?e.title:"")});i.dataPointList.appendChild(r)}))}},{key:"calcPosition",value:function(){var t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight-5,this.left=this.x-t/2;var e=this.parent.offsetWidth-t,i=this.container.querySelector(".svg-pointer");if(this.left<0)i.style.left="calc(50% - "+-1*this.left+"px)",this.left=0;else if(this.left>e){var n="calc(50% + "+(this.left-e)+"px)";i.style.left=n,this.left=e}else i.style.left="50%"}},{key:"setValues",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;this.titleName=i.name,this.titleValue=i.value,this.listValues=n,this.x=t,this.y=e,this.titleValueFirst=i.valueFirst||0,this.index=s,this.refresh()}},{key:"hideTip",value:function(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0"}},{key:"showTip",value:function(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1"}}]),e}(),ft={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"},pt=function(t){return/rgb[a]{0,1}\([\d, ]+\)/gim.test(t)?/\D+(\d*)\D+(\d*)\D+(\d*)/gim.exec(t).map((function(t,e){return 0!==e?Number(t).toString(16):"#"})).reduce((function(t,e){return""+t+e})):ft[t]||t},mt=6,vt=4,gt=15,yt=10,bt="#dadada",xt="#555b51",kt={bar:function(t){var e=void 0;"rect"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode();return i.style.fill="#000000",i.style.opacity="0.4",e&&i.setAttribute("transform",e),i},dot:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),s=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",s),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i},heat_square:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),s=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",s),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i}},wt={bar:function(t,e){var i=void 0;"rect"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["x","y","width","height"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)},dot:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)},heat_square:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)}},Dt=350,Mt=350,Pt=Dt,St=250,At="easein",Tt={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"},Ot=".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}",Lt=function(){function e(t,i){if(K(this,e),i=h(i),this.parent="string"==typeof t?document.querySelector(t):t,!(this.parent instanceof HTMLElement))throw new Error("No `parent` element to render on was provided.");this.rawChartArgs=i,this.title=i.title||"",this.type=i.type||"",this.realData=this.prepareData(i.data),this.data=this.prepareFirstData(this.realData),this.colors=this.validateColors(i.colors,this.type),this.config={showTooltip:1,showLegend:1,isNavigable:i.isNavigable||0,animate:void 0!==i.animate?i.animate:1,truncateLegends:i.truncateLegends||1},this.measures=JSON.parse(JSON.stringify(at));var n=this.measures;this.setMeasures(i),this.title.length||(n.titleHeight=0),this.config.showLegend||(n.legendHeight=0),this.argHeight=i.height||n.baseHeight,this.state={},this.options={},this.initTimeout=700,this.config.isNavigable&&(this.overlays=[]),this.configure(i)}return Q(e,[{key:"prepareData",value:function(t){return t}},{key:"prepareFirstData",value:function(t){return t}},{key:"validateColors",value:function(t,e){var i=[];return(t=(t||[]).concat(ct[e])).forEach((function(t){var e=pt(t);!function(t){return/(^\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i.test(t)||/(^\s*)(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/i.test(t)}(e)?console.warn('"'+t+'" is not a valid color.'):i.push(e)})),i}},{key:"setMeasures",value:function(){}},{key:"configure",value:function(){var t=this,e=this.argHeight;this.baseHeight=e,this.height=e-s(this.measures),this.boundDrawFn=function(){return t.draw(!0)},ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.boundDrawFn),this.resizeObserver.observe(this.parent)),window.addEventListener("resize",this.boundDrawFn),window.addEventListener("orientationchange",this.boundDrawFn)}},{key:"destroy",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),window.removeEventListener("resize",this.boundDrawFn),window.removeEventListener("orientationchange",this.boundDrawFn)}},{key:"setup",value:function(){this.makeContainer(),this.updateWidth(),this.makeTooltip(),this.draw(!1,!0)}},{key:"makeContainer",value:function(){this.parent.innerHTML="";var e={inside:this.parent,className:"chart-container"};this.independentWidth&&(e.styles={width:this.independentWidth+"px"}),this.container=t.create("div",e)}},{key:"makeTooltip",value:function(){this.tip=new dt({parent:this.container,colors:this.colors}),this.bindTooltip()}},{key:"bindTooltip",value:function(){}},{key:"draw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&function(t){return null===t.offsetParent}(this.parent)||(this.updateWidth(),this.calc(e),this.makeChartArea(),this.setupComponents(),this.components.forEach((function(e){return e.setup(t.drawArea)})),this.render(this.components,!1),i&&(this.data=this.realData,setTimeout((function(){t.update(t.data)}),this.initTimeout)),this.renderLegend(),this.setupNavigation(i))}},{key:"calc",value:function(){}},{key:"updateWidth",value:function(){this.baseWidth=function(t){var e=window.getComputedStyle(t),i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-i}(this.parent),this.width=this.baseWidth-a(this.measures)}},{key:"makeChartArea",value:function(){this.svg&&this.container.removeChild(this.svg);var t=this.measures;this.svg=function(t,e,i,n){return b("svg",{className:e,inside:t,width:i,height:n})}(this.container,"frappe-chart chart",this.baseWidth,this.baseHeight),this.svgDefs=function(t){return b("defs",{inside:t})}(this.svg),this.title.length&&(this.titleEL=P("title",t.margins.left,t.margins.top,this.title,{fontSize:t.titleFontSize,fill:"#666666",dy:t.titleFontSize}));var e=i(t);this.drawArea=k(this.type+"-chart chart-draw-area","translate("+n(t)+", "+e+")"),this.config.showLegend&&(e+=this.height+t.paddings.bottom,this.legendArea=k("chart-legend","translate("+n(t)+", "+e+")")),this.title.length&&this.svg.appendChild(this.titleEL),this.svg.appendChild(this.drawArea),this.config.showLegend&&this.svg.appendChild(this.legendArea),this.updateTipOffset(n(t),i(t))}},{key:"updateTipOffset",value:function(t,e){this.tip.offset={x:t,y:e}}},{key:"setupComponents",value:function(){this.components=new Map}},{key:"update",value:function(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.calc(),this.render(this.components,this.config.animate),this.renderLegend()}},{key:"render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.components,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.config.isNavigable&&this.overlays.map((function(t){return t.parentNode.removeChild(t)}));var n=[];e.forEach((function(t){n=n.concat(t.update(i))})),n.length>0?(function(t,e,i){if(0!==i.length){var n=$(e,i);e.parentNode==t&&(t.removeChild(e),t.appendChild(n)),setTimeout((function(){n.parentNode==t&&(t.removeChild(n),t.appendChild(e))}),St)}}(this.container,this.svg,n),setTimeout((function(){e.forEach((function(t){return t.make()})),t.updateNav()}),400)):(e.forEach((function(t){return t.make()})),this.updateNav())}},{key:"updateNav",value:function(){this.config.isNavigable&&(this.makeOverlay(),this.bindUnits())}},{key:"renderLegend",value:function(){}},{key:"setupNavigation",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.config.isNavigable&&e&&(this.bindOverlay(),this.keyActions={13:this.onEnterKey.bind(this),37:this.onLeftArrow.bind(this),38:this.onUpArrow.bind(this),39:this.onRightArrow.bind(this),40:this.onDownArrow.bind(this)},document.addEventListener("keydown",(function(e){(function(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)})(t.container)&&(e=e||window.event,t.keyActions[e.keyCode]&&t.keyActions[e.keyCode]())})))}},{key:"makeOverlay",value:function(){}},{key:"updateOverlay",value:function(){}},{key:"bindOverlay",value:function(){}},{key:"bindUnits",value:function(){}},{key:"onLeftArrow",value:function(){}},{key:"onRightArrow",value:function(){}},{key:"onUpArrow",value:function(){}},{key:"onDownArrow",value:function(){}},{key:"onEnterKey",value:function(){}},{key:"addDataPoint",value:function(){}},{key:"removeDataPoint",value:function(){}},{key:"getDataPoint",value:function(){}},{key:"setCurrentDataPoint",value:function(){}},{key:"updateDataset",value:function(){}},{key:"export",value:function(){var t=E(this.svg);!function(t,e){var i=document.createElement("a");i.style="display: none";var n=new Blob(e,{type:"image/svg+xml; charset=utf-8"}),s=window.URL.createObjectURL(n);i.href=s,i.download=t,document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i),window.URL.revokeObjectURL(s)}),300)}(this.title||"Chart",[t])}}]),e}(),Ct=function(t){function e(t,i){return K(this,e),it(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i))}return et(e,t),Q(e,[{key:"configure",value:function(t){tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this,t),this.config.formatTooltipY=(t.tooltipOptions||{}).formatTooltipY,this.config.maxSlices=t.maxSlices||20,this.config.maxLegendPoints=t.maxLegendPoints||20}},{key:"calc",value:function(){var t=this,e=this.state,i=this.config.maxSlices;e.sliceTotals=[];var n=this.data.labels.map((function(e,i){var n=0;return t.data.datasets.map((function(t){n+=t.values[i]})),[n,e]})).filter((function(t){return t[0]>=0})),s=n;if(n.length>i){n.sort((function(t,e){return e[0]-t[0]})),s=n.slice(0,i-1);var a=0;n.slice(i-1).map((function(t){a+=t[0]})),s.push([a,"Rest"]),this.colors[i-1]="grey"}e.labels=[],s.map((function(t){e.sliceTotals.push(function(t){return Number(Math.round(t+"e4")+"e-4")}(t[0])),e.labels.push(t[1])})),e.grandTotal=e.sliceTotals.reduce((function(t,e){return t+e}),0),this.center={x:this.width/2,y:this.height/2}}},{key:"renderLegend",value:function(){var t=this,e=this.state;this.legendArea.textContent="",this.legendTotals=e.sliceTotals.slice(0,this.config.maxLegendPoints);var i=0,n=0;this.legendTotals.map((function(s,r){var o=150,l=Math.floor((t.width-a(t.measures))/o);t.legendTotals.lengthl&&(i=0,n+=20);var u=o*i+5,c=t.config.truncateLegends?p(e.labels[r],o/10):e.labels[r],h=t.config.formatTooltipY?t.config.formatTooltipY(s):s,d=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",s=arguments[4];s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?p(s,gt):s;var a={className:"legend-dot",cx:0,cy:0,r:i,fill:n},r=b("text",{className:"legend-dataset-text",x:0,y:0,dx:yt+"px",dy:yt/3+"px","font-size":1.2*yt+"px","text-anchor":"start",fill:xt,innerHTML:s}),o=b("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(b("circle",a)),o.appendChild(r),o}(u,n,5,t.colors[r],c+": "+h,!1);t.legendArea.appendChild(d),i++}))}}]),e}(Lt),Nt=7,_t=1e3,$t=86400,Et=["January","February","March","April","May","June","July","August","September","October","November","December"],Yt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Wt=function(){function t(e){var i=e.layerClass,n=void 0===i?"":i,s=e.layerTransform,a=void 0===s?"":s,r=e.constants,o=e.getData,l=e.makeElements,u=e.animateElements;K(this,t),this.layerTransform=a,this.constants=r,this.makeElements=l,this.getData=o,this.animateElements=u,this.store=[],this.labels=[],this.layerClass=n,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh()}return Q(t,[{key:"refresh",value:function(t){this.data=t||this.getData()}},{key:"setup",value:function(t){this.layer=k(this.layerClass,this.layerTransform,t)}},{key:"make",value:function(){this.render(this.data),this.oldData=this.data}},{key:"render",value:function(t){var e=this;this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach((function(t){e.layer.appendChild(t)})),this.labels.forEach((function(t){e.layer.appendChild(t)}))}},{key:"update",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.refresh();var e=[];return t&&(e=this.animateElements(this.data)||[]),e}}]),t}(),zt={donutSlices:{layerClass:"donut-slices",makeElements:function(t){return t.sliceStrings.map((function(e,i){var n=w(e,"donut-path",t.colors[i],"none",t.strokeWidth);return n.style.transition="transform .3s;",n}))},animateElements:function(t){return this.store.map((function(e,i){return C(e,t.sliceStrings[i])}))}},pieSlices:{layerClass:"pie-slices",makeElements:function(t){return t.sliceStrings.map((function(e,i){var n=w(e,"pie-path","none",t.colors[i]);return n.style.transition="transform .3s;",n}))},animateElements:function(t){return this.store.map((function(e,i){return C(e,t.sliceStrings[i])}))}},percentageBars:{layerClass:"percentage-bars",makeElements:function(t){var e=this;return t.xPositions.map((function(i,n){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ot,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none";return b("rect",{className:"percentage-bar",x:t,y:e,width:i,height:n,fill:a,styles:{stroke:g(a,-25),"stroke-dasharray":"0, "+(n+i)+", "+i+", "+n,"stroke-width":s}})}(i,0,t.widths[n],e.constants.barHeight,e.constants.barDepth,t.colors[n])}))},animateElements:function(t){if(t)return[]}},yAxis:{layerClass:"y axis",makeElements:function(t){var e=this;return t.positions.map((function(i,n){return function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};c(t)||(t=0),n.pos||(n.pos="left"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=bt),n.className||(n.className="");var s=-1*mt,a="span"===n.mode?i+mt:0;return"tick"===n.mode&&"right"===n.pos&&(s=i+mt,a=i),S(t,e,s+=n.offset,a+=n.offset,{stroke:n.stroke,className:n.className,lineType:n.lineType,shortenNumbers:n.shortenNumbers})}(i,t.labels[n],e.constants.width,{mode:e.constants.mode,pos:e.constants.pos,shortenNumbers:e.constants.shortenNumbers})}))},animateElements:function(t){var e=t.positions,i=t.labels,n=this.oldData.positions,s=this.oldData.labels,a=f(n,e),r=nt(a,2);n=r[0],e=r[1];var o=f(s,i),l=nt(o,2);return s=l[0],i=l[1],this.render({positions:n,labels:i}),this.store.map((function(t,i){return O(t,e[i],n[i])}))}},xAxis:{layerClass:"x axis",makeElements:function(t){var e=this;return t.positions.map((function(i,n){return A(i,t.calcLabels[n],e.constants.height,{mode:e.constants.mode,pos:e.constants.pos})}))},animateElements:function(t){var e=t.positions,i=t.calcLabels,n=this.oldData.positions,s=this.oldData.calcLabels,a=f(n,e),r=nt(a,2);n=r[0],e=r[1];var o=f(s,i),l=nt(o,2);return s=l[0],i=l[1],this.render({positions:n,calcLabels:i}),this.store.map((function(t,i){return function(t,e,i){return T(t,[i,0],[e,0],Pt)}(t,e[i],n[i])}))}},yMarkers:{layerClass:"y-markers",makeElements:function(t){var e=this;return t.map((function(t){return function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.labelPos||(n.labelPos="right");var s=b("text",{className:"chart-label",x:"left"===n.labelPos?vt:i-l(e,5)-vt,y:0,dy:yt/-2+"px","font-size":yt+"px","text-anchor":"start",innerHTML:e+""}),a=S(t,"",0,i,{stroke:n.stroke||bt,className:n.className||"",lineType:n.lineType});return a.appendChild(s),a}(t.position,t.label,e.constants.width,{labelPos:t.options.labelPos,mode:"span",lineType:"dashed"})}))},animateElements:function(t){var e=f(this.oldData,t),i=nt(e,2);this.oldData=i[0];var n=(t=i[1]).map((function(t){return t.position})),s=t.map((function(t){return t.label})),a=t.map((function(t){return t.options})),r=this.oldData.map((function(t){return t.position}));return this.render(r.map((function(t,e){return{position:r[e],label:s[e],options:a[e]}}))),this.store.map((function(t,e){return O(t,n[e],r[e])}))}},yRegions:{layerClass:"y-regions",makeElements:function(t){var e=this;return t.map((function(t){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=t-e,r=b("rect",{className:"bar mini",styles:{fill:"rgba(228, 234, 239, 0.49)",stroke:bt,"stroke-dasharray":i+", "+a},x:0,y:0,width:i,height:a});s.labelPos||(s.labelPos="right");var o=b("text",{className:"chart-label",x:"left"===s.labelPos?vt:i-l(n+"",4.5)-vt,y:0,dy:yt/-2+"px","font-size":yt+"px","text-anchor":"start",innerHTML:n+""}),u=b("g",{transform:"translate(0, "+e+")"});return u.appendChild(r),u.appendChild(o),u}(t.startPos,t.endPos,e.constants.width,t.label,{labelPos:t.options.labelPos})}))},animateElements:function(t){var e=f(this.oldData,t),i=nt(e,2);this.oldData=i[0];var n=(t=i[1]).map((function(t){return t.endPos})),s=t.map((function(t){return t.label})),a=t.map((function(t){return t.startPos})),r=t.map((function(t){return t.options})),o=this.oldData.map((function(t){return t.endPos})),l=this.oldData.map((function(t){return t.startPos}));this.render(o.map((function(t,e){return{startPos:l[e],endPos:o[e],label:s[e],options:r[e]}})));var u=[];return this.store.map((function(t,e){u=u.concat(function(t,e,i,n){var s=e-i,a=t.childNodes[0];return[[a,{height:s,"stroke-dasharray":a.getAttribute("width")+", "+s},Pt,At],T(t,[0,n],[0,i],Pt)]}(t,a[e],n[e],o[e]))})),u}},heatDomain:{layerClass:function(){return"heat-domain domain-"+this.constants.index},makeElements:function(t){var e=this,i=this.constants,n=i.index,s=i.colWidth,a=i.rowHeight,r=i.squareSize,o=i.radius,l=i.xTranslate,u=0;return this.serializedSubDomains=[],t.cols.map((function(t,i){1===i&&e.labels.push(P("domain-name",l,-12,j(n,!0).toUpperCase(),{fontSize:9})),t.map((function(t,i){if(t.fill){var n={"data-date":t.yyyyMmDd,"data-value":t.dataValue,"data-day":i},s=M("day",l,u,r,o,t.fill,n);e.serializedSubDomains.push(s)}u+=a})),u=0,l+=s})),this.serializedSubDomains},animateElements:function(t){if(t)return[]}},barGraph:{layerClass:function(){return"dataset-units dataset-bars dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="bar",this.units=t.yPositions.map((function(i,n){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},l=d(e,o.zeroLine),u=nt(l,2),h=u[0],f=u[1];f-=r,0===h&&(h=o.minHeight,f-=o.minHeight),c(t)||(t=0),c(f)||(f=0),c(h,!0)||(h=0),c(i,!0)||(i=0);var p=b("rect",{className:"bar mini",style:"fill: "+n,"data-point-index":a,x:t,y:f,width:i,height:h});if((s+="")||s.length){p.setAttribute("y",0),p.setAttribute("x",0);var m=b("text",{className:"data-point-value",x:i/2,y:0,dy:yt/2*-1+"px","font-size":yt+"px","text-anchor":"middle",innerHTML:s}),v=b("g",{"data-point-index":a,transform:"translate("+t+", "+f+")"});return v.appendChild(p),v.appendChild(m),v}return p}(t.xPositions[n],i,t.barWidth,e.color,t.labels[n],n,t.offsets[n],{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})})),this.units},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.offsets,s=t.labels,a=this.oldData.xPositions,r=this.oldData.yPositions,o=this.oldData.offsets,l=this.oldData.labels,u=f(a,e),c=nt(u,2);a=c[0],e=c[1];var h=f(r,i),d=nt(h,2);r=d[0],i=d[1];var p=f(o,n),m=nt(p,2);o=m[0],n=m[1];var v=f(l,s),g=nt(v,2);l=g[0],s=g[1],this.render({xPositions:a,yPositions:r,offsets:o,labels:s,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});var y=[];return this.store.map((function(s,a){y=y.concat(L(s,e[a],i[a],t.barWidth,n[a],{zeroLine:t.zeroLine}))})),y}},lineGraph:{layerClass:function(){return"dataset-units dataset-line dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="dot",this.paths={},e.hideLine||(this.paths=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=e.map((function(e,i){return t[i]+","+e})).join("L");n.spline&&(a=m(t,e));var r=w("M"+a,"line-graph-path",i);if(n.heatline){var o=D(s.svgDefs,i);r.style.stroke="url(#"+o+")"}var l={path:r};if(n.regionFill){var u=D(s.svgDefs,i,!0),c="M"+t[0]+","+s.zeroLine+"L"+a+"L"+t.slice(-1)[0]+","+s.zeroLine;l.region=w(c,"region-fill","none","url(#"+u+")")}return l}(t.xPositions,t.yPositions,e.color,{heatline:e.heatline,regionFill:e.regionFill,spline:e.spline},{svgDefs:e.svgDefs,zeroLine:t.zeroLine})),this.units=[],e.hideDots||(this.units=t.yPositions.map((function(i,n){return function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=b("circle",{style:"fill: "+n,"data-point-index":a,cx:t,cy:e,r:i});if((s+="")||s.length){r.setAttribute("cy",0),r.setAttribute("cx",0);var o=b("text",{className:"data-point-value",x:0,y:0,dy:yt/2*-1-i+"px","font-size":yt+"px","text-anchor":"middle",innerHTML:s}),l=b("g",{"data-point-index":a,transform:"translate("+t+", "+e+")"});return l.appendChild(r),l.appendChild(o),l}return r}(t.xPositions[n],i,t.radius,e.color,e.valuesOverPoints?t.values[n]:"",n)}))),Object.values(this.paths).concat(this.units)},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.values,s=this.oldData.xPositions,a=this.oldData.yPositions,r=this.oldData.values,o=f(s,e),l=nt(o,2);s=l[0],e=l[1];var u=f(a,i),c=nt(u,2);a=c[0],i=c[1];var h=f(r,n),d=nt(h,2);r=d[0],n=d[1],this.render({xPositions:s,yPositions:a,values:n,zeroLine:this.oldData.zeroLine,radius:this.oldData.radius});var p=[];return Object.keys(this.paths).length&&(p=p.concat(function(t,e,i,n,s){var a=[],r=i.map((function(t,i){return e[i]+","+t})).join("L");s&&(r=m(e,i));var o=[t.path,{d:"M"+r},Mt,At];if(a.push(o),t.region){var l=e[0]+","+n+"L",u="L"+e.slice(-1)[0]+", "+n,c=[t.region,{d:"M"+l+r+u},Mt,At];a.push(c)}return a}(this.paths,e,i,t.zeroLine,this.constants.spline))),this.units.length&&this.units.map((function(t,n){p=p.concat(function(t,e,i){return"circle"!==t.nodeName?[T(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,i],Pt)]:[[t,{cx:e,cy:i},Dt,At]]}(t,e[n],i[n]))})),p}}},Ht=function(t){function i(t,e){K(this,i);var n=it(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="percentage",n.setup(),n}return et(i,t),Q(i,[{key:"setMeasures",value:function(t){var e=this.measures;this.barOptions=t.barOptions||{};var i=this.barOptions;i.height=i.height||20,i.depth=i.depth||ot,e.paddings.right=30,e.legendHeight=60,e.baseHeight=8*(i.height+.5*i.depth)}},{key:"setupComponents",value:function(){var t=this.state,e=[["percentageBars",{barHeight:this.barOptions.height,barDepth:this.barOptions.depth},function(){return{xPositions:t.xPositions,widths:t.widths,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=V.apply(void 0,st(t));return[t[0],e]})))}},{key:"calc",value:function(){var t=this;tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;e.xPositions=[],e.widths=[];var n=0;e.sliceTotals.map((function(i){var s=t.width*i/e.grandTotal;e.widths.push(s),e.xPositions.push(n),n+=s}))}},{key:"makeDataByIndex",value:function(){}},{key:"bindTooltip",value:function(){var t=this,i=this.state;this.container.addEventListener("mousemove",(function(n){var s=t.components.get("percentageBars").store,a=n.target;if(s.includes(a)){var r=s.indexOf(a),o=e(t.container),l=e(a),u=l.left-o.left+parseInt(a.getAttribute("width"))/2,c=l.top-o.top,h=(t.formattedLabels&&t.formattedLabels.length>0?t.formattedLabels[r]:t.state.labels[r])+": ",d=i.sliceTotals[r]/i.grandTotal;t.tip.setValues(u,c,{name:h,value:(100*d).toFixed(1)+"%"}),t.tip.showTip()}}))}}]),i}(Ct),Ft=function(t){function i(t,e){K(this,i);var n=it(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="pie",n.initTimeout=0,n.init=1,n.setup(),n}return et(i,t),Q(i,[{key:"configure",value:function(t){tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1}},{key:"calc",value:function(){var t=this;tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x:this.center.y;var n=this.radius,s=this.clockWise,a=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map((function(i,o){var l=r,c=i/e.grandTotal*360,h=c>180?1:0,d=s?-c:c,f=r+=d,p=u(l,n),m=u(f,n),v=t.init&&a[o],g=void 0,y=void 0;t.init?(g=v?v.startPosition:p,y=v?v.endPosition:p):(g=p,y=m);var b=360===c?function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*i.y,c=i.y+e.y;return"M"+i.x+" "+i.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+u+" z\n\t\tL"+r+" "+u+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+c+" z"}(g,y,t.center,t.radius,s,h):function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=i.y+e.y;return"M"+i.x+" "+i.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+u+" z"}(g,y,t.center,t.radius,s,h);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:p,endPosition:m,value:i,total:e.grandTotal,startAngle:l,endAngle:f,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["pieSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=V.apply(void 0,st(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=u(t.startAngle+t.angle/2,e);return"translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,s){if(t){var a=this.colors[i];if(n){_(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.fill=g(a,50);var r=e(this.svg),o=s.pageX-r.left+10,l=s.pageY-r.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",c=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:c+"%"}),this.tip.showTip()}else _(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.fill=a}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("pieSlices").store,n=this.curActiveSliceIndex,s=this.curActiveSlice;if(i.includes(e)){var a=i.indexOf(e);this.hoverSlice(s,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=a,this.hoverSlice(e,a,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),i}(Ct),jt=function(t){function e(t,i){K(this,e);var n=it(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));n.type="heatmap",n.countLabel=i.countLabel||"";var s=["Sunday","Monday"],a=s.includes(i.startSubDomain)?i.startSubDomain:"Sunday";return n.startSubDomainIndex=s.indexOf(a),n.setup(),n}return et(e,t),Q(e,[{key:"setMeasures",value:function(t){var e=this.measures;this.discreteDomains=0===t.discreteDomains?0:1,e.paddings.top=36,e.paddings.bottom=0,e.legendHeight=24,e.baseHeight=12*Nt+s(e);var i=this.data,n=this.discreteDomains?12:0;this.independentWidth=12*(H(i.start,i.end)+n)+a(e)}},{key:"updateWidth",value:function(){var t=this.discreteDomains?12:0,e=this.state.noOfWeeks?this.state.noOfWeeks:52;this.baseWidth=12*(e+t)+a(this.measures)}},{key:"prepareData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;if(t.start&&t.end&&t.start>t.end)throw new Error("Start date cannot be greater than end date.");if(t.start||(t.start=new Date,t.start.setFullYear(t.start.getFullYear()-1)),t.end||(t.end=new Date),t.dataPoints=t.dataPoints||{},parseInt(Object.keys(t.dataPoints)[0])>1e5){var e={};Object.keys(t.dataPoints).forEach((function(i){var n=new Date(i*_t);e[W(n)]=t.dataPoints[i]})),t.dataPoints=e}return t}},{key:"calc",value:function(){var t=this.state;t.start=z(this.data.start),t.end=z(this.data.end),t.firstWeekStart=z(t.start),t.noOfWeeks=H(t.start,t.end),t.distribution=function(t,e){for(var i=Math.max.apply(Math,st(t)),n=1/(e-1),s=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:"",i=[t.getMonth(),t.getFullYear()],n=i[0],s=i[1],a=R(t),r={index:n,cols:[]};U(e=z(e)||I(n,s),1);for(var o=H(a,e),l=[],u=void 0,c=0;c2&&void 0!==arguments[2]&&arguments[2],n=this.state,s=z(t),a=[],r=0;r=n.start&&s<=n.end;i||s.getMonth()!==e||!l?o.yyyyMmDd=W(s):o=this.getSubDomainConfig(s),a.push(o)}return a}},{key:"getSubDomainConfig",value:function(t){var e=W(t),i=this.data.dataPoints[e];return{yyyyMmDd:e,dataValue:i||0,fill:this.colors[X(i,this.state.distribution)]}}}]),e}(Lt),It=function(t){function s(t,e){K(this,s);var i=it(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t,e));return i.barOptions=e.barOptions||{},i.lineOptions=e.lineOptions||{},i.type=e.type||"line",i.init=1,i.setup(),i}return et(s,t),Q(s,[{key:"setMeasures",value:function(){this.data.datasets.length<=1&&(this.config.showLegend=0,this.measures.paddings.bottom=30)}},{key:"configure",value:function(t){tt(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"configure",this).call(this,t),t.axisOptions=t.axisOptions||{},t.tooltipOptions=t.tooltipOptions||{},this.config.xAxisMode=t.axisOptions.xAxisMode||"span",this.config.yAxisMode=t.axisOptions.yAxisMode||"span",this.config.xIsSeries=t.axisOptions.xIsSeries||0,this.config.shortenYAxisNumbers=t.axisOptions.shortenYAxisNumbers||0,this.config.formatTooltipX=t.tooltipOptions.formatTooltipX,this.config.formatTooltipY=t.tooltipOptions.formatTooltipY,this.config.valuesOverPoints=t.valuesOverPoints}},{key:"prepareData",value:function(){return function(t,e){t.labels=t.labels||[];var i=t.labels.length,n=t.datasets,s=new Array(i).fill(0);return n||(n=[{values:s}]),n.map((function(t){if(t.values){var n=t.values;n=(n=n.map((function(t){return isNaN(t)?0:t}))).length>i?n.slice(0,i):o(n,i-n.length,0),t.values=n}else t.values=s;t.chartType||(rt.includes(e),t.chartType=e)})),t.yRegions&&t.yRegions.map((function(t){if(t.end0&&void 0!==arguments[0]?arguments[0]:this.data,this.type)}},{key:"prepareFirstData",value:function(){return function(t){var e=t.labels.length,i=new Array(e).fill(0),n={labels:t.labels.slice(0,-1),datasets:t.datasets.map((function(t){return{name:"",values:i.slice(0,-1),chartType:t.chartType}}))};return t.yMarkers&&(n.yMarkers=[{value:0,label:""}]),t.yRegions&&(n.yRegions=[{start:0,end:0,label:""}]),n}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data)}},{key:"calc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calcXPositions(),t||this.calcYAxisParameters(this.getAllYValues(),"line"===this.type),this.makeDataByIndex()}},{key:"calcXPositions",value:function(){var t=this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map((function(e,i){return r(t.xOffset+i*t.unitWidth)}))}}},{key:"calcYAxisParameters",value:function(t){var e=function(t){function e(t,e){for(var i=G(t),n=i[1]-i[0],s=0,a=1;s1&&void 0!==arguments[1]&&arguments[1],n=Math.max.apply(Math,st(t)),s=Math.min.apply(Math,st(t)),a=[];if(n>=0&&s>=0)B(n)[1],a=i?G(n,s):G(n);else if(n>0&&s<0){var r=Math.abs(s);n>=r?(B(n)[1],a=e(n,r)):(B(r)[1],a=e(r,n).reverse().map((function(t){return-1*t})))}else if(n<=0&&s<=0){var o=Math.abs(s),l=Math.abs(n);B(o)[1],a=(a=i?G(o,l):G(o)).reverse().map((function(t){return-1*t}))}return a}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"false"),i=this.height/function(t){return t[t.length-1]-t[0]}(e),n=q(e)*i,s=this.height-function(t){var e=q(t);return t.indexOf(0)>=0?t.indexOf(0):t[0]>0?-1*t[0]/e:-1*t[t.length-1]/e+(t.length-1)}(e)*n;this.state.yAxis={labels:e,positions:e.map((function(t){return s-t*i})),scaleMultiplier:i,zeroLine:s},this.calcDatasetPoints(),this.calcYExtremes(),this.calcYRegions()}},{key:"calcDatasetPoints",value:function(){var t=this.state,e=function(e){return e.map((function(e){return J(e,t.yAxis)}))};t.datasets=this.data.datasets.map((function(t,i){var n=t.values,s=t.cumulativeYs||[];return{name:t.name&&t.name.replace(/<|>|&/g,(function(t){return"&"==t?"&":"<"==t?"<":">"})),index:i,chartType:t.chartType,values:n,yPositions:e(n),cumulativeYs:s,cumulativeYPos:e(s)}}))}},{key:"calcYExtremes",value:function(){var t=this.state;this.barOptions.stacked?t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos:(t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map((function(e){e.yPositions.map((function(e,i){e1&&void 0!==arguments[1]?arguments[1]:[],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t/e.length;n<=0&&(n=1);var s=n/lt,a=void 0;if(i){var r=Math.max.apply(Math,st(e.map((function(t){return t.length}))));a=Math.ceil(r/s)}return e.map((function(t,e){return(t+="").length>s&&(i?e%a!=0&&(t=""):t=s-3>0?t.slice(0,s-3)+" ...":t.slice(0,s)+".."),t}))}(this.width,t.xAxis.labels,this.config.xIsSeries),t.xAxis}.bind(this)],["yRegions",{width:this.width,pos:"right"},function(){return this.state.yRegions}.bind(this)]],i=this.state.datasets.filter((function(t){return"bar"===t.chartType})),n=this.state.datasets.filter((function(t){return"line"===t.chartType})),s=i.map((function(e){var n=e.index;return["barGraph-"+e.index,{index:n,color:t.colors[n],stacked:t.barOptions.stacked,valuesOverPoints:t.config.valuesOverPoints,minHeight:0*t.height},function(){var t=this.state,e=t.datasets[n],s=this.barOptions.stacked,a=this.barOptions.spaceRatio||.5,r=t.unitWidth*(1-a),o=r/(s?1:i.length),l=t.xAxis.positions.map((function(t){return t-r/2}));s||(l=l.map((function(t){return t+o*n})));var u=new Array(t.datasetLength).fill("");this.config.valuesOverPoints&&(u=s&&e.index===t.datasets.length-1?e.cumulativeYs:e.values);var c=new Array(t.datasetLength).fill(0);return s&&(c=e.yPositions.map((function(t,i){return t-e.cumulativeYPos[i]}))),{xPositions:l,yPositions:e.yPositions,offsets:c,labels:u,zeroLine:t.yAxis.zeroLine,barsWidth:r,barWidth:o}}.bind(t)]})),a=n.map((function(e){var i=e.index;return["lineGraph-"+e.index,{index:i,color:t.colors[i],svgDefs:t.svgDefs,heatline:t.lineOptions.heatline,regionFill:t.lineOptions.regionFill,spline:t.lineOptions.spline,hideDots:t.lineOptions.hideDots,hideLine:t.lineOptions.hideLine,valuesOverPoints:t.config.valuesOverPoints},function(){var t=this.state,e=t.datasets[i],n=t.yAxis.positions[0]i(a)?t.mapTooltipXPosition(o):t.tip.hideTip()}))}},{key:"mapTooltipXPosition",value:function(t){var e=this.state;if(e.yExtremes){var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.reduce((function(e,i){return Math.abs(i-t)=0){var n=this.dataByIndex[i];this.tip.setValues(n.xPos+this.tip.offset.x,n.yExtreme+this.tip.offset.y,{name:n.formattedLabel,value:""},n.values,i),this.tip.showTip()}}}},{key:"renderLegend",value:function(){var t=this,e=this.data;e.datasets.length>1&&(this.legendArea.textContent="",e.datasets.map((function(e,i){var n=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",s=arguments[4];s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?p(s,gt):s;var a={className:"legend-bar",x:0,y:0,width:i,height:"2px",fill:n},r=b("text",{className:"legend-dataset-text",x:0,y:0,dy:2*yt+"px","font-size":1.2*yt+"px","text-anchor":"start",fill:xt,innerHTML:s}),o=b("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(b("rect",a)),o.appendChild(r),o}(100*i,"0",100,t.colors[i],e.name,t.config.truncateLegends);t.legendArea.appendChild(n)})))}},{key:"makeOverlay",value:function(){var t=this;this.init?this.init=0:(this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)})),this.overlayGuides=this.dataUnitComponents.map((function(t){return{type:t.unitType,overlay:void 0,units:t.units}})),void 0===this.state.currentIndex&&(this.state.currentIndex=this.state.datasetLength-1),this.overlayGuides.map((function(e){var i=e.units[t.state.currentIndex];e.overlay=kt[e.type](i),t.drawArea.appendChild(e.overlay)})))}},{key:"updateOverlayGuides",value:function(){this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)}))}},{key:"bindOverlay",value:function(){var t=this;this.parent.addEventListener("data-select",(function(){t.updateOverlay()}))}},{key:"bindUnits",value:function(){var t=this;this.dataUnitComponents.map((function(e){e.units.map((function(e){e.addEventListener("click",(function(){var i=e.getAttribute("data-point-index");t.setCurrentDataPoint(i)}))}))})),this.tip.container.addEventListener("click",(function(){var e=t.tip.container.getAttribute("data-point-index");t.setCurrentDataPoint(e)}))}},{key:"updateOverlay",value:function(){var t=this;this.overlayGuides.map((function(e){var i=e.units[t.state.currentIndex];wt[e.type](i,e.overlay)}))}},{key:"onLeftArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex-1)}},{key:"onRightArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex+1)}},{key:"getDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentIndex,e=this.state;return{index:t,label:e.xAxis.labels[t],values:e.datasets.map((function(e){return e.values[t]}))}}},{key:"setCurrentDataPoint",value:function(t){var e=this.state;(t=parseInt(t))<0&&(t=0),t>=e.xAxis.labels.length&&(t=e.xAxis.labels.length-1),t!==e.currentIndex&&(e.currentIndex=t,function(t,e,i){var n=document.createEvent("HTMLEvents");for(var s in n.initEvent(e,!0,!0),i)n[s]=i[s];t.dispatchEvent(n)}(this.parent,"data-select",this.getDataPoint()))}},{key:"addDataPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.state.datasetLength;tt(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"addDataPoint",this).call(this,t,e,i),this.data.labels.splice(i,0,t),this.data.datasets.map((function(t,n){t.values.splice(i,0,e[n])})),this.update(this.data)}},{key:"removeDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.datasetLength-1;this.data.labels.length<=1||(tt(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"removeDataPoint",this).call(this,t),this.data.labels.splice(t,1),this.data.datasets.map((function(e){e.values.splice(t,1)})),this.update(this.data))}},{key:"updateDataset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.data.datasets[e].values=t,this.update(this.data)}},{key:"updateDatasets",value:function(t){this.data.datasets.map((function(e,i){t[i]&&(e.values=t[i])})),this.update(this.data)}}]),s}(Lt),Rt=function(t){function i(t,e){K(this,i);var n=it(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="donut",n.initTimeout=0,n.init=1,n.setup(),n}return et(i,t),Q(i,[{key:"configure",value:function(t){tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1,this.strokeWidth=t.strokeWidth||30}},{key:"calc",value:function(){var t=this;tt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x-this.strokeWidth/2:this.center.y-this.strokeWidth/2;var n=this.radius,s=this.clockWise,a=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map((function(i,o){var l=r,c=i/e.grandTotal*360,h=c>180?1:0,d=s?-c:c,f=r+=d,p=u(l,n),m=u(f,n),v=t.init&&a[o],g=void 0,y=void 0;t.init?(g=v?v.startPosition:p,y=v?v.endPosition:p):(g=p,y=m);var b=360===c?function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*n+o;return"M"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+u+"\n\t\tM"+r+" "+u+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+(i.y+t.y)}(g,y,t.center,t.radius,t.clockWise,h):function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return"M"+(i.x+t.x)+" "+(i.y+t.y)+"\n\t\tA "+n+" "+n+" 0 "+a+" "+(s?1:0)+"\n\t\t"+(i.x+e.x)+" "+(i.y+e.y)}(g,y,t.center,t.radius,t.clockWise,h);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:p,endPosition:m,value:i,total:e.grandTotal,startAngle:l,endAngle:f,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["donutSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors,strokeWidth:this.strokeWidth}}.bind(this)]];this.components=new Map(e.map((function(t){var e=V.apply(void 0,st(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=u(t.startAngle+t.angle/2,e);return"translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,s){if(t){var a=this.colors[i];if(n){_(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.stroke=g(a,50);var r=e(this.svg),o=s.pageX-r.left+10,l=s.pageY-r.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",c=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:c+"%"}),this.tip.showTip()}else _(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.stroke=a}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("donutSlices").store,n=this.curActiveSliceIndex,s=this.curActiveSlice;if(i.includes(e)){var a=i.indexOf(e);this.hoverSlice(s,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=a,this.hoverSlice(e,a,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),i}(Ct),Ut={bar:It,line:It,percentage:Ht,heatmap:jt,pie:Ft,donut:Rt},Vt=Object.freeze({Chart:function t(e,i){return K(this,t),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"line",e=arguments[1],i=arguments[2];return"axis-mixed"===t?(i.type="line",new It(e,i)):Ut[t]?new Ut[t](e,i):void console.error("Undefined chart type: "+t)}(i.type,e,i)},PercentageChart:Ht,PieChart:Ft,Heatmap:jt,AxisChart:It});return Object.assign({},{NAME:"Frappe Charts",VERSION:"1.6.2"},Vt)}()}},e={};function i(n){flarum.reg._webpack_runtimes["flarum-statistics"]||=i;var s=e[n];if(void 0!==s)return s.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{extend:()=>Z});const t=flarum.reg.get("core","admin/app");var e=i.n(t);const s=flarum.reg.get("core","common/extend"),a=flarum.reg.get("core","admin/components/DashboardPage");var r=i.n(a);function o(t){return o="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},o(t)}function l(t,e,i){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const u=flarum.reg.get("core","admin/components/DashboardWidget");var c=i.n(u);const h=flarum.reg.get("core","common/components/LoadingIndicator");var d=i.n(h);const f=flarum.reg.get("core","common/components/Link");var p=i.n(f);const v=flarum.reg.get("core","common/utils/abbreviateNumber");var g=i.n(v);class y extends(c()){constructor(){super(...arguments),l(this,"entities",["users","discussions","posts"]),l(this,"lifetimeData",void 0),l(this,"loadingLifetime",!0)}oncreate(t){super.oncreate(t),this.loadLifetimeData()}async loadLifetimeData(){this.loadingLifetime=!0,m.redraw();const t=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"lifetime"}});this.lifetimeData=t,this.loadingLifetime=!1,m.redraw()}className(){return"StatisticsWidget StatisticsWidget--mini"}content(){return m("div",{className:"StatisticsWidget-table"},m("h4",{className:"StatisticsWidget-title"},e().translator.trans("flarum-statistics.admin.statistics.mini_heading")),m("div",{className:"StatisticsWidget-entities"},m("div",{className:"StatisticsWidget-labels"},m("div",{className:"StatisticsWidget-label"},e().translator.trans("flarum-statistics.admin.statistics.total_label"))),this.entities.map((t=>{const i=this.loadingLifetime?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getTotalCount(t);return m("div",{className:"StatisticsWidget-entity"},m("h3",{className:"StatisticsWidget-heading"},e().translator.trans("flarum-statistics.admin.statistics."+t+"_heading")),m("div",{className:"StatisticsWidget-total",title:i},this.loadingLifetime?m(d(),{display:"inline"}):g()(i)))}))),m("div",{className:"StatisticsWidget-viewFull"},m(p(),{href:e().route("extension",{id:"flarum-statistics"})},e().translator.trans("flarum-statistics.admin.statistics.view_full"))))}getTotalCount(t){return this.lifetimeData[t]}}flarum.reg.add("flarum-statistics","admin/components/MiniStatisticsWidget",y);const b=flarum.reg.get("core","common/extenders");var x=i.n(b);const k=flarum.reg.get("core","admin/components/ExtensionPage");var w=i.n(k);const D=flarum.reg.get("core","common/components/SelectDropdown");var M=i.n(D);const P=flarum.reg.get("core","common/components/Button");var S=i.n(P);const A=flarum.reg.get("core","common/utils/extractText");var T=i.n(A);const O=flarum.reg.get("core","common/components/Placeholder");var L=i.n(O);const C=flarum.reg.get("core","common/components/Icon");var N=i.n(C);const _=flarum.reg.get("core","common/utils/classList");var $=i.n(_);const E=flarum.reg.get("core","common/utils/ItemList");var Y=i.n(E);const W=flarum.reg.get("core","common/utils/generateElementId");var z=i.n(W);const H=flarum.reg.get("core","common/components/FormModal");var F=i.n(H),j=i(720),I=i.n(j),R=i(153),U=i.n(R);I().extend(U());class V extends(F()){constructor(){super(...arguments),l(this,"state",{inputs:{startDateVal:I()().format("YYYY-MM-DD"),endDateVal:I()().format("YYYY-MM-DD")},ids:{startDate:z()(),endDate:z()()}})}oninit(t){super.oninit(t),this.attrs.value&&(this.state.inputs={startDateVal:I().utc(1e3*this.attrs.value.start).format("YYYY-MM-DD"),endDateVal:I().utc(1e3*this.attrs.value.end).format("YYYY-MM-DD")})}className(){return"StatisticsWidgetDateSelectionModal Modal--small"}title(){return e().translator.trans("flarum-statistics.admin.date_selection_modal.title")}content(){return m("div",{className:"Modal-body"},this.items().toArray())}items(){const t=new(Y());return t.add("intro",m("p",null,e().translator.trans("flarum-statistics.admin.date_selection_modal.description")),100),t.add("date_start",m("div",{className:"Form-group"},m("label",{htmlFor:this.state.ids.startDate},e().translator.trans("flarum-statistics.admin.date_selection_modal.start_date")),m("input",{type:"date",id:this.state.ids.startDate,value:this.state.inputs.startDateVal,onchange:this.updateState("startDateVal"),className:"FormControl"})),90),t.add("date_end",m("div",{className:"Form-group"},m("label",{htmlFor:this.state.ids.endDate},e().translator.trans("flarum-statistics.admin.date_selection_modal.end_date")),m("input",{type:"date",id:this.state.ids.endDate,value:this.state.inputs.endDateVal,onchange:this.updateState("endDateVal"),className:"FormControl"})),80),t.add("submit",m(S(),{className:"Button Button--primary",type:"submit"},e().translator.trans("flarum-statistics.admin.date_selection_modal.submit_button")),0),t}updateState(t){return e=>{this.state.inputs[t]=e.currentTarget.value}}submitData(){return{start:Math.floor(+I().utc(this.state.inputs.startDateVal+"Z")/1e3),end:Math.floor(+I().utc(this.state.inputs.endDateVal+"Z").hour(23).minute(59).second(59).millisecond(999)/1e3)}}onsubmit(t){t.preventDefault();const i=this.submitData();i.end(t[e]="unloaded",t)),{})),l(this,"loadingCustom",this.entities.reduce(((t,e)=>(t[e]="unloaded",t)),{})),l(this,"selectedEntity","users"),l(this,"selectedPeriod",void 0),l(this,"chartEntity",void 0),l(this,"chartPeriod",void 0)}oncreate(t){super.oncreate(t),this.loadLifetimeData()}async loadLifetimeData(){this.loadingLifetime=!0,m.redraw();const t=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"lifetime"}});this.lifetimeData=t,this.loadingLifetime=!1,m.redraw()}async loadTimedData(t){this.loadingTimed[t]="loading",m.redraw();try{const i=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"timed",model:t}});this.timedData[t]=i,this.loadingTimed[t]="loaded";let n=new Date;n.setUTCHours(0,0,0,0);const s=n.getTime()/1e3;this.periods={today:{start:s,end:s+86400,step:3600},last_7_days:{start:s-604800,end:s,step:86400},previous_7_days:{start:s-1209600,end:s-604800,step:86400},last_28_days:{start:s-2419200,end:s,step:86400},previous_28_days:{start:s-4838400,end:s-2419200,step:86400},last_12_months:{start:s-31449600,end:s,step:604800}},this.selectedPeriod="last_7_days"}catch(e){console.error(e),this.loadingTimed[t]="fail"}m.redraw()}async loadCustomRangeData(t){this.loadingCustom[t]="loading",m.redraw();const i={...this.customPeriod};try{const n=await e().request({method:"GET",url:e().forum.attribute("apiUrl")+"/statistics",params:{period:"custom",model:t,dateRange:{start:i.start,end:i.end}}});if(JSON.stringify(i)!==JSON.stringify(this.customPeriod))return;this.customPeriodData[t]=n,this.loadingCustom[t]="loaded",m.redraw()}catch(e){if(JSON.stringify(i)!==JSON.stringify(this.customPeriod))return;console.error(e),this.loadingCustom[t]="fail"}}className(){return"StatisticsWidget"}content(){const t="loaded"!==("custom"===this.selectedPeriod?this.loadingCustom:this.loadingTimed)[this.selectedEntity],i=t?null:"custom"===this.selectedPeriod?{start:this.customPeriod?.end,end:this.customPeriod?.end,step:86400}:this.periods[this.selectedPeriod];return"custom"===this.selectedPeriod?this.customPeriodData[this.selectedEntity]||"unloaded"!==this.loadingCustom[this.selectedEntity]||this.loadCustomRangeData(this.selectedEntity):this.timedData[this.selectedEntity]||"unloaded"!==this.loadingTimed[this.selectedEntity]||this.loadTimedData(this.selectedEntity),m("div",{className:"StatisticsWidget-table"},m("div",{className:"StatisticsWidget-entities"},m("div",{className:"StatisticsWidget-labels"},m("div",{className:"StatisticsWidget-label"},e().translator.trans("flarum-statistics.admin.statistics.total_label")),m("div",{className:"StatisticsWidget-label"},t?m(d(),{size:"small",display:"inline"}):m(M(),{disabled:t,buttonClassName:"Button Button--text",caretIcon:"fas fa-caret-down"},Object.keys(this.periods).map((t=>m(S(),{key:t,active:t===this.selectedPeriod,onclick:this.changePeriod.bind(this,t),icon:t!==this.selectedPeriod||"fas fa-check"},e().translator.trans(`flarum-statistics.admin.statistics.${t}_label`)))).concat([m(S(),{key:"custom",active:"custom"===this.selectedPeriod,onclick:()=>{const t={onModalSubmit:t=>{JSON.stringify(t)!==JSON.stringify(this.customPeriod)&&(this.customPeriodData={},Object.keys(this.loadingCustom).forEach((t=>this.loadingCustom[t]="unloaded")),this.customPeriod=t,this.changePeriod("custom"))}};this.customPeriod&&(t.value=this.customPeriod),e().modal.show(V,t)},icon:"custom"!==this.selectedPeriod||"fas fa-check"},"custom"===this.selectedPeriod?T()(e().translator.trans("flarum-statistics.admin.statistics.custom_label_specified",{fromDate:I().utc(1e3*this.customPeriod.start).format("ll"),toDate:I().utc(1e3*this.customPeriod.end).format("ll")})):e().translator.trans("flarum-statistics.admin.statistics.custom_label"))])))),this.entities.map((n=>{const s=this.loadingLifetime?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getTotalCount(n),a=t?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getPeriodCount(n,i),r="custom"===this.selectedPeriod?null:t?e().translator.trans("flarum-statistics.admin.statistics.loading"):this.getPeriodCount(n,this.getLastPeriod(i)),o=t||0===r||null===r?0:(a-r)/r*100;return m("button",{className:$()("Button--ua-reset StatisticsWidget-entity",{active:this.selectedEntity===n}),onclick:this.changeEntity.bind(this,n)},m("h3",{className:"StatisticsWidget-heading"},e().translator.trans("flarum-statistics.admin.statistics."+n+"_heading")),m("div",{className:"StatisticsWidget-total",title:s},this.loadingLifetime?m(d(),{display:"inline"}):g()(s)),m("div",{className:"StatisticsWidget-period",title:a},t?m(d(),{display:"inline"}):g()(a),0!==o&&m("[",null," ",m("span",{className:"StatisticsWidget-change StatisticsWidget-change--"+(o>0?"up":"down")},m(N(),{name:"fas fa-arrow-"+(o>0?"up":"down")}),Math.abs(o).toFixed(1),"%"))))}))),m("[",null,t?m("div",{key:"loading",className:"StatisticsWidget-chart","data-loading":"true"},m(d(),{size:"large"})):m("div",{key:"loaded",className:"StatisticsWidget-chart","data-loading":"false",oncreate:this.drawChart.bind(this),onupdate:this.drawChart.bind(this)})),this.noData&&m(L(),{text:e().translator.trans("flarum-statistics.admin.statistics.no_data")}),!this.noData&&!!this.chart&&m(S(),{className:"StatisticsWidget-chartExport Button",icon:"fas fa-file-export",onclick:()=>{this.chart.export()}},e().translator.trans("flarum-statistics.admin.statistics.export_chart_button")))}drawChart(t){if(this.chart&&this.chartEntity===this.selectedEntity&&this.chartPeriod===this.selectedPeriod)return;const i="custom"===this.selectedPeriod?{start:this.customPeriod?.start,end:this.customPeriod?.end,step:86400}:this.periods[this.selectedPeriod],n=i.end-i.start,s=[],a=[],r=[];for(let t=i.start;t86400&&(e+=" - "+I().unix(t+i.step-1).utc().format("D MMM"))),s.push(e),a.push(this.getPeriodCount(this.selectedEntity,{start:t,end:t+i.step})),r.push(this.getPeriodCount(this.selectedEntity,{start:t-n,end:t-n}))}if(0===a.length)return this.noData=!0,void m.redraw();this.noData=!1,m.redraw();const o={labels:s,datasets:[{name:T()(e().translator.trans("flarum-statistics.admin.statistics.current_period")),values:a},{name:T()(e().translator.trans("flarum-statistics.admin.statistics.previous_period")),values:r}]};this.chart&&16&document.compareDocumentPosition(this.chart.parent)?this.chart.update(o):this.chart=new q.Chart(t.dom,{data:o,type:"line",height:280,axisOptions:{xAxisMode:"tick",yAxisMode:"span",xIsSeries:!0},lineOptions:{hideDots:1,regionFill:1},colors:[e().forum.attribute("themePrimaryColor"),"black"]}),this.chartEntity=this.selectedEntity,this.chartPeriod=this.selectedPeriod}changeEntity(t){this.selectedEntity=t}changePeriod(t){this.selectedPeriod=t}getTotalCount(t){return this.lifetimeData[t]}getPeriodCount(t,e){const i=("custom"===this.selectedPeriod?this.customPeriodData:this.timedData)[t];let n=0;for(const t in i){const s=parseInt(t);s>=e.start&&s{(0,s.extend)(r().prototype,"availableWidgets",(function(t){t.add("statistics",m(y,null),20)}))}))})(),module.exports=n})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/statistics/js/dist/admin.js.map b/extensions/statistics/js/dist/admin.js.map index a2d2c1ca31..5f45b39e5a 100644 --- a/extensions/statistics/js/dist/admin.js.map +++ b/extensions/statistics/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"6BAAoEA,EAAOC,QAAmI,WAAW,aAAa,IAAUC,EAAE,IAAIC,EAAE,KAAKC,EAAE,cAAcC,EAAE,SAASC,EAAE,SAASC,EAAE,OAAOC,EAAE,MAAMC,EAAE,OAAOC,EAAE,QAAQC,EAAE,UAAUC,EAAE,OAAOC,EAAE,OAAOC,EAAE,eAAeC,EAAE,6FAA6FC,EAAE,sFAAsFC,EAAE,CAACC,KAAK,KAAKC,SAAS,2DAA2DC,MAAM,KAAKC,OAAO,wFAAwFD,MAAM,KAAKE,QAAQ,SAASC,GAAG,IAAIrB,EAAE,CAAC,KAAK,KAAK,KAAK,MAAMC,EAAEoB,EAAE,IAAI,MAAM,IAAIA,GAAGrB,GAAGC,EAAE,IAAI,KAAKD,EAAEC,IAAID,EAAE,IAAI,GAAG,GAAGsB,EAAE,SAASD,EAAErB,EAAEC,GAAG,IAAIC,EAAEqB,OAAOF,GAAG,OAAOnB,GAAGA,EAAEsB,QAAQxB,EAAEqB,EAAE,GAAGI,MAAMzB,EAAE,EAAEE,EAAEsB,QAAQE,KAAKzB,GAAGoB,CAAC,EAAEM,EAAE,CAACvB,EAAEkB,EAAEM,EAAE,SAASP,GAAG,IAAIrB,GAAGqB,EAAEQ,YAAY5B,EAAE6B,KAAKC,IAAI/B,GAAGE,EAAE4B,KAAKE,MA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D,CACxB,CACA,aAAAO,CAAcF,GACZ,OAAOzpB,KAAKqpB,aAAaI,EAC3B,CACA,cAAAsE,CAAetE,EAAQL,GACrB,MAAM4F,GAAiC,WAAxBhvB,KAAKysB,eAA8BzsB,KAAK+sB,iBAAmB/sB,KAAK8rB,WAAWrC,GAC1F,IAAIwF,EAAQ,EACZ,IAAK,MAAMxxB,KAAKuxB,EAAO,CACrB,MAAME,EAAOrnB,SAASpK,GAClByxB,GAAQ9F,EAAO5G,OAAS0M,EAAO9F,EAAO3G,MACxCwM,GAASD,EAAME,GAEnB,CACA,OAAOD,CACT,CACA,aAAAhB,CAAcf,GACZ,MAAO,CACL1K,MAAO0K,EAAW1K,OAAS0K,EAAWzK,IAAMyK,EAAW1K,OACvDC,IAAKyK,EAAW1K,MAEpB,EAEF2F,OAAOC,IAAI3pB,IAAI,oBAAqB,oCAAqC+sB,GC5X1D,MAAM2D,UAAuB,KAC1C,OAAA7F,GACE,OAAO5rB,EAAE,MAAO,CACdkL,UAAW,kBACVlL,EAAE,MAAO,CACVkL,UAAW,aACVlL,EAAE8tB,EAAkB,OACzB,EAEFrD,OAAOC,IAAI3pB,IAAI,oBAAqB,kCAAmC0wB,GCTvE,UAAgB,IAAI,YAAeC,KAAKD,ICGxC,iBAAiB1wB,IAAI,qBAAqB,MACxC,IAAAwF,QAAO,cAAyB,oBAAoB,SAAUorB,GAC5DA,EAAQ5wB,IAAI,aAAcf,EAAE+qB,EAAsB,MAAO,GAC3D,GAAE,G","sources":["webpack://@flarum/statistics/../../../node_modules/dayjs/dayjs.min.js","webpack://@flarum/statistics/../../../node_modules/dayjs/plugin/localizedFormat.js","webpack://@flarum/statistics/../../../node_modules/dayjs/plugin/utc.js","webpack://@flarum/statistics/../src/js/utils/dom.js","webpack://@flarum/statistics/../src/js/utils/constants.js","webpack://@flarum/statistics/../src/js/utils/helpers.js","webpack://@flarum/statistics/../src/js/utils/draw-utils.js","webpack://@flarum/statistics/../src/js/utils/colors.js","webpack://@flarum/statistics/../src/js/utils/draw.js","webpack://@flarum/statistics/../src/js/utils/animate.js","webpack://@flarum/statistics/../src/js/utils/animation.js","webpack://@flarum/statistics/../src/js/utils/export.js","webpack://@flarum/statistics/../src/js/utils/date-utils.js","webpack://@flarum/statistics/../src/js/objects/ChartComponents.js","webpack://@flarum/statistics/../src/js/utils/intervals.js","webpack://@flarum/statistics/../node_modules/style-inject/dist/style-inject.es.js","webpack://@flarum/statistics/../src/js/objects/SvgTip.js","webpack://@flarum/statistics/../src/css/chartsCss.js","webpack://@flarum/statistics/../src/js/charts/BaseChart.js","webpack://@flarum/statistics/../src/js/charts/AggregationChart.js","webpack://@flarum/statistics/../src/js/charts/PercentageChart.js","webpack://@flarum/statistics/../src/js/charts/PieChart.js","webpack://@flarum/statistics/../src/js/charts/Heatmap.js","webpack://@flarum/statistics/../src/js/charts/AxisChart.js","webpack://@flarum/statistics/../src/js/utils/axis-chart-utils.js","webpack://@flarum/statistics/../src/js/charts/DonutChart.js","webpack://@flarum/statistics/../src/js/chart.js","webpack://@flarum/statistics/../src/js/index.js","webpack://@flarum/statistics/webpack/bootstrap","webpack://@flarum/statistics/webpack/runtime/compat get default export","webpack://@flarum/statistics/webpack/runtime/define property getters","webpack://@flarum/statistics/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/statistics/webpack/runtime/make namespace object","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/components/DashboardPage')\"","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/components/DashboardWidget')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/abbreviateNumber')\"","webpack://@flarum/statistics/./src/admin/components/MiniStatisticsWidget.tsx","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/SelectDropdown')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Placeholder')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/generateElementId')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/statistics/./src/admin/components/StatisticsWidgetDateSelectionModal.tsx","webpack://@flarum/statistics/./src/admin/components/StatisticsWidget.tsx","webpack://@flarum/statistics/./src/admin/components/StatisticsPage.tsx","webpack://@flarum/statistics/./src/admin/extend.tsx","webpack://@flarum/statistics/./src/admin/index.tsx"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) {\n\tvar element = document.createElement(tag);\n\n\tfor (var i in o) {\n\t\tvar val = o[i];\n\n\t\tif (i === \"inside\") {\n\t\t\t$(val).appendChild(element);\n\t\t}\n\t\telse if (i === \"around\") {\n\t\t\tvar ref = $(val);\n\t\t\tref.parentNode.insertBefore(element, ref);\n\t\t\telement.appendChild(ref);\n\n\t\t} else if (i === \"styles\") {\n\t\t\tif(typeof val === \"object\") {\n\t\t\t\tObject.keys(val).map(prop => {\n\t\t\t\t\telement.style[prop] = val[prop];\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (i in element ) {\n\t\t\telement[i] = val;\n\t\t}\n\t\telse {\n\t\t\telement.setAttribute(i, val);\n\t\t}\n\t}\n\n\treturn element;\n};\n\nexport function getOffset(element) {\n\tlet rect = element.getBoundingClientRect();\n\treturn {\n\t\t// https://stackoverflow.com/a/7436602/6495043\n\t\t// rect.top varies with scroll, so we add whatever has been\n\t\t// scrolled to it to get absolute distance from actual page top\n\t\ttop: rect.top + (document.documentElement.scrollTop || document.body.scrollTop),\n\t\tleft: rect.left + (document.documentElement.scrollLeft || document.body.scrollLeft)\n\t};\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n// an element's offsetParent property will return null whenever it, or any of its parents,\n// is hidden via the display style property.\nexport function isHidden(el) {\n\treturn (el.offsetParent === null);\n}\n\nexport function isElementInViewport(el) {\n\t// Although straightforward: https://stackoverflow.com/a/7557433/6495043\n\tvar rect = el.getBoundingClientRect();\n\n\treturn (\n\t\trect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */\n\t);\n}\n\nexport function getElementContentWidth(element) {\n\tvar styles = window.getComputedStyle(element);\n\tvar padding = parseFloat(styles.paddingLeft) +\n\t\tparseFloat(styles.paddingRight);\n\n\treturn element.clientWidth - padding;\n}\n\nexport function bind(element, o){\n\tif (element) {\n\t\tfor (var event in o) {\n\t\t\tvar callback = o[event];\n\n\t\t\tevent.split(/\\s+/).forEach(function (event) {\n\t\t\t\telement.addEventListener(event, callback);\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport function unbind(element, o){\n\tif (element) {\n\t\tfor (var event in o) {\n\t\t\tvar callback = o[event];\n\n\t\t\tevent.split(/\\s+/).forEach(function(event) {\n\t\t\t\telement.removeEventListener(event, callback);\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport function fire(target, type, properties) {\n\tvar evt = document.createEvent(\"HTMLEvents\");\n\n\tevt.initEvent(type, true, true );\n\n\tfor (var j in properties) {\n\t\tevt[j] = properties[j];\n\t}\n\n\treturn target.dispatchEvent(evt);\n}\n\n// https://css-tricks.com/snippets/javascript/loop-queryselectorall-matches/\nexport function forEachNode(nodeList, callback, scope) {\n\tif(!nodeList) return;\n\tfor (var i = 0; i < nodeList.length; i++) {\n\t\tcallback.call(scope, nodeList[i], i);\n\t}\n}\n\nexport function activate($parent, $child, commonClass, activeClass='active', index = -1) {\n\tlet $children = $parent.querySelectorAll(`.${commonClass}.${activeClass}`);\n\n\tforEachNode($children, (node, i) => {\n\t\tif(index >= 0 && i <= index) return;\n\t\tnode.classList.remove(activeClass);\n\t});\n\n\t$child.classList.add(activeClass);\n}\n","export const ALL_CHART_TYPES = ['line', 'scatter', 'bar', 'percentage', 'heatmap', 'pie'];\n\nexport const COMPATIBLE_CHARTS = {\n\tbar: ['line', 'scatter', 'percentage', 'pie'],\n\tline: ['scatter', 'bar', 'percentage', 'pie'],\n\tpie: ['line', 'scatter', 'percentage', 'bar'],\n\tpercentage: ['bar', 'line', 'scatter', 'pie'],\n\theatmap: []\n};\n\nexport const DATA_COLOR_DIVISIONS = {\n\tbar: 'datasets',\n\tline: 'datasets',\n\tpie: 'labels',\n\tpercentage: 'labels',\n\theatmap: HEATMAP_DISTRIBUTION_SIZE\n};\n\nexport const BASE_MEASURES = {\n\tmargins: {\n\t\ttop: 10,\n\t\tbottom: 10,\n\t\tleft: 20,\n\t\tright: 20\n\t},\n\tpaddings: {\n\t\ttop: 20,\n\t\tbottom: 40,\n\t\tleft: 30,\n\t\tright: 10\n\t},\n\n\tbaseHeight: 240,\n\ttitleHeight: 20,\n\tlegendHeight: 30,\n\n\ttitleFontSize: 12,\n};\n\nexport function getTopOffset(m) {\n\treturn m.titleHeight + m.margins.top + m.paddings.top;\n}\n\nexport function getLeftOffset(m) {\n\treturn m.margins.left + m.paddings.left;\n}\n\nexport function getExtraHeight(m) {\n\tlet totalExtraHeight = m.margins.top + m.margins.bottom\n\t\t+ m.paddings.top + m.paddings.bottom\n\t\t+ m.titleHeight + m.legendHeight;\n\treturn totalExtraHeight;\n}\n\nexport function getExtraWidth(m) {\n\tlet totalExtraWidth = m.margins.left + m.margins.right\n\t\t+ m.paddings.left + m.paddings.right;\n\n\treturn totalExtraWidth;\n}\n\nexport const INIT_CHART_UPDATE_TIMEOUT = 700;\nexport const CHART_POST_ANIMATE_TIMEOUT = 400;\n\nexport const DEFAULT_AXIS_CHART_TYPE = 'line';\nexport const AXIS_DATASET_CHART_TYPES = ['line', 'bar'];\n\nexport const AXIS_LEGEND_BAR_SIZE = 100;\n\nexport const BAR_CHART_SPACE_RATIO = 0.5;\nexport const MIN_BAR_PERCENT_HEIGHT = 0.00;\n\nexport const LINE_CHART_DOT_SIZE = 4;\nexport const DOT_OVERLAY_SIZE_INCR = 4;\n\nexport const PERCENTAGE_BAR_DEFAULT_HEIGHT = 20;\nexport const PERCENTAGE_BAR_DEFAULT_DEPTH = 2;\n\n// Fixed 5-color theme,\n// More colors are difficult to parse visually\nexport const HEATMAP_DISTRIBUTION_SIZE = 5;\n\nexport const HEATMAP_SQUARE_SIZE = 10;\nexport const HEATMAP_GUTTER_SIZE = 2;\n\nexport const DEFAULT_CHAR_WIDTH = 7;\n\nexport const TOOLTIP_POINTER_TRIANGLE_HEIGHT = 5;\n\nconst DEFAULT_CHART_COLORS = ['light-blue', 'blue', 'violet', 'red', 'orange',\n\t'yellow', 'green', 'light-green', 'purple', 'magenta', 'light-grey', 'dark-grey'];\nconst HEATMAP_COLORS_GREEN = ['#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127'];\nexport const HEATMAP_COLORS_BLUE = ['#ebedf0', '#c0ddf9', '#73b3f3', '#3886e1', '#17459e'];\nexport const HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001c'];\n\nexport const DEFAULT_COLORS = {\n\tbar: DEFAULT_CHART_COLORS,\n\tline: DEFAULT_CHART_COLORS,\n\tpie: DEFAULT_CHART_COLORS,\n\tpercentage: DEFAULT_CHART_COLORS,\n\theatmap: HEATMAP_COLORS_GREEN,\n\tdonut: DEFAULT_CHART_COLORS\n};\n\n// Universal constants\nexport const ANGLE_RATIO = Math.PI / 180;\nexport const FULL_ANGLE = 360;\n","import { ANGLE_RATIO } from './constants';\n\n/**\n * Returns the value of a number upto 2 decimal places.\n * @param {Number} d Any number\n */\nexport function floatTwo(d) {\n\treturn parseFloat(d.toFixed(2));\n}\n\n/**\n * Returns whether or not two given arrays are equal.\n * @param {Array} arr1 First array\n * @param {Array} arr2 Second array\n */\nexport function arraysEqual(arr1, arr2) {\n\tif(arr1.length !== arr2.length) return false;\n\tlet areEqual = true;\n\tarr1.map((d, i) => {\n\t\tif(arr2[i] !== d) areEqual = false;\n\t});\n\treturn areEqual;\n}\n\n/**\n * Shuffles array in place. ES6 version\n * @param {Array} array An array containing the items.\n */\nexport function shuffle(array) {\n\t// Awesomeness: https://bost.ocks.org/mike/shuffle/\n\t// https://stackoverflow.com/a/2450976/6495043\n\t// https://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array?noredirect=1&lq=1\n\n\tfor (let i = array.length - 1; i > 0; i--) {\n\t\tlet j = Math.floor(Math.random() * (i + 1));\n\t\t[array[i], array[j]] = [array[j], array[i]];\n\t}\n\n\treturn array;\n}\n\n/**\n * Fill an array with extra points\n * @param {Array} array Array\n * @param {Number} count number of filler elements\n * @param {Object} element element to fill with\n * @param {Boolean} start fill at start?\n */\nexport function fillArray(array, count, element, start=false) {\n\tif(!element) {\n\t\telement = start ? array[0] : array[array.length - 1];\n\t}\n\tlet fillerArray = new Array(Math.abs(count)).fill(element);\n\tarray = start ? fillerArray.concat(array) : array.concat(fillerArray);\n\treturn array;\n}\n\n/**\n * Returns pixel width of string.\n * @param {String} string\n * @param {Number} charWidth Width of single char in pixels\n */\nexport function getStringWidth(string, charWidth) {\n\treturn (string+\"\").length * charWidth;\n}\n\nexport function bindChange(obj, getFn, setFn) {\n\treturn new Proxy(obj, {\n\t\tset: function(target, prop, value) {\n\t\t\tsetFn();\n\t\t\treturn Reflect.set(target, prop, value);\n\t\t},\n\t\tget: function(target, prop) {\n\t\t\tgetFn();\n\t\t\treturn Reflect.get(target, prop);\n\t\t}\n\t});\n}\n\n// https://stackoverflow.com/a/29325222\nexport function getRandomBias(min, max, bias, influence) {\n\tconst range = max - min;\n\tconst biasValue = range * bias + min;\n\tvar rnd = Math.random() * range + min,\t\t// random in range\n\t\tmix = Math.random() * influence;\t\t// random mixer\n\treturn rnd * (1 - mix) + biasValue * mix;\t// mix full range and bias\n}\n\nexport function getPositionByAngle(angle, radius) {\n\treturn {\n\t\tx: Math.sin(angle * ANGLE_RATIO) * radius,\n\t\ty: Math.cos(angle * ANGLE_RATIO) * radius,\n\t};\n}\n\n/**\n * Check if a number is valid for svg attributes\n * @param {object} candidate Candidate to test\n * @param {Boolean} nonNegative flag to treat negative number as invalid\n */\nexport function isValidNumber(candidate, nonNegative=false) {\n\tif (Number.isNaN(candidate)) return false;\n\telse if (candidate === undefined) return false;\n\telse if (!Number.isFinite(candidate)) return false;\n\telse if (nonNegative && candidate < 0) return false;\n\telse return true;\n}\n\n/**\n * Round a number to the closes precision, max max precision 4\n * @param {Number} d Any Number\n */\nexport function round(d) {\n\t// https://floating-point-gui.de/\n\t// https://www.jacklmoore.com/notes/rounding-in-javascript/\n\treturn Number(Math.round(d + 'e4') + 'e-4');\n}\n\n/**\n * Creates a deep clone of an object\n * @param {Object} candidate Any Object\n */\n export function deepClone(candidate) {\n\tlet cloned, value, key;\n \n\tif (candidate instanceof Date) {\n\t return new Date(candidate.getTime());\n\t}\n \n\tif (typeof candidate !== \"object\" || candidate === null) {\n\t return candidate;\n\t}\n \n\tcloned = Array.isArray(candidate) ? [] : {};\n \n\tfor (key in candidate) {\n\t value = candidate[key];\n \n\t cloned[key] = deepClone(value);\n\t}\n \n\treturn cloned;\n }","import { fillArray } from './helpers';\n\nexport function getBarHeightAndYAttr(yTop, zeroLine) {\n\tlet height, y;\n\tif (yTop <= zeroLine) {\n\t\theight = zeroLine - yTop;\n\t\ty = yTop;\n\t} else {\n\t\theight = yTop - zeroLine;\n\t\ty = zeroLine;\n\t}\n\n\treturn [height, y];\n}\n\nexport function equilizeNoOfElements(array1, array2,\n\textraCount = array2.length - array1.length) {\n\n\t// Doesn't work if either has zero elements.\n\tif(extraCount > 0) {\n\t\tarray1 = fillArray(array1, extraCount);\n\t} else {\n\t\tarray2 = fillArray(array2, extraCount);\n\t}\n\treturn [array1, array2];\n}\n\nexport function truncateString(txt, len) {\n\tif (!txt) {\n\t\treturn;\n\t}\n\tif (txt.length > len) {\n\t\treturn txt.slice(0, len-3) + '...';\n\t} else {\n\t\treturn txt;\n\t}\n}\n\nexport function shortenLargeNumber(label) {\n\tlet number;\n\tif (typeof label === 'number') number = label;\n\telse if (typeof label === 'string') {\n\t\tnumber = Number(label);\n\t\tif (Number.isNaN(number)) return label;\n\t}\n\n\t// Using absolute since log wont work for negative numbers\n\tlet p = Math.floor(Math.log10(Math.abs(number)));\n\tif (p <= 2) return number; // Return as is for a 3 digit number of less\n\tlet\tl = Math.floor(p / 3);\n\tlet shortened = (Math.pow(10, p - l * 3) * +(number / Math.pow(10, p)).toFixed(1));\n\n\t// Correct for floating point error upto 2 decimal places\n\treturn Math.round(shortened*100)/100 + ' ' + ['', 'K', 'M', 'B', 'T'][l];\n}\n\n// cubic bezier curve calculation (from example by François Romain)\nexport function getSplineCurvePointsStr(xList, yList) {\n\n\tlet points=[];\n\tfor(let i=0;i {\n\t\tlet lengthX = pointB[0] - pointA[0];\n\t\tlet lengthY = pointB[1] - pointA[1];\n\t\treturn {\n\t\t\tlength: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),\n\t\t\tangle: Math.atan2(lengthY, lengthX)\n\t\t};\n\t};\n \n\tlet controlPoint = (current, previous, next, reverse) => {\n\t\tlet p = previous || current;\n\t\tlet n = next || current;\n\t\tlet o = line(p, n);\n\t\tlet angle = o.angle + (reverse ? Math.PI : 0);\n\t\tlet length = o.length * smoothing;\n\t\tlet x = current[0] + Math.cos(angle) * length;\n\t\tlet y = current[1] + Math.sin(angle) * length;\n\t\treturn [x, y];\n\t};\n \n\tlet bezierCommand = (point, i, a) => {\n\t\tlet cps = controlPoint(a[i - 1], a[i - 2], point);\n\t\tlet cpe = controlPoint(point, a[i - 1], a[i + 1], true);\n\t\treturn `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`;\n\t};\n \n\tlet pointStr = (points, command) => {\n\t\treturn points.reduce((acc, point, i, a) => i === 0\n\t\t\t? `${point[0]},${point[1]}`\n\t\t\t: `${acc} ${command(point, i, a)}`, '');\n\t};\n \n\treturn pointStr(points, bezierCommand);\n}\n","const PRESET_COLOR_MAP = {\n\t'light-blue': '#7cd6fd',\n\t'blue': '#5e64ff',\n\t'violet': '#743ee2',\n\t'red': '#ff5858',\n\t'orange': '#ffa00a',\n\t'yellow': '#feef72',\n\t'green': '#28a745',\n\t'light-green': '#98d85b',\n\t'purple': '#b554ff',\n\t'magenta': '#ffa3ef',\n\t'black': '#36114C',\n\t'grey': '#bdd3e6',\n\t'light-grey': '#f0f4f7',\n\t'dark-grey': '#b8c2cc'\n};\n\nfunction limitColor(r){\n\tif (r > 255) return 255;\n\telse if (r < 0) return 0;\n\treturn r;\n}\n\nexport function lightenDarkenColor(color, amt) {\n\tlet col = getColor(color);\n\tlet usePound = false;\n\tif (col[0] == \"#\") {\n\t\tcol = col.slice(1);\n\t\tusePound = true;\n\t}\n\tlet num = parseInt(col,16);\n\tlet r = limitColor((num >> 16) + amt);\n\tlet b = limitColor(((num >> 8) & 0x00FF) + amt);\n\tlet g = limitColor((num & 0x0000FF) + amt);\n\treturn (usePound?\"#\":\"\") + (g | (b << 8) | (r << 16)).toString(16);\n}\n\nexport function isValidColor(string) {\n\t// https://stackoverflow.com/a/32685393\n\tlet HEX_RE = /(^\\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i;\n\tlet RGB_RE = /(^\\s*)(rgb|hsl)(a?)[(]\\s*([\\d.]+\\s*%?)\\s*,\\s*([\\d.]+\\s*%?)\\s*,\\s*([\\d.]+\\s*%?)\\s*(?:,\\s*([\\d.]+)\\s*)?[)]$/i;\n\treturn HEX_RE.test(string) || RGB_RE.test(string);\n}\n\nexport const getColor = (color) => {\n\t// When RGB color, convert to hexadecimal (alpha value is omitted)\n\tif((/rgb[a]{0,1}\\([\\d, ]+\\)/gim).test(color)) {\n\t\treturn (/\\D+(\\d*)\\D+(\\d*)\\D+(\\d*)/gim).exec(color)\n\t\t\t.map((x, i) => (i !== 0 ? Number(x).toString(16) : '#'))\n\t\t\t.reduce((c, ch) => `${c}${ch}`);\n\t}\n\treturn PRESET_COLOR_MAP[color] || color;\n};\n","import { getBarHeightAndYAttr, truncateString, shortenLargeNumber, getSplineCurvePointsStr } from './draw-utils';\nimport { getStringWidth, isValidNumber } from './helpers';\nimport { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants';\nimport { lightenDarkenColor } from './colors';\n\nexport const AXIS_TICK_LENGTH = 6;\nconst LABEL_MARGIN = 4;\nconst LABEL_MAX_CHARS = 15;\nexport const FONT_SIZE = 10;\nconst BASE_LINE_COLOR = '#dadada';\nconst FONT_FILL = '#555b51';\n\nfunction $(expr, con) {\n\treturn typeof expr === \"string\"? (con || document).querySelector(expr) : expr || null;\n}\n\nexport function createSVG(tag, o) {\n\tvar element = document.createElementNS(\"http://www.w3.org/2000/svg\", tag);\n\n\tfor (var i in o) {\n\t\tvar val = o[i];\n\n\t\tif (i === \"inside\") {\n\t\t\t$(val).appendChild(element);\n\t\t}\n\t\telse if (i === \"around\") {\n\t\t\tvar ref = $(val);\n\t\t\tref.parentNode.insertBefore(element, ref);\n\t\t\telement.appendChild(ref);\n\n\t\t} else if (i === \"styles\") {\n\t\t\tif(typeof val === \"object\") {\n\t\t\t\tObject.keys(val).map(prop => {\n\t\t\t\t\telement.style[prop] = val[prop];\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif(i === \"className\") { i = \"class\"; }\n\t\t\tif(i === \"innerHTML\") {\n\t\t\t\telement['textContent'] = val;\n\t\t\t} else {\n\t\t\t\telement.setAttribute(i, val);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn element;\n}\n\nfunction renderVerticalGradient(svgDefElem, gradientId) {\n\treturn createSVG('linearGradient', {\n\t\tinside: svgDefElem,\n\t\tid: gradientId,\n\t\tx1: 0,\n\t\tx2: 0,\n\t\ty1: 0,\n\t\ty2: 1\n\t});\n}\n\nfunction setGradientStop(gradElem, offset, color, opacity) {\n\treturn createSVG('stop', {\n\t\t'inside': gradElem,\n\t\t'style': `stop-color: ${color}`,\n\t\t'offset': offset,\n\t\t'stop-opacity': opacity\n\t});\n}\n\nexport function makeSVGContainer(parent, className, width, height) {\n\treturn createSVG('svg', {\n\t\tclassName: className,\n\t\tinside: parent,\n\t\twidth: width,\n\t\theight: height\n\t});\n}\n\nexport function makeSVGDefs(svgContainer) {\n\treturn createSVG('defs', {\n\t\tinside: svgContainer,\n\t});\n}\n\nexport function makeSVGGroup(className, transform='', parent=undefined) {\n\tlet args = {\n\t\tclassName: className,\n\t\ttransform: transform\n\t};\n\tif(parent) args.inside = parent;\n\treturn createSVG('g', args);\n}\n\nexport function wrapInSVGGroup(elements, className='') {\n\tlet g = createSVG('g', {\n\t\tclassName: className\n\t});\n\telements.forEach(e => g.appendChild(e));\n\treturn g;\n}\n\nexport function makePath(pathStr, className='', stroke='none', fill='none', strokeWidth=2) {\n\treturn createSVG('path', {\n\t\tclassName: className,\n\t\td: pathStr,\n\t\tstyles: {\n\t\t\tstroke: stroke,\n\t\t\tfill: fill,\n\t\t\t'stroke-width': strokeWidth\n\t\t}\n\t});\n}\n\nexport function makeArcPathStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, arcEndY] = [center.x + endPosition.x, center.y + endPosition.y];\n\treturn `M${center.x} ${center.y}\n\t\tL${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY} z`;\n}\n\nexport function makeCircleStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, midArc, arcEndY] = [center.x + endPosition.x, center.y * 2, center.y + endPosition.y];\n\treturn `M${center.x} ${center.y}\n\t\tL${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${midArc} z\n\t\tL${arcStartX} ${midArc}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY} z`;\n}\n\nexport function makeArcStrokePathStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, arcEndY] = [center.x + endPosition.x, center.y + endPosition.y];\n\n\treturn `M${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY}`;\n}\n\nexport function makeStrokeCircleStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, midArc, arcEndY] = [center.x + endPosition.x, radius * 2 + arcStartY, center.y + startPosition.y];\n\n\treturn `M${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${midArc}\n\t\tM${arcStartX} ${midArc}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY}`;\n}\n\nexport function makeGradient(svgDefElem, color, lighter = false) {\n\tlet gradientId ='path-fill-gradient' + '-' + color + '-' +(lighter ? 'lighter' : 'default');\n\tlet gradientDef = renderVerticalGradient(svgDefElem, gradientId);\n\tlet opacities = [1, 0.6, 0.2];\n\tif(lighter) {\n\t\topacities = [0.4, 0.2, 0];\n\t}\n\n\tsetGradientStop(gradientDef, \"0%\", color, opacities[0]);\n\tsetGradientStop(gradientDef, \"50%\", color, opacities[1]);\n\tsetGradientStop(gradientDef, \"100%\", color, opacities[2]);\n\n\treturn gradientId;\n}\n\nexport function percentageBar(x, y, width, height,\n\tdepth=PERCENTAGE_BAR_DEFAULT_DEPTH, fill='none') {\n\n\tlet args = {\n\t\tclassName: 'percentage-bar',\n\t\tx: x,\n\t\ty: y,\n\t\twidth: width,\n\t\theight: height,\n\t\tfill: fill,\n\t\tstyles: {\n\t\t\t'stroke': lightenDarkenColor(fill, -25),\n\t\t\t// Diabolically good: https://stackoverflow.com/a/9000859\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n\t\t\t'stroke-dasharray': `0, ${height + width}, ${width}, ${height}`,\n\t\t\t'stroke-width': depth\n\t\t},\n\t};\n\n\treturn createSVG(\"rect\", args);\n}\n\nexport function heatSquare(className, x, y, size, radius, fill='none', data={}) {\n\tlet args = {\n\t\tclassName: className,\n\t\tx: x,\n\t\ty: y,\n\t\twidth: size,\n\t\theight: size,\n\t\trx: radius,\n\t\tfill: fill\n\t};\n\n\tObject.keys(data).map(key => {\n\t\targs[key] = data[key];\n\t});\n\n\treturn createSVG(\"rect\", args);\n}\n\nexport function legendBar(x, y, size, fill='none', label, truncate=false) {\n\tlabel = truncate ? truncateString(label, LABEL_MAX_CHARS) : label;\n\n\tlet args = {\n\t\tclassName: 'legend-bar',\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: size,\n\t\theight: '2px',\n\t\tfill: fill\n\t};\n\tlet text = createSVG('text', {\n\t\tclassName: 'legend-dataset-text',\n\t\tx: 0,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE * 2) + 'px',\n\t\t'font-size': (FONT_SIZE * 1.2) + 'px',\n\t\t'text-anchor': 'start',\n\t\tfill: FONT_FILL,\n\t\tinnerHTML: label\n\t});\n\n\tlet group = createSVG('g', {\n\t\ttransform: `translate(${x}, ${y})`\n\t});\n\tgroup.appendChild(createSVG(\"rect\", args));\n\tgroup.appendChild(text);\n\n\treturn group;\n}\n\nexport function legendDot(x, y, size, fill='none', label, truncate=false) {\n\tlabel = truncate ? truncateString(label, LABEL_MAX_CHARS) : label;\n\n\tlet args = {\n\t\tclassName: 'legend-dot',\n\t\tcx: 0,\n\t\tcy: 0,\n\t\tr: size,\n\t\tfill: fill\n\t};\n\tlet text = createSVG('text', {\n\t\tclassName: 'legend-dataset-text',\n\t\tx: 0,\n\t\ty: 0,\n\t\tdx: (FONT_SIZE) + 'px',\n\t\tdy: (FONT_SIZE/3) + 'px',\n\t\t'font-size': (FONT_SIZE * 1.2) + 'px',\n\t\t'text-anchor': 'start',\n\t\tfill: FONT_FILL,\n\t\tinnerHTML: label\n\t});\n\n\tlet group = createSVG('g', {\n\t\ttransform: `translate(${x}, ${y})`\n\t});\n\tgroup.appendChild(createSVG(\"circle\", args));\n\tgroup.appendChild(text);\n\n\treturn group;\n}\n\nexport function makeText(className, x, y, content, options = {}) {\n\tlet fontSize = options.fontSize || FONT_SIZE;\n\tlet dy = options.dy !== undefined ? options.dy : (fontSize / 2);\n\tlet fill = options.fill || FONT_FILL;\n\tlet textAnchor = options.textAnchor || 'start';\n\treturn createSVG('text', {\n\t\tclassName: className,\n\t\tx: x,\n\t\ty: y,\n\t\tdy: dy + 'px',\n\t\t'font-size': fontSize + 'px',\n\t\tfill: fill,\n\t\t'text-anchor': textAnchor,\n\t\tinnerHTML: content\n\t});\n}\n\nfunction makeVertLine(x, label, y1, y2, options={}) {\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tlet l = createSVG('line', {\n\t\tclassName: 'line-vertical ' + options.className,\n\t\tx1: 0,\n\t\tx2: 0,\n\t\ty1: y1,\n\t\ty2: y2,\n\t\tstyles: {\n\t\t\tstroke: options.stroke\n\t\t}\n\t});\n\n\tlet text = createSVG('text', {\n\t\tx: 0,\n\t\ty: y1 > y2 ? y1 + LABEL_MARGIN : y1 - LABEL_MARGIN - FONT_SIZE,\n\t\tdy: FONT_SIZE + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': 'middle',\n\t\tinnerHTML: label + \"\"\n\t});\n\n\tlet line = createSVG('g', {\n\t\ttransform: `translate(${ x }, 0)`\n\t});\n\n\tline.appendChild(l);\n\tline.appendChild(text);\n\n\treturn line;\n}\n\nfunction makeHoriLine(y, label, x1, x2, options={}) {\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tif(!options.lineType) options.lineType = '';\n\tif (options.shortenNumbers) label = shortenLargeNumber(label);\n\n\tlet className = 'line-horizontal ' + options.className +\n\t\t(options.lineType === \"dashed\" ? \"dashed\": \"\");\n\n\tlet l = createSVG('line', {\n\t\tclassName: className,\n\t\tx1: x1,\n\t\tx2: x2,\n\t\ty1: 0,\n\t\ty2: 0,\n\t\tstyles: {\n\t\t\tstroke: options.stroke\n\t\t}\n\t});\n\n\tlet text = createSVG('text', {\n\t\tx: x1 < x2 ? x1 - LABEL_MARGIN : x1 + LABEL_MARGIN,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE / 2 - 2) + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': x1 < x2 ? 'end' : 'start',\n\t\tinnerHTML: label+\"\"\n\t});\n\n\tlet line = createSVG('g', {\n\t\ttransform: `translate(0, ${y})`,\n\t\t'stroke-opacity': 1\n\t});\n\n\tif(text === 0 || text === '0') {\n\t\tline.style.stroke = \"rgba(27, 31, 35, 0.6)\";\n\t}\n\n\tline.appendChild(l);\n\tline.appendChild(text);\n\n\treturn line;\n}\n\nexport function yLine(y, label, width, options={}) {\n\tif (!isValidNumber(y)) y = 0;\n\n\tif(!options.pos) options.pos = 'left';\n\tif(!options.offset) options.offset = 0;\n\tif(!options.mode) options.mode = 'span';\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tif(!options.className) options.className = '';\n\n\tlet x1 = -1 * AXIS_TICK_LENGTH;\n\tlet x2 = options.mode === 'span' ? width + AXIS_TICK_LENGTH : 0;\n\n\tif(options.mode === 'tick' && options.pos === 'right') {\n\t\tx1 = width + AXIS_TICK_LENGTH;\n\t\tx2 = width;\n\t}\n\n\t// let offset = options.pos === 'left' ? -1 * options.offset : options.offset;\n\n\tx1 += options.offset;\n\tx2 += options.offset;\n\n\treturn makeHoriLine(y, label, x1, x2, {\n\t\tstroke: options.stroke,\n\t\tclassName: options.className,\n\t\tlineType: options.lineType,\n\t\tshortenNumbers: options.shortenNumbers\n\t});\n}\n\nexport function xLine(x, label, height, options={}) {\n\tif (!isValidNumber(x)) x = 0;\n\n\tif(!options.pos) options.pos = 'bottom';\n\tif(!options.offset) options.offset = 0;\n\tif(!options.mode) options.mode = 'span';\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tif(!options.className) options.className = '';\n\n\t// Draw X axis line in span/tick mode with optional label\n\t// \ty2(span)\n\t// \t\t\t\t\t\t|\n\t// \t\t\t\t\t\t|\n\t//\t\t\t\tx line\t|\n\t//\t\t\t\t\t\t|\n\t// \t\t\t\t\t \t|\n\t// ---------------------+-- y2(tick)\n\t//\t\t\t\t\t\t|\n\t//\t\t\t\t\t\t\ty1\n\n\tlet y1 = height + AXIS_TICK_LENGTH;\n\tlet y2 = options.mode === 'span' ? -1 * AXIS_TICK_LENGTH : height;\n\n\tif(options.mode === 'tick' && options.pos === 'top') {\n\t\t// top axis ticks\n\t\ty1 = -1 * AXIS_TICK_LENGTH;\n\t\ty2 = 0;\n\t}\n\n\treturn makeVertLine(x, label, y1, y2, {\n\t\tstroke: options.stroke,\n\t\tclassName: options.className,\n\t\tlineType: options.lineType\n\t});\n}\n\nexport function yMarker(y, label, width, options={}) {\n\tif(!options.labelPos) options.labelPos = 'right';\n\tlet x = options.labelPos === 'left' ? LABEL_MARGIN\n\t\t: width - getStringWidth(label, 5) - LABEL_MARGIN;\n\n\tlet labelSvg = createSVG('text', {\n\t\tclassName: 'chart-label',\n\t\tx: x,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE / -2) + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': 'start',\n\t\tinnerHTML: label+\"\"\n\t});\n\n\tlet line = makeHoriLine(y, '', 0, width, {\n\t\tstroke: options.stroke || BASE_LINE_COLOR,\n\t\tclassName: options.className || '',\n\t\tlineType: options.lineType\n\t});\n\n\tline.appendChild(labelSvg);\n\n\treturn line;\n}\n\nexport function yRegion(y1, y2, width, label, options={}) {\n\t// return a group\n\tlet height = y1 - y2;\n\n\tlet rect = createSVG('rect', {\n\t\tclassName: `bar mini`, // remove class\n\t\tstyles: {\n\t\t\tfill: `rgba(228, 234, 239, 0.49)`,\n\t\t\tstroke: BASE_LINE_COLOR,\n\t\t\t'stroke-dasharray': `${width}, ${height}`\n\t\t},\n\t\t// 'data-point-index': index,\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: width,\n\t\theight: height\n\t});\n\n\tif(!options.labelPos) options.labelPos = 'right';\n\tlet x = options.labelPos === 'left' ? LABEL_MARGIN\n\t\t: width - getStringWidth(label+\"\", 4.5) - LABEL_MARGIN;\n\n\tlet labelSvg = createSVG('text', {\n\t\tclassName: 'chart-label',\n\t\tx: x,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE / -2) + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': 'start',\n\t\tinnerHTML: label+\"\"\n\t});\n\n\tlet region = createSVG('g', {\n\t\ttransform: `translate(0, ${y2})`\n\t});\n\n\tregion.appendChild(rect);\n\tregion.appendChild(labelSvg);\n\n\treturn region;\n}\n\nexport function datasetBar(x, yTop, width, color, label='', index=0, offset=0, meta={}) {\n\tlet [height, y] = getBarHeightAndYAttr(yTop, meta.zeroLine);\n\ty -= offset;\n\n\tif(height === 0) {\n\t\theight = meta.minHeight;\n\t\ty -= meta.minHeight;\n\t}\n\n\t// Preprocess numbers to avoid svg building errors\n\tif (!isValidNumber(x)) x = 0;\n\tif (!isValidNumber(y)) y = 0;\n\tif (!isValidNumber(height, true)) height = 0;\n\tif (!isValidNumber(width, true)) width = 0;\n\n\tlet rect = createSVG('rect', {\n\t\tclassName: `bar mini`,\n\t\tstyle: `fill: ${color}`,\n\t\t'data-point-index': index,\n\t\tx: x,\n\t\ty: y,\n\t\twidth: width,\n\t\theight: height\n\t});\n\n\tlabel += \"\";\n\n\tif(!label && !label.length) {\n\t\treturn rect;\n\t} else {\n\t\trect.setAttribute('y', 0);\n\t\trect.setAttribute('x', 0);\n\t\tlet text = createSVG('text', {\n\t\t\tclassName: 'data-point-value',\n\t\t\tx: width/2,\n\t\t\ty: 0,\n\t\t\tdy: (FONT_SIZE / 2 * -1) + 'px',\n\t\t\t'font-size': FONT_SIZE + 'px',\n\t\t\t'text-anchor': 'middle',\n\t\t\tinnerHTML: label\n\t\t});\n\n\t\tlet group = createSVG('g', {\n\t\t\t'data-point-index': index,\n\t\t\ttransform: `translate(${x}, ${y})`\n\t\t});\n\t\tgroup.appendChild(rect);\n\t\tgroup.appendChild(text);\n\n\t\treturn group;\n\t}\n}\n\nexport function datasetDot(x, y, radius, color, label='', index=0) {\n\tlet dot = createSVG('circle', {\n\t\tstyle: `fill: ${color}`,\n\t\t'data-point-index': index,\n\t\tcx: x,\n\t\tcy: y,\n\t\tr: radius\n\t});\n\n\tlabel += \"\";\n\n\tif(!label && !label.length) {\n\t\treturn dot;\n\t} else {\n\t\tdot.setAttribute('cy', 0);\n\t\tdot.setAttribute('cx', 0);\n\n\t\tlet text = createSVG('text', {\n\t\t\tclassName: 'data-point-value',\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\tdy: (FONT_SIZE / 2 * -1 - radius) + 'px',\n\t\t\t'font-size': FONT_SIZE + 'px',\n\t\t\t'text-anchor': 'middle',\n\t\t\tinnerHTML: label\n\t\t});\n\n\t\tlet group = createSVG('g', {\n\t\t\t'data-point-index': index,\n\t\t\ttransform: `translate(${x}, ${y})`\n\t\t});\n\t\tgroup.appendChild(dot);\n\t\tgroup.appendChild(text);\n\n\t\treturn group;\n\t}\n}\n\nexport function getPaths(xList, yList, color, options={}, meta={}) {\n\tlet pointsList = yList.map((y, i) => (xList[i] + ',' + y));\n\tlet pointsStr = pointsList.join(\"L\");\n\n\t// Spline\n\tif (options.spline)\n\t\tpointsStr = getSplineCurvePointsStr(xList, yList);\n\n\tlet path = makePath(\"M\"+pointsStr, 'line-graph-path', color);\n\n\t// HeatLine\n\tif(options.heatline) {\n\t\tlet gradient_id = makeGradient(meta.svgDefs, color);\n\t\tpath.style.stroke = `url(#${gradient_id})`;\n\t}\n\n\tlet paths = {\n\t\tpath: path\n\t};\n\n\t// Region\n\tif(options.regionFill) {\n\t\tlet gradient_id_region = makeGradient(meta.svgDefs, color, true);\n\n\t\tlet pathStr = \"M\" + `${xList[0]},${meta.zeroLine}L` + pointsStr + `L${xList.slice(-1)[0]},${meta.zeroLine}`;\n\t\tpaths.region = makePath(pathStr, `region-fill`, 'none', `url(#${gradient_id_region})`);\n\t}\n\n\treturn paths;\n}\n\nexport let makeOverlay = {\n\t'bar': (unit) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'rect') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet overlay = unit.cloneNode();\n\t\toverlay.style.fill = '#000000';\n\t\toverlay.style.opacity = '0.4';\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t\treturn overlay;\n\t},\n\n\t'dot': (unit) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet overlay = unit.cloneNode();\n\t\tlet radius = unit.getAttribute('r');\n\t\tlet fill = unit.getAttribute('fill');\n\t\toverlay.setAttribute('r', parseInt(radius) + DOT_OVERLAY_SIZE_INCR);\n\t\toverlay.setAttribute('fill', fill);\n\t\toverlay.style.opacity = '0.6';\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t\treturn overlay;\n\t},\n\n\t'heat_square': (unit) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet overlay = unit.cloneNode();\n\t\tlet radius = unit.getAttribute('r');\n\t\tlet fill = unit.getAttribute('fill');\n\t\toverlay.setAttribute('r', parseInt(radius) + DOT_OVERLAY_SIZE_INCR);\n\t\toverlay.setAttribute('fill', fill);\n\t\toverlay.style.opacity = '0.6';\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t\treturn overlay;\n\t}\n};\n\nexport let updateOverlay = {\n\t'bar': (unit, overlay) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'rect') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet attributes = ['x', 'y', 'width', 'height'];\n\t\tObject.values(unit.attributes)\n\t\t\t.filter(attr => attributes.includes(attr.name) && attr.specified)\n\t\t\t.map(attr => {\n\t\t\t\toverlay.setAttribute(attr.name, attr.nodeValue);\n\t\t\t});\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t},\n\n\t'dot': (unit, overlay) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet attributes = ['cx', 'cy'];\n\t\tObject.values(unit.attributes)\n\t\t\t.filter(attr => attributes.includes(attr.name) && attr.specified)\n\t\t\t.map(attr => {\n\t\t\t\toverlay.setAttribute(attr.name, attr.nodeValue);\n\t\t\t});\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t},\n\n\t'heat_square': (unit, overlay) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet attributes = ['cx', 'cy'];\n\t\tObject.values(unit.attributes)\n\t\t\t.filter(attr => attributes.includes(attr.name) && attr.specified)\n\t\t\t.map(attr => {\n\t\t\t\toverlay.setAttribute(attr.name, attr.nodeValue);\n\t\t\t});\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t},\n};\n","import { getBarHeightAndYAttr, getSplineCurvePointsStr } from './draw-utils';\n\nexport const UNIT_ANIM_DUR = 350;\nexport const PATH_ANIM_DUR = 350;\nexport const MARKER_LINE_ANIM_DUR = UNIT_ANIM_DUR;\nexport const REPLACE_ALL_NEW_DUR = 250;\n\nexport const STD_EASING = 'easein';\n\nexport function translate(unit, oldCoord, newCoord, duration) {\n\tlet old = typeof oldCoord === 'string' ? oldCoord : oldCoord.join(', ');\n\treturn [\n\t\tunit,\n\t\t{transform: newCoord.join(', ')},\n\t\tduration,\n\t\tSTD_EASING,\n\t\t\"translate\",\n\t\t{transform: old}\n\t];\n}\n\nexport function translateVertLine(xLine, newX, oldX) {\n\treturn translate(xLine, [oldX, 0], [newX, 0], MARKER_LINE_ANIM_DUR);\n}\n\nexport function translateHoriLine(yLine, newY, oldY) {\n\treturn translate(yLine, [0, oldY], [0, newY], MARKER_LINE_ANIM_DUR);\n}\n\nexport function animateRegion(rectGroup, newY1, newY2, oldY2) {\n\tlet newHeight = newY1 - newY2;\n\tlet rect = rectGroup.childNodes[0];\n\tlet width = rect.getAttribute(\"width\");\n\tlet rectAnim = [\n\t\trect,\n\t\t{ height: newHeight, 'stroke-dasharray': `${width}, ${newHeight}` },\n\t\tMARKER_LINE_ANIM_DUR,\n\t\tSTD_EASING\n\t];\n\n\tlet groupAnim = translate(rectGroup, [0, oldY2], [0, newY2], MARKER_LINE_ANIM_DUR);\n\treturn [rectAnim, groupAnim];\n}\n\nexport function animateBar(bar, x, yTop, width, offset=0, meta={}) {\n\tlet [height, y] = getBarHeightAndYAttr(yTop, meta.zeroLine);\n\ty -= offset;\n\tif(bar.nodeName !== 'rect') {\n\t\tlet rect = bar.childNodes[0];\n\t\tlet rectAnim = [\n\t\t\trect,\n\t\t\t{width: width, height: height},\n\t\t\tUNIT_ANIM_DUR,\n\t\t\tSTD_EASING\n\t\t];\n\n\t\tlet oldCoordStr = bar.getAttribute(\"transform\").split(\"(\")[1].slice(0, -1);\n\t\tlet groupAnim = translate(bar, oldCoordStr, [x, y], MARKER_LINE_ANIM_DUR);\n\t\treturn [rectAnim, groupAnim];\n\t} else {\n\t\treturn [[bar, {width: width, height: height, x: x, y: y}, UNIT_ANIM_DUR, STD_EASING]];\n\t}\n\t// bar.animate({height: args.newHeight, y: yTop}, UNIT_ANIM_DUR, mina.easein);\n}\n\nexport function animateDot(dot, x, y) {\n\tif(dot.nodeName !== 'circle') {\n\t\tlet oldCoordStr = dot.getAttribute(\"transform\").split(\"(\")[1].slice(0, -1);\n\t\tlet groupAnim = translate(dot, oldCoordStr, [x, y], MARKER_LINE_ANIM_DUR);\n\t\treturn [groupAnim];\n\t} else {\n\t\treturn [[dot, {cx: x, cy: y}, UNIT_ANIM_DUR, STD_EASING]];\n\t}\n\t// dot.animate({cy: yTop}, UNIT_ANIM_DUR, mina.easein);\n}\n\nexport function animatePath(paths, newXList, newYList, zeroLine, spline) {\n\tlet pathComponents = [];\n\tlet pointsStr = newYList.map((y, i) => (newXList[i] + ',' + y)).join(\"L\");\n\n\tif (spline)\n\t\tpointsStr = getSplineCurvePointsStr(newXList, newYList);\n\n\tconst animPath = [paths.path, {d:\"M\" + pointsStr}, PATH_ANIM_DUR, STD_EASING];\n\tpathComponents.push(animPath);\n\n\tif(paths.region) {\n\t\tlet regStartPt = `${newXList[0]},${zeroLine}L`;\n\t\tlet regEndPt = `L${newXList.slice(-1)[0]}, ${zeroLine}`;\n\n\t\tconst animRegion = [\n\t\t\tpaths.region,\n\t\t\t{d:\"M\" + regStartPt + pointsStr + regEndPt},\n\t\t\tPATH_ANIM_DUR,\n\t\t\tSTD_EASING\n\t\t];\n\t\tpathComponents.push(animRegion);\n\t}\n\n\treturn pathComponents;\n}\n\nexport function animatePathStr(oldPath, pathStr) {\n\treturn [oldPath, {d: pathStr}, UNIT_ANIM_DUR, STD_EASING];\n}\n","// Leveraging SMIL Animations\n\nimport { REPLACE_ALL_NEW_DUR } from './animate';\n\nconst EASING = {\n\tease: \"0.25 0.1 0.25 1\",\n\tlinear: \"0 0 1 1\",\n\t// easein: \"0.42 0 1 1\",\n\teasein: \"0.1 0.8 0.2 1\",\n\teaseout: \"0 0 0.58 1\",\n\teaseinout: \"0.42 0 0.58 1\"\n};\n\nfunction animateSVGElement(element, props, dur, easingType=\"linear\", type=undefined, oldValues={}) {\n\n\tlet animElement = element.cloneNode(true);\n\tlet newElement = element.cloneNode(true);\n\n\tfor(var attributeName in props) {\n\t\tlet animateElement;\n\t\tif(attributeName === 'transform') {\n\t\t\tanimateElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"animateTransform\");\n\t\t} else {\n\t\t\tanimateElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"animate\");\n\t\t}\n\t\tlet currentValue = oldValues[attributeName] || element.getAttribute(attributeName);\n\t\tlet value = props[attributeName];\n\n\t\tlet animAttr = {\n\t\t\tattributeName: attributeName,\n\t\t\tfrom: currentValue,\n\t\t\tto: value,\n\t\t\tbegin: \"0s\",\n\t\t\tdur: dur/1000 + \"s\",\n\t\t\tvalues: currentValue + \";\" + value,\n\t\t\tkeySplines: EASING[easingType],\n\t\t\tkeyTimes: \"0;1\",\n\t\t\tcalcMode: \"spline\",\n\t\t\tfill: 'freeze'\n\t\t};\n\n\t\tif(type) {\n\t\t\tanimAttr[\"type\"] = type;\n\t\t}\n\n\t\tfor (var i in animAttr) {\n\t\t\tanimateElement.setAttribute(i, animAttr[i]);\n\t\t}\n\n\t\tanimElement.appendChild(animateElement);\n\n\t\tif(type) {\n\t\t\tnewElement.setAttribute(attributeName, `translate(${value})`);\n\t\t} else {\n\t\t\tnewElement.setAttribute(attributeName, value);\n\t\t}\n\t}\n\n\treturn [animElement, newElement];\n}\n\nexport function transform(element, style) { // eslint-disable-line no-unused-vars\n\telement.style.transform = style;\n\telement.style.webkitTransform = style;\n\telement.style.msTransform = style;\n\telement.style.mozTransform = style;\n\telement.style.oTransform = style;\n}\n\nfunction animateSVG(svgContainer, elements) {\n\tlet newElements = [];\n\tlet animElements = [];\n\n\telements.map(element => {\n\t\tlet unit = element[0];\n\t\tlet parent = unit.parentNode;\n\n\t\tlet animElement, newElement;\n\n\t\telement[0] = unit;\n\t\t[animElement, newElement] = animateSVGElement(...element);\n\n\t\tnewElements.push(newElement);\n\t\tanimElements.push([animElement, parent]);\n\t\t\n\t\tif (parent) {\n\t\t\tparent.replaceChild(animElement, unit);\n\t\t}\n\t});\n\n\tlet animSvg = svgContainer.cloneNode(true);\n\n\tanimElements.map((animElement, i) => {\n\t\tif (animElement[1]) {\n\t\t\tanimElement[1].replaceChild(newElements[i], animElement[0]);\n\t\t\telements[i][0] = newElements[i];\n\t\t}\n\t});\n\n\treturn animSvg;\n}\n\nexport function runSMILAnimation(parent, svgElement, elementsToAnimate) {\n\tif(elementsToAnimate.length === 0) return;\n\n\tlet animSvgElement = animateSVG(svgElement, elementsToAnimate);\n\tif(svgElement.parentNode == parent) {\n\t\tparent.removeChild(svgElement);\n\t\tparent.appendChild(animSvgElement);\n\n\t}\n\n\t// Replace the new svgElement (data has already been replaced)\n\tsetTimeout(() => {\n\t\tif(animSvgElement.parentNode == parent) {\n\t\t\tparent.removeChild(animSvgElement);\n\t\t\tparent.appendChild(svgElement);\n\t\t}\n\t}, REPLACE_ALL_NEW_DUR);\n}\n","import { $ } from '../utils/dom';\nimport { CSSTEXT } from '../../css/chartsCss';\n\nexport function downloadFile(filename, data) {\n\tvar a = document.createElement('a');\n\ta.style = \"display: none\";\n\tvar blob = new Blob(data, {type: \"image/svg+xml; charset=utf-8\"});\n\tvar url = window.URL.createObjectURL(blob);\n\ta.href = url;\n\ta.download = filename;\n\tdocument.body.appendChild(a);\n\ta.click();\n\tsetTimeout(function(){\n\t\tdocument.body.removeChild(a);\n\t\twindow.URL.revokeObjectURL(url);\n\t}, 300);\n}\n\nexport function prepareForExport(svg) {\n\tlet clone = svg.cloneNode(true);\n\tclone.classList.add('chart-container');\n\tclone.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n\tclone.setAttribute('xmlns:xlink', \"http://www.w3.org/1999/xlink\");\n\tlet styleEl = $.create('style', {\n\t\t'innerHTML': CSSTEXT\n\t});\n\tclone.insertBefore(styleEl, clone.firstChild);\n\n\tlet container = $.create('div');\n\tcontainer.appendChild(clone);\n\n\treturn container.innerHTML;\n}\n","// Playing around with dates\n\nexport const NO_OF_YEAR_MONTHS = 12;\nexport const NO_OF_DAYS_IN_WEEK = 7;\nexport const DAYS_IN_YEAR = 375;\nexport const NO_OF_MILLIS = 1000;\nexport const SEC_IN_DAY = 86400;\n\nexport const MONTH_NAMES = [\"January\", \"February\", \"March\", \"April\", \"May\",\n\t\"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\nexport const MONTH_NAMES_SHORT = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\n\t\"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nexport const DAY_NAMES_SHORT = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nexport const DAY_NAMES = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\",\n\t\"Thursday\", \"Friday\", \"Saturday\"];\n\n// https://stackoverflow.com/a/11252167/6495043\nfunction treatAsUtc(date) {\n\tlet result = new Date(date);\n\tresult.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n\treturn result;\n}\n\nexport function getYyyyMmDd(date) {\n\tlet dd = date.getDate();\n\tlet mm = date.getMonth() + 1; // getMonth() is zero-based\n\treturn [\n\t\tdate.getFullYear(),\n\t\t(mm>9 ? '' : '0') + mm,\n\t\t(dd>9 ? '' : '0') + dd\n\t].join('-');\n}\n\nexport function clone(date) {\n\treturn new Date(date.getTime());\n}\n\nexport function timestampSec(date) {\n\treturn date.getTime()/NO_OF_MILLIS;\n}\n\nexport function timestampToMidnight(timestamp, roundAhead = false) {\n\tlet midnightTs = Math.floor(timestamp - (timestamp % SEC_IN_DAY));\n\tif(roundAhead) {\n\t\treturn midnightTs + SEC_IN_DAY;\n\t}\n\treturn midnightTs;\n}\n\n// export function getMonthsBetween(startDate, endDate) {}\n\nexport function getWeeksBetween(startDate, endDate) {\n\tlet weekStartDate = setDayToSunday(startDate);\n\treturn Math.ceil(getDaysBetween(weekStartDate, endDate) / NO_OF_DAYS_IN_WEEK);\n}\n\nexport function getDaysBetween(startDate, endDate) {\n\tlet millisecondsPerDay = SEC_IN_DAY * NO_OF_MILLIS;\n\treturn (treatAsUtc(endDate) - treatAsUtc(startDate)) / millisecondsPerDay;\n}\n\nexport function areInSameMonth(startDate, endDate) {\n\treturn startDate.getMonth() === endDate.getMonth()\n\t\t&& startDate.getFullYear() === endDate.getFullYear();\n}\n\nexport function getMonthName(i, short=false) {\n\tlet monthName = MONTH_NAMES[i];\n\treturn short ? monthName.slice(0, 3) : monthName;\n}\n\nexport function getLastDateInMonth (month, year) {\n\treturn new Date(year, month + 1, 0); // 0: last day in previous month\n}\n\n// mutates\nexport function setDayToSunday(date) {\n\tlet newDate = clone(date);\n\tconst day = newDate.getDay();\n\tif(day !== 0) {\n\t\taddDays(newDate, (-1) * day);\n\t}\n\treturn newDate;\n}\n\n// mutates\nexport function addDays(date, numberOfDays) {\n\tdate.setDate(date.getDate() + numberOfDays);\n}\n","import { makeSVGGroup } from '../utils/draw';\nimport { makeText, makePath, xLine, yLine, yMarker, yRegion, datasetBar, datasetDot, percentageBar, getPaths, heatSquare } from '../utils/draw';\nimport { equilizeNoOfElements } from '../utils/draw-utils';\nimport { translateHoriLine, translateVertLine, animateRegion, animateBar,\n\tanimateDot, animatePath, animatePathStr } from '../utils/animate';\nimport { getMonthName } from '../utils/date-utils';\n\nclass ChartComponent {\n\tconstructor({\n\t\tlayerClass = '',\n\t\tlayerTransform = '',\n\t\tconstants,\n\n\t\tgetData,\n\t\tmakeElements,\n\t\tanimateElements\n\t}) {\n\t\tthis.layerTransform = layerTransform;\n\t\tthis.constants = constants;\n\n\t\tthis.makeElements = makeElements;\n\t\tthis.getData = getData;\n\n\t\tthis.animateElements = animateElements;\n\n\t\tthis.store = [];\n\t\tthis.labels = [];\n\n\t\tthis.layerClass = layerClass;\n\t\tthis.layerClass = typeof(this.layerClass) === 'function'\n\t\t\t? this.layerClass() : this.layerClass;\n\n\t\tthis.refresh();\n\t}\n\n\trefresh(data) {\n\t\tthis.data = data || this.getData();\n\t}\n\n\tsetup(parent) {\n\t\tthis.layer = makeSVGGroup(this.layerClass, this.layerTransform, parent);\n\t}\n\n\tmake() {\n\t\tthis.render(this.data);\n\t\tthis.oldData = this.data;\n\t}\n\n\trender(data) {\n\t\tthis.store = this.makeElements(data);\n\n\t\tthis.layer.textContent = '';\n\t\tthis.store.forEach(element => {\n\t\t\tthis.layer.appendChild(element);\n\t\t});\n\t\tthis.labels.forEach(element => {\n\t\t\tthis.layer.appendChild(element);\n\t\t});\n\t}\n\n\tupdate(animate = true) {\n\t\tthis.refresh();\n\t\tlet animateElements = [];\n\t\tif(animate) {\n\t\t\tanimateElements = this.animateElements(this.data) || [];\n\t\t}\n\t\treturn animateElements;\n\t}\n}\n\nlet componentConfigs = {\n\tdonutSlices: {\n\t\tlayerClass: 'donut-slices',\n\t\tmakeElements(data) {\n\t\t\treturn data.sliceStrings.map((s, i) => {\n\t\t\t\tlet slice = makePath(s, 'donut-path', data.colors[i], 'none', data.strokeWidth);\n\t\t\t\tslice.style.transition = 'transform .3s;';\n\t\t\t\treturn slice;\n\t\t\t});\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\treturn this.store.map((slice, i) => animatePathStr(slice, newData.sliceStrings[i]));\n\t\t},\n\t},\n\tpieSlices: {\n\t\tlayerClass: 'pie-slices',\n\t\tmakeElements(data) {\n\t\t\treturn data.sliceStrings.map((s, i) =>{\n\t\t\t\tlet slice = makePath(s, 'pie-path', 'none', data.colors[i]);\n\t\t\t\tslice.style.transition = 'transform .3s;';\n\t\t\t\treturn slice;\n\t\t\t});\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\treturn this.store.map((slice, i) =>\n\t\t\t\tanimatePathStr(slice, newData.sliceStrings[i])\n\t\t\t);\n\t\t}\n\t},\n\tpercentageBars: {\n\t\tlayerClass: 'percentage-bars',\n\t\tmakeElements(data) {\n\t\t\treturn data.xPositions.map((x, i) =>{\n\t\t\t\tlet y = 0;\n\t\t\t\tlet bar = percentageBar(x, y, data.widths[i],\n\t\t\t\t\tthis.constants.barHeight, this.constants.barDepth, data.colors[i]);\n\t\t\t\treturn bar;\n\t\t\t});\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tif(newData) return [];\n\t\t}\n\t},\n\tyAxis: {\n\t\tlayerClass: 'y axis',\n\t\tmakeElements(data) {\n\t\t\treturn data.positions.map((position, i) =>\n\t\t\t\tyLine(position, data.labels[i], this.constants.width,\n\t\t\t\t\t{mode: this.constants.mode, pos: this.constants.pos, shortenNumbers: this.constants.shortenNumbers})\n\t\t\t);\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tlet newPos = newData.positions;\n\t\t\tlet newLabels = newData.labels;\n\t\t\tlet oldPos = this.oldData.positions;\n\t\t\tlet oldLabels = this.oldData.labels;\n\n\t\t\t[oldPos, newPos] = equilizeNoOfElements(oldPos, newPos);\n\t\t\t[oldLabels, newLabels] = equilizeNoOfElements(oldLabels, newLabels);\n\n\t\t\tthis.render({\n\t\t\t\tpositions: oldPos,\n\t\t\t\tlabels: newLabels\n\t\t\t});\n\n\t\t\treturn this.store.map((line, i) => {\n\t\t\t\treturn translateHoriLine(\n\t\t\t\t\tline, newPos[i], oldPos[i]\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t},\n\n\txAxis: {\n\t\tlayerClass: 'x axis',\n\t\tmakeElements(data) {\n\t\t\treturn data.positions.map((position, i) =>\n\t\t\t\txLine(position, data.calcLabels[i], this.constants.height,\n\t\t\t\t\t{mode: this.constants.mode, pos: this.constants.pos})\n\t\t\t);\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tlet newPos = newData.positions;\n\t\t\tlet newLabels = newData.calcLabels;\n\t\t\tlet oldPos = this.oldData.positions;\n\t\t\tlet oldLabels = this.oldData.calcLabels;\n\n\t\t\t[oldPos, newPos] = equilizeNoOfElements(oldPos, newPos);\n\t\t\t[oldLabels, newLabels] = equilizeNoOfElements(oldLabels, newLabels);\n\n\t\t\tthis.render({\n\t\t\t\tpositions: oldPos,\n\t\t\t\tcalcLabels: newLabels\n\t\t\t});\n\n\t\t\treturn this.store.map((line, i) => {\n\t\t\t\treturn translateVertLine(\n\t\t\t\t\tline, newPos[i], oldPos[i]\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t},\n\n\tyMarkers: {\n\t\tlayerClass: 'y-markers',\n\t\tmakeElements(data) {\n\t\t\treturn data.map(m =>\n\t\t\t\tyMarker(m.position, m.label, this.constants.width,\n\t\t\t\t\t{labelPos: m.options.labelPos, mode: 'span', lineType: 'dashed'})\n\t\t\t);\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\t[this.oldData, newData] = equilizeNoOfElements(this.oldData, newData);\n\n\t\t\tlet newPos = newData.map(d => d.position);\n\t\t\tlet newLabels = newData.map(d => d.label);\n\t\t\tlet newOptions = newData.map(d => d.options);\n\n\t\t\tlet oldPos = this.oldData.map(d => d.position);\n\n\t\t\tthis.render(oldPos.map((pos, i) => {\n\t\t\t\treturn {\n\t\t\t\t\tposition: oldPos[i],\n\t\t\t\t\tlabel: newLabels[i],\n\t\t\t\t\toptions: newOptions[i]\n\t\t\t\t};\n\t\t\t}));\n\n\t\t\treturn this.store.map((line, i) => {\n\t\t\t\treturn translateHoriLine(\n\t\t\t\t\tline, newPos[i], oldPos[i]\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t},\n\n\tyRegions: {\n\t\tlayerClass: 'y-regions',\n\t\tmakeElements(data) {\n\t\t\treturn data.map(r =>\n\t\t\t\tyRegion(r.startPos, r.endPos, this.constants.width,\n\t\t\t\t\tr.label, {labelPos: r.options.labelPos})\n\t\t\t);\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\t[this.oldData, newData] = equilizeNoOfElements(this.oldData, newData);\n\n\t\t\tlet newPos = newData.map(d => d.endPos);\n\t\t\tlet newLabels = newData.map(d => d.label);\n\t\t\tlet newStarts = newData.map(d => d.startPos);\n\t\t\tlet newOptions = newData.map(d => d.options);\n\n\t\t\tlet oldPos = this.oldData.map(d => d.endPos);\n\t\t\tlet oldStarts = this.oldData.map(d => d.startPos);\n\n\t\t\tthis.render(oldPos.map((pos, i) => {\n\t\t\t\treturn {\n\t\t\t\t\tstartPos: oldStarts[i],\n\t\t\t\t\tendPos: oldPos[i],\n\t\t\t\t\tlabel: newLabels[i],\n\t\t\t\t\toptions: newOptions[i]\n\t\t\t\t};\n\t\t\t}));\n\n\t\t\tlet animateElements = [];\n\n\t\t\tthis.store.map((rectGroup, i) => {\n\t\t\t\tanimateElements = animateElements.concat(animateRegion(\n\t\t\t\t\trectGroup, newStarts[i], newPos[i], oldPos[i]\n\t\t\t\t));\n\t\t\t});\n\n\t\t\treturn animateElements;\n\t\t}\n\t},\n\n\theatDomain: {\n\t\tlayerClass: function() { return 'heat-domain domain-' + this.constants.index; },\n\t\tmakeElements(data) {\n\t\t\tlet {index, colWidth, rowHeight, squareSize, radius, xTranslate} = this.constants;\n\t\t\tlet monthNameHeight = -12;\n\t\t\tlet x = xTranslate, y = 0;\n\n\t\t\tthis.serializedSubDomains = [];\n\n\t\t\tdata.cols.map((week, weekNo) => {\n\t\t\t\tif(weekNo === 1) {\n\t\t\t\t\tthis.labels.push(\n\t\t\t\t\t\tmakeText('domain-name', x, monthNameHeight, getMonthName(index, true).toUpperCase(),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfontSize: 9\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tweek.map((day, i) => {\n\t\t\t\t\tif(day.fill) {\n\t\t\t\t\t\tlet data = {\n\t\t\t\t\t\t\t'data-date': day.yyyyMmDd,\n\t\t\t\t\t\t\t'data-value': day.dataValue,\n\t\t\t\t\t\t\t'data-day': i\n\t\t\t\t\t\t};\n\t\t\t\t\t\tlet square = heatSquare('day', x, y, squareSize, radius, day.fill, data);\n\t\t\t\t\t\tthis.serializedSubDomains.push(square);\n\t\t\t\t\t}\n\t\t\t\t\ty += rowHeight;\n\t\t\t\t});\n\t\t\t\ty = 0;\n\t\t\t\tx += colWidth;\n\t\t\t});\n\n\t\t\treturn this.serializedSubDomains;\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tif(newData) return [];\n\t\t}\n\t},\n\n\tbarGraph: {\n\t\tlayerClass: function() { return 'dataset-units dataset-bars dataset-' + this.constants.index; },\n\t\tmakeElements(data) {\n\t\t\tlet c = this.constants;\n\t\t\tthis.unitType = 'bar';\n\t\t\tthis.units = data.yPositions.map((y, j) => {\n\t\t\t\treturn datasetBar(\n\t\t\t\t\tdata.xPositions[j],\n\t\t\t\t\ty,\n\t\t\t\t\tdata.barWidth,\n\t\t\t\t\tc.color,\n\t\t\t\t\tdata.labels[j],\n\t\t\t\t\tj,\n\t\t\t\t\tdata.offsets[j],\n\t\t\t\t\t{\n\t\t\t\t\t\tzeroLine: data.zeroLine,\n\t\t\t\t\t\tbarsWidth: data.barsWidth,\n\t\t\t\t\t\tminHeight: c.minHeight\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t\treturn this.units;\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\tlet newXPos = newData.xPositions;\n\t\t\tlet newYPos = newData.yPositions;\n\t\t\tlet newOffsets = newData.offsets;\n\t\t\tlet newLabels = newData.labels;\n\n\t\t\tlet oldXPos = this.oldData.xPositions;\n\t\t\tlet oldYPos = this.oldData.yPositions;\n\t\t\tlet oldOffsets = this.oldData.offsets;\n\t\t\tlet oldLabels = this.oldData.labels;\n\n\t\t\t[oldXPos, newXPos] = equilizeNoOfElements(oldXPos, newXPos);\n\t\t\t[oldYPos, newYPos] = equilizeNoOfElements(oldYPos, newYPos);\n\t\t\t[oldOffsets, newOffsets] = equilizeNoOfElements(oldOffsets, newOffsets);\n\t\t\t[oldLabels, newLabels] = equilizeNoOfElements(oldLabels, newLabels);\n\n\t\t\tthis.render({\n\t\t\t\txPositions: oldXPos,\n\t\t\t\tyPositions: oldYPos,\n\t\t\t\toffsets: oldOffsets,\n\t\t\t\tlabels: newLabels,\n\n\t\t\t\tzeroLine: this.oldData.zeroLine,\n\t\t\t\tbarsWidth: this.oldData.barsWidth,\n\t\t\t\tbarWidth: this.oldData.barWidth,\n\t\t\t});\n\n\t\t\tlet animateElements = [];\n\n\t\t\tthis.store.map((bar, i) => {\n\t\t\t\tanimateElements = animateElements.concat(animateBar(\n\t\t\t\t\tbar, newXPos[i], newYPos[i], newData.barWidth, newOffsets[i],\n\t\t\t\t\t{zeroLine: newData.zeroLine}\n\t\t\t\t));\n\t\t\t});\n\n\t\t\treturn animateElements;\n\t\t}\n\t},\n\n\tlineGraph: {\n\t\tlayerClass: function() { return 'dataset-units dataset-line dataset-' + this.constants.index; },\n\t\tmakeElements(data) {\n\t\t\tlet c = this.constants;\n\t\t\tthis.unitType = 'dot';\n\t\t\tthis.paths = {};\n\t\t\tif(!c.hideLine) {\n\t\t\t\tthis.paths = getPaths(\n\t\t\t\t\tdata.xPositions,\n\t\t\t\t\tdata.yPositions,\n\t\t\t\t\tc.color,\n\t\t\t\t\t{\n\t\t\t\t\t\theatline: c.heatline,\n\t\t\t\t\t\tregionFill: c.regionFill,\n\t\t\t\t\t\tspline: c.spline\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tsvgDefs: c.svgDefs,\n\t\t\t\t\t\tzeroLine: data.zeroLine\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.units = [];\n\t\t\tif(!c.hideDots) {\n\t\t\t\tthis.units = data.yPositions.map((y, j) => {\n\t\t\t\t\treturn datasetDot(\n\t\t\t\t\t\tdata.xPositions[j],\n\t\t\t\t\t\ty,\n\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\tc.color,\n\t\t\t\t\t\t(c.valuesOverPoints ? data.values[j] : ''),\n\t\t\t\t\t\tj\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn Object.values(this.paths).concat(this.units);\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\tlet newXPos = newData.xPositions;\n\t\t\tlet newYPos = newData.yPositions;\n\t\t\tlet newValues = newData.values;\n\n\t\t\tlet oldXPos = this.oldData.xPositions;\n\t\t\tlet oldYPos = this.oldData.yPositions;\n\t\t\tlet oldValues = this.oldData.values;\n\n\t\t\t[oldXPos, newXPos] = equilizeNoOfElements(oldXPos, newXPos);\n\t\t\t[oldYPos, newYPos] = equilizeNoOfElements(oldYPos, newYPos);\n\t\t\t[oldValues, newValues] = equilizeNoOfElements(oldValues, newValues);\n\n\t\t\tthis.render({\n\t\t\t\txPositions: oldXPos,\n\t\t\t\tyPositions: oldYPos,\n\t\t\t\tvalues: newValues,\n\n\t\t\t\tzeroLine: this.oldData.zeroLine,\n\t\t\t\tradius: this.oldData.radius,\n\t\t\t});\n\n\t\t\tlet animateElements = [];\n\n\t\t\tif(Object.keys(this.paths).length) {\n\t\t\t\tanimateElements = animateElements.concat(animatePath(\n\t\t\t\t\tthis.paths, newXPos, newYPos, newData.zeroLine, this.constants.spline));\n\t\t\t}\n\n\t\t\tif(this.units.length) {\n\t\t\t\tthis.units.map((dot, i) => {\n\t\t\t\t\tanimateElements = animateElements.concat(animateDot(\n\t\t\t\t\t\tdot, newXPos[i], newYPos[i]));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn animateElements;\n\t\t}\n\t}\n};\n\nexport function getComponent(name, constants, getData) {\n\tlet keys = Object.keys(componentConfigs).filter(k => name.includes(k));\n\tlet config = componentConfigs[keys[0]];\n\tObject.assign(config, {\n\t\tconstants: constants,\n\t\tgetData: getData\n\t});\n\treturn new ChartComponent(config);\n}\n","import { floatTwo } from './helpers';\n\nfunction normalize(x) {\n\t// Calculates mantissa and exponent of a number\n\t// Returns normalized number and exponent\n\t// https://stackoverflow.com/q/9383593/6495043\n\n\tif(x===0) {\n\t\treturn [0, 0];\n\t}\n\tif(isNaN(x)) {\n\t\treturn {mantissa: -6755399441055744, exponent: 972};\n\t}\n\tvar sig = x > 0 ? 1 : -1;\n\tif(!isFinite(x)) {\n\t\treturn {mantissa: sig * 4503599627370496, exponent: 972};\n\t}\n\n\tx = Math.abs(x);\n\tvar exp = Math.floor(Math.log10(x));\n\tvar man = x/Math.pow(10, exp);\n\n\treturn [sig * man, exp];\n}\n\nfunction getChartRangeIntervals(max, min=0) {\n\tlet upperBound = Math.ceil(max);\n\tlet lowerBound = Math.floor(min);\n\tlet range = upperBound - lowerBound;\n\n\tlet noOfParts = range;\n\tlet partSize = 1;\n\n\t// To avoid too many partitions\n\tif(range > 5) {\n\t\tif(range % 2 !== 0) {\n\t\t\tupperBound++;\n\t\t\t// Recalc range\n\t\t\trange = upperBound - lowerBound;\n\t\t}\n\t\tnoOfParts = range/2;\n\t\tpartSize = 2;\n\t}\n\n\t// Special case: 1 and 2\n\tif(range <= 2) {\n\t\tnoOfParts = 4;\n\t\tpartSize = range/noOfParts;\n\t}\n\n\t// Special case: 0\n\tif(range === 0) {\n\t\tnoOfParts = 5;\n\t\tpartSize = 1;\n\t}\n\n\tlet intervals = [];\n\tfor(var i = 0; i <= noOfParts; i++){\n\t\tintervals.push(lowerBound + partSize * i);\n\t}\n\treturn intervals;\n}\n\nfunction getChartIntervals(maxValue, minValue=0) {\n\tlet [normalMaxValue, exponent] = normalize(maxValue);\n\tlet normalMinValue = minValue ? minValue/Math.pow(10, exponent): 0;\n\n\t// Allow only 7 significant digits\n\tnormalMaxValue = normalMaxValue.toFixed(6);\n\n\tlet intervals = getChartRangeIntervals(normalMaxValue, normalMinValue);\n\tintervals = intervals.map(value => value * Math.pow(10, exponent));\n\treturn intervals;\n}\n\nexport function calcChartIntervals(values, withMinimum=false) {\n\t//*** Where the magic happens ***\n\n\t// Calculates best-fit y intervals from given values\n\t// and returns the interval array\n\n\tlet maxValue = Math.max(...values);\n\tlet minValue = Math.min(...values);\n\n\t// Exponent to be used for pretty print\n\tlet exponent = 0, intervals = []; // eslint-disable-line no-unused-vars\n\n\tfunction getPositiveFirstIntervals(maxValue, absMinValue) {\n\t\tlet intervals = getChartIntervals(maxValue);\n\n\t\tlet intervalSize = intervals[1] - intervals[0];\n\n\t\t// Then unshift the negative values\n\t\tlet value = 0;\n\t\tfor(var i = 1; value < absMinValue; i++) {\n\t\t\tvalue += intervalSize;\n\t\t\tintervals.unshift((-1) * value);\n\t\t}\n\t\treturn intervals;\n\t}\n\n\t// CASE I: Both non-negative\n\n\tif(maxValue >= 0 && minValue >= 0) {\n\t\texponent = normalize(maxValue)[1];\n\t\tif(!withMinimum) {\n\t\t\tintervals = getChartIntervals(maxValue);\n\t\t} else {\n\t\t\tintervals = getChartIntervals(maxValue, minValue);\n\t\t}\n\t}\n\n\t// CASE II: Only minValue negative\n\n\telse if(maxValue > 0 && minValue < 0) {\n\t\t// `withMinimum` irrelevant in this case,\n\t\t// We'll be handling both sides of zero separately\n\t\t// (both starting from zero)\n\t\t// Because ceil() and floor() behave differently\n\t\t// in those two regions\n\n\t\tlet absMinValue = Math.abs(minValue);\n\n\t\tif(maxValue >= absMinValue) {\n\t\t\texponent = normalize(maxValue)[1];\n\t\t\tintervals = getPositiveFirstIntervals(maxValue, absMinValue);\n\t\t} else {\n\t\t\t// Mirror: maxValue => absMinValue, then change sign\n\t\t\texponent = normalize(absMinValue)[1];\n\t\t\tlet posIntervals = getPositiveFirstIntervals(absMinValue, maxValue);\n\t\t\tintervals = posIntervals.reverse().map(d => d * (-1));\n\t\t}\n\n\t}\n\n\t// CASE III: Both non-positive\n\n\telse if(maxValue <= 0 && minValue <= 0) {\n\t\t// Mirrored Case I:\n\t\t// Work with positives, then reverse the sign and array\n\n\t\tlet pseudoMaxValue = Math.abs(minValue);\n\t\tlet pseudoMinValue = Math.abs(maxValue);\n\n\t\texponent = normalize(pseudoMaxValue)[1];\n\t\tif(!withMinimum) {\n\t\t\tintervals = getChartIntervals(pseudoMaxValue);\n\t\t} else {\n\t\t\tintervals = getChartIntervals(pseudoMaxValue, pseudoMinValue);\n\t\t}\n\n\t\tintervals = intervals.reverse().map(d => d * (-1));\n\t}\n\n\treturn intervals;\n}\n\nexport function getZeroIndex(yPts) {\n\tlet zeroIndex;\n\tlet interval = getIntervalSize(yPts);\n\tif(yPts.indexOf(0) >= 0) {\n\t\t// the range has a given zero\n\t\t// zero-line on the chart\n\t\tzeroIndex = yPts.indexOf(0);\n\t} else if(yPts[0] > 0) {\n\t\t// Minimum value is positive\n\t\t// zero-line is off the chart: below\n\t\tlet min = yPts[0];\n\t\tzeroIndex = (-1) * min / interval;\n\t} else {\n\t\t// Maximum value is negative\n\t\t// zero-line is off the chart: above\n\t\tlet max = yPts[yPts.length - 1];\n\t\tzeroIndex = (-1) * max / interval + (yPts.length - 1);\n\t}\n\treturn zeroIndex;\n}\n\nexport function getRealIntervals(max, noOfIntervals, min = 0, asc = 1) {\n\tlet range = max - min;\n\tlet part = range * 1.0 / noOfIntervals;\n\tlet intervals = [];\n\n\tfor(var i = 0; i <= noOfIntervals; i++) {\n\t\tintervals.push(min + part * i);\n\t}\n\n\treturn asc ? intervals : intervals.reverse();\n}\n\nexport function getIntervalSize(orderedArray) {\n\treturn orderedArray[1] - orderedArray[0];\n}\n\nexport function getValueRange(orderedArray) {\n\treturn orderedArray[orderedArray.length-1] - orderedArray[0];\n}\n\nexport function scale(val, yAxis) {\n\treturn floatTwo(yAxis.zeroLine - val * yAxis.scaleMultiplier);\n}\n\nexport function isInRange(val, min, max) {\n\treturn val > min && val < max;\n}\n\nexport function isInRange2D(coord, minCoord, maxCoord) {\n\treturn isInRange(coord[0], minCoord[0], maxCoord[0])\n\t\t&& isInRange(coord[1], minCoord[1], maxCoord[1]);\n}\n\nexport function getClosestInArray(goal, arr, index = false) {\n\tlet closest = arr.reduce(function(prev, curr) {\n\t\treturn (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev);\n\t}, []);\n\n\treturn index ? arr.indexOf(closest) : closest;\n}\n\nexport function calcDistribution(values, distributionSize) {\n\t// Assume non-negative values,\n\t// implying distribution minimum at zero\n\n\tlet dataMaxValue = Math.max(...values);\n\n\tlet distributionStep = 1 / (distributionSize - 1);\n\tlet distribution = [];\n\n\tfor(var i = 0; i < distributionSize; i++) {\n\t\tlet checkpoint = dataMaxValue * (distributionStep * i);\n\t\tdistribution.push(checkpoint);\n\t}\n\n\treturn distribution;\n}\n\nexport function getMaxCheckpoint(value, distribution) {\n\treturn distribution.filter(d => d < value).length;\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { $ } from '../utils/dom';\nimport { TOOLTIP_POINTER_TRIANGLE_HEIGHT } from '../utils/constants';\n\nexport default class SvgTip {\n\tconstructor({\n\t\tparent = null,\n\t\tcolors = []\n\t}) {\n\t\tthis.parent = parent;\n\t\tthis.colors = colors;\n\t\tthis.titleName = '';\n\t\tthis.titleValue = '';\n\t\tthis.listValues = [];\n\t\tthis.titleValueFirst = 0;\n\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\n\t\tthis.top = 0;\n\t\tthis.left = 0;\n\n\t\tthis.setup();\n\t}\n\n\tsetup() {\n\t\tthis.makeTooltip();\n\t}\n\n\trefresh() {\n\t\tthis.fill();\n\t\tthis.calcPosition();\n\t}\n\n\tmakeTooltip() {\n\t\tthis.container = $.create('div', {\n\t\t\tinside: this.parent,\n\t\t\tclassName: 'graph-svg-tip comparison',\n\t\t\tinnerHTML: `\n\t\t\t\t
        \n\t\t\t\t
        `\n\t\t});\n\t\tthis.hideTip();\n\n\t\tthis.title = this.container.querySelector('.title');\n\t\tthis.dataPointList = this.container.querySelector('.data-point-list');\n\n\t\tthis.parent.addEventListener('mouseleave', () => {\n\t\t\tthis.hideTip();\n\t\t});\n\t}\n\n\tfill() {\n\t\tlet title;\n\t\tif(this.index) {\n\t\t\tthis.container.setAttribute('data-point-index', this.index);\n\t\t}\n\t\tif(this.titleValueFirst) {\n\t\t\ttitle = `${this.titleValue}${this.titleName}`;\n\t\t} else {\n\t\t\ttitle = `${this.titleName}${this.titleValue}`;\n\t\t}\n\t\tthis.title.innerHTML = title;\n\t\tthis.dataPointList.innerHTML = '';\n\n\t\tthis.listValues.map((set, i) => {\n\t\t\tconst color = this.colors[i] || 'black';\n\t\t\tlet value = set.formatted === 0 || set.formatted ? set.formatted : set.value;\n\n\t\t\tlet li = $.create('li', {\n\t\t\t\tstyles: {\n\t\t\t\t\t'border-top': `3px solid ${color}`\n\t\t\t\t},\n\t\t\t\tinnerHTML: `${ value === 0 || value ? value : '' }\n\t\t\t\t\t${set.title ? set.title : '' }`\n\t\t\t});\n\n\t\t\tthis.dataPointList.appendChild(li);\n\t\t});\n\t}\n\n\tcalcPosition() {\n\t\tlet width = this.container.offsetWidth;\n\n\t\tthis.top = this.y - this.container.offsetHeight\n\t\t\t- TOOLTIP_POINTER_TRIANGLE_HEIGHT;\n\t\tthis.left = this.x - width/2;\n\t\tlet maxLeft = this.parent.offsetWidth - width;\n\n\t\tlet pointer = this.container.querySelector('.svg-pointer');\n\n\t\tif(this.left < 0) {\n\t\t\tpointer.style.left = `calc(50% - ${-1 * this.left}px)`;\n\t\t\tthis.left = 0;\n\t\t} else if(this.left > maxLeft) {\n\t\t\tlet delta = this.left - maxLeft;\n\t\t\tlet pointerOffset = `calc(50% + ${delta}px)`;\n\t\t\tpointer.style.left = pointerOffset;\n\n\t\t\tthis.left = maxLeft;\n\t\t} else {\n\t\t\tpointer.style.left = `50%`;\n\t\t}\n\t}\n\n\tsetValues(x, y, title = {}, listValues = [], index = -1) {\n\t\tthis.titleName = title.name;\n\t\tthis.titleValue = title.value;\n\t\tthis.listValues = listValues;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.titleValueFirst = title.valueFirst || 0;\n\t\tthis.index = index;\n\t\tthis.refresh();\n\t}\n\n\thideTip() {\n\t\tthis.container.style.top = '0px';\n\t\tthis.container.style.left = '0px';\n\t\tthis.container.style.opacity = '0';\n\t}\n\n\tshowTip() {\n\t\tthis.container.style.top = this.top + 'px';\n\t\tthis.container.style.left = this.left + 'px';\n\t\tthis.container.style.opacity = '1';\n\t}\n}\n","export const CSSTEXT = \".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}\";","import SvgTip from '../objects/SvgTip';\nimport { $, isElementInViewport, getElementContentWidth, isHidden } from '../utils/dom';\nimport { makeSVGContainer, makeSVGDefs, makeSVGGroup, makeText } from '../utils/draw';\nimport { BASE_MEASURES, getExtraHeight, getExtraWidth, getTopOffset, getLeftOffset,\n\tINIT_CHART_UPDATE_TIMEOUT, CHART_POST_ANIMATE_TIMEOUT, DEFAULT_COLORS} from '../utils/constants';\nimport { getColor, isValidColor } from '../utils/colors';\nimport { runSMILAnimation } from '../utils/animation';\nimport { downloadFile, prepareForExport } from '../utils/export';\nimport { deepClone } from '../utils/helpers';\n\nexport default class BaseChart {\n\tconstructor(parent, options) {\n\t\t// deepclone options to avoid making changes to orignal object\n\t\toptions = deepClone(options);\n\n\t\tthis.parent = typeof parent === 'string'\n\t\t\t? document.querySelector(parent)\n\t\t\t: parent;\n\n\t\tif (!(this.parent instanceof HTMLElement)) {\n\t\t\tthrow new Error('No `parent` element to render on was provided.');\n\t\t}\n\n\t\tthis.rawChartArgs = options;\n\n\t\tthis.title = options.title || '';\n\t\tthis.type = options.type || '';\n\n\t\tthis.realData = this.prepareData(options.data);\n\t\tthis.data = this.prepareFirstData(this.realData);\n\n\t\tthis.colors = this.validateColors(options.colors, this.type);\n\n\t\tthis.config = {\n\t\t\tshowTooltip: 1, // calculate\n\t\t\tshowLegend: 1, // calculate\n\t\t\tisNavigable: options.isNavigable || 0,\n\t\t\tanimate: (typeof options.animate !== 'undefined') ? options.animate : 1,\n\t\t\ttruncateLegends: options.truncateLegends || 1\n\t\t};\n\n\t\tthis.measures = JSON.parse(JSON.stringify(BASE_MEASURES));\n\t\tlet m = this.measures;\n\t\tthis.setMeasures(options);\n\t\tif(!this.title.length) { m.titleHeight = 0; }\n\t\tif(!this.config.showLegend) m.legendHeight = 0;\n\t\tthis.argHeight = options.height || m.baseHeight;\n\n\t\tthis.state = {};\n\t\tthis.options = {};\n\n\t\tthis.initTimeout = INIT_CHART_UPDATE_TIMEOUT;\n\n\t\tif(this.config.isNavigable) {\n\t\t\tthis.overlays = [];\n\t\t}\n\n\t\tthis.configure(options);\n\t}\n\n\tprepareData(data) {\n\t\treturn data;\n\t}\n\n\tprepareFirstData(data) {\n\t\treturn data;\n\t}\n\n\tvalidateColors(colors, type) {\n\t\tconst validColors = [];\n\t\tcolors = (colors || []).concat(DEFAULT_COLORS[type]);\n\t\tcolors.forEach((string) => {\n\t\t\tconst color = getColor(string);\n\t\t\tif(!isValidColor(color)) {\n\t\t\t\tconsole.warn('\"' + string + '\" is not a valid color.');\n\t\t\t} else {\n\t\t\t\tvalidColors.push(color);\n\t\t\t}\n\t\t});\n\t\treturn validColors;\n\t}\n\n\tsetMeasures() {\n\t\t// Override measures, including those for title and legend\n\t\t// set config for legend and title\n\t}\n\n\tconfigure() {\n\t\tlet height = this.argHeight;\n\t\tthis.baseHeight = height;\n\t\tthis.height = height - getExtraHeight(this.measures);\n\n\t\t// Bind window events\n\t\tthis.boundDrawFn = () => this.draw(true);\n\t\tif (ResizeObserver) {\n\t\t\tthis.resizeObserver = new ResizeObserver(this.boundDrawFn);\n\t\t\tthis.resizeObserver.observe(this.parent);\n\t\t}\n\t\twindow.addEventListener('resize', this.boundDrawFn);\n\t\twindow.addEventListener('orientationchange', this.boundDrawFn);\n\t}\n\n\tdestroy() {\n\t\tif (this.resizeObserver) this.resizeObserver.disconnect();\n\t\twindow.removeEventListener('resize', this.boundDrawFn);\n\t\twindow.removeEventListener('orientationchange', this.boundDrawFn);\n\t}\n\n\t// Has to be called manually\n\tsetup() {\n\t\tthis.makeContainer();\n\t\tthis.updateWidth();\n\t\tthis.makeTooltip();\n\n\t\tthis.draw(false, true);\n\t}\n\n\tmakeContainer() {\n\t\t// Chart needs a dedicated parent element\n\t\tthis.parent.innerHTML = '';\n\n\t\tlet args = {\n\t\t\tinside: this.parent,\n\t\t\tclassName: 'chart-container'\n\t\t};\n\n\t\tif(this.independentWidth) {\n\t\t\targs.styles = { width: this.independentWidth + 'px' };\n\t\t}\n\n\t\tthis.container = $.create('div', args);\n\t}\n\n\tmakeTooltip() {\n\t\tthis.tip = new SvgTip({\n\t\t\tparent: this.container,\n\t\t\tcolors: this.colors\n\t\t});\n\t\tthis.bindTooltip();\n\t}\n\n\tbindTooltip() {}\n\n\tdraw(onlyWidthChange=false, init=false) {\n\t\tif (onlyWidthChange && isHidden(this.parent)) {\n\t\t\t// Don't update anything if the chart is hidden\n\t\t\treturn;\n\t\t}\n\t\tthis.updateWidth();\n\n\t\tthis.calc(onlyWidthChange);\n\t\tthis.makeChartArea();\n\t\tthis.setupComponents();\n\n\t\tthis.components.forEach(c => c.setup(this.drawArea));\n\t\t// this.components.forEach(c => c.make());\n\t\tthis.render(this.components, false);\n\n\t\tif(init) {\n\t\t\tthis.data = this.realData;\n\t\t\tsetTimeout(() => {this.update(this.data);}, this.initTimeout);\n\t\t}\n\n\t\tthis.renderLegend();\n\n\t\tthis.setupNavigation(init);\n\t}\n\n\tcalc() {} // builds state\n\n\tupdateWidth() {\n\t\tthis.baseWidth = getElementContentWidth(this.parent);\n\t\tthis.width = this.baseWidth - getExtraWidth(this.measures);\n\t}\n\n\tmakeChartArea() {\n\t\tif(this.svg) {\n\t\t\tthis.container.removeChild(this.svg);\n\t\t}\n\t\tlet m = this.measures;\n\n\t\tthis.svg = makeSVGContainer(\n\t\t\tthis.container,\n\t\t\t'frappe-chart chart',\n\t\t\tthis.baseWidth,\n\t\t\tthis.baseHeight\n\t\t);\n\t\tthis.svgDefs = makeSVGDefs(this.svg);\n\n\t\tif(this.title.length) {\n\t\t\tthis.titleEL = makeText(\n\t\t\t\t'title',\n\t\t\t\tm.margins.left,\n\t\t\t\tm.margins.top,\n\t\t\t\tthis.title,\n\t\t\t\t{\n\t\t\t\t\tfontSize: m.titleFontSize,\n\t\t\t\t\tfill: '#666666',\n\t\t\t\t\tdy: m.titleFontSize\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tlet top = getTopOffset(m);\n\t\tthis.drawArea = makeSVGGroup(\n\t\t\tthis.type + '-chart chart-draw-area',\n\t\t\t`translate(${getLeftOffset(m)}, ${top})`\n\t\t);\n\n\t\tif(this.config.showLegend) {\n\t\t\ttop += this.height + m.paddings.bottom;\n\t\t\tthis.legendArea = makeSVGGroup(\n\t\t\t\t'chart-legend',\n\t\t\t\t`translate(${getLeftOffset(m)}, ${top})`\n\t\t\t);\n\t\t}\n\n\t\tif(this.title.length) { this.svg.appendChild(this.titleEL); }\n\t\tthis.svg.appendChild(this.drawArea);\n\t\tif(this.config.showLegend) { this.svg.appendChild(this.legendArea); }\n\n\t\tthis.updateTipOffset(getLeftOffset(m), getTopOffset(m));\n\t}\n\n\tupdateTipOffset(x, y) {\n\t\tthis.tip.offset = {\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\t}\n\n\tsetupComponents() { this.components = new Map(); }\n\n\tupdate(data) {\n\t\tif(!data) {\n\t\t\tconsole.error('No data to update.');\n\t\t}\n\t\tthis.data = this.prepareData(data);\n\t\tthis.calc(); // builds state\n\t\tthis.render(this.components, this.config.animate);\n\t\tthis.renderLegend();\n\t}\n\n\trender(components=this.components, animate=true) {\n\t\tif(this.config.isNavigable) {\n\t\t\t// Remove all existing overlays\n\t\t\tthis.overlays.map(o => o.parentNode.removeChild(o));\n\t\t\t// ref.parentNode.insertBefore(element, ref);\n\t\t}\n\t\tlet elementsToAnimate = [];\n\t\t// Can decouple to this.refreshComponents() first to save animation timeout\n\t\tcomponents.forEach(c => {\n\t\t\telementsToAnimate = elementsToAnimate.concat(c.update(animate));\n\t\t});\n\t\tif(elementsToAnimate.length > 0) {\n\t\t\trunSMILAnimation(this.container, this.svg, elementsToAnimate);\n\t\t\tsetTimeout(() => {\n\t\t\t\tcomponents.forEach(c => c.make());\n\t\t\t\tthis.updateNav();\n\t\t\t}, CHART_POST_ANIMATE_TIMEOUT);\n\t\t} else {\n\t\t\tcomponents.forEach(c => c.make());\n\t\t\tthis.updateNav();\n\t\t}\n\t}\n\n\tupdateNav() {\n\t\tif(this.config.isNavigable) {\n\t\t\tthis.makeOverlay();\n\t\t\tthis.bindUnits();\n\t\t}\n\t}\n\n\trenderLegend() {}\n\n\tsetupNavigation(init=false) {\n\t\tif(!this.config.isNavigable) return;\n\n\t\tif(init) {\n\t\t\tthis.bindOverlay();\n\n\t\t\tthis.keyActions = {\n\t\t\t\t'13': this.onEnterKey.bind(this),\n\t\t\t\t'37': this.onLeftArrow.bind(this),\n\t\t\t\t'38': this.onUpArrow.bind(this),\n\t\t\t\t'39': this.onRightArrow.bind(this),\n\t\t\t\t'40': this.onDownArrow.bind(this),\n\t\t\t};\n\n\t\t\tdocument.addEventListener('keydown', (e) => {\n\t\t\t\tif(isElementInViewport(this.container)) {\n\t\t\t\t\te = e || window.event;\n\t\t\t\t\tif(this.keyActions[e.keyCode]) {\n\t\t\t\t\t\tthis.keyActions[e.keyCode]();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tmakeOverlay() {}\n\tupdateOverlay() {}\n\tbindOverlay() {}\n\tbindUnits() {}\n\n\tonLeftArrow() {}\n\tonRightArrow() {}\n\tonUpArrow() {}\n\tonDownArrow() {}\n\tonEnterKey() {}\n\n\taddDataPoint() {}\n\tremoveDataPoint() {}\n\n\tgetDataPoint() {}\n\tsetCurrentDataPoint() {}\n\n\tupdateDataset() {}\n\n\texport() {\n\t\tlet chartSvg = prepareForExport(this.svg);\n\t\tdownloadFile(this.title || 'Chart', [chartSvg]);\n\t}\n}\n","import BaseChart from './BaseChart';\nimport { truncateString } from '../utils/draw-utils';\nimport { legendDot } from '../utils/draw';\nimport { round } from '../utils/helpers';\nimport { getExtraWidth } from '../utils/constants';\n\nexport default class AggregationChart extends BaseChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t}\n\n\tconfigure(args) {\n\t\tsuper.configure(args);\n\n\t\tthis.config.formatTooltipY = (args.tooltipOptions || {}).formatTooltipY;\n\t\tthis.config.maxSlices = args.maxSlices || 20;\n\t\tthis.config.maxLegendPoints = args.maxLegendPoints || 20;\n\t}\n\n\tcalc() {\n\t\tlet s = this.state;\n\t\tlet maxSlices = this.config.maxSlices;\n\t\ts.sliceTotals = [];\n\n\t\tlet allTotals = this.data.labels.map((label, i) => {\n\t\t\tlet total = 0;\n\t\t\tthis.data.datasets.map(e => {\n\t\t\t\ttotal += e.values[i];\n\t\t\t});\n\t\t\treturn [total, label];\n\t\t}).filter(d => { return d[0] >= 0; }); // keep only positive results\n\n\t\tlet totals = allTotals;\n\t\tif(allTotals.length > maxSlices) {\n\t\t\t// Prune and keep a grey area for rest as per maxSlices\n\t\t\tallTotals.sort((a, b) => { return b[0] - a[0]; });\n\n\t\t\ttotals = allTotals.slice(0, maxSlices-1);\n\t\t\tlet remaining = allTotals.slice(maxSlices-1);\n\n\t\t\tlet sumOfRemaining = 0;\n\t\t\tremaining.map(d => {sumOfRemaining += d[0];});\n\t\t\ttotals.push([sumOfRemaining, 'Rest']);\n\t\t\tthis.colors[maxSlices-1] = 'grey';\n\t\t}\n\n\t\ts.labels = [];\n\t\ttotals.map(d => {\n\t\t\ts.sliceTotals.push(round(d[0]));\n\t\t\ts.labels.push(d[1]);\n\t\t});\n\n\t\ts.grandTotal = s.sliceTotals.reduce((a, b) => a + b, 0);\n\n\t\tthis.center = {\n\t\t\tx: this.width / 2,\n\t\t\ty: this.height / 2\n\t\t};\n\t}\n\n\trenderLegend() {\n\t\tlet s = this.state;\n\t\tthis.legendArea.textContent = '';\n\t\tthis.legendTotals = s.sliceTotals.slice(0, this.config.maxLegendPoints);\n\n\t\tlet count = 0;\n\t\tlet y = 0;\n\t\tthis.legendTotals.map((d, i) => {\n\t\t\tlet barWidth = 150;\n\t\t\tlet divisor = Math.floor(\n\t\t\t\t(this.width - getExtraWidth(this.measures))/barWidth\n\t\t\t);\n\t\t\tif (this.legendTotals.length < divisor) {\n\t\t\t\tbarWidth = this.width/this.legendTotals.length;\n\t\t\t}\n\t\t\tif(count > divisor) {\n\t\t\t\tcount = 0;\n\t\t\t\ty += 20;\n\t\t\t}\n\t\t\tlet x = barWidth * count + 5;\n\t\t\tlet label = this.config.truncateLegends ? truncateString(s.labels[i], barWidth/10) : s.labels[i];\n\t\t\tlet formatted = this.config.formatTooltipY ? this.config.formatTooltipY(d) : d;\n\t\t\tlet dot = legendDot(\n\t\t\t\tx,\n\t\t\t\ty,\n\t\t\t\t5,\n\t\t\t\tthis.colors[i],\n\t\t\t\t`${label}: ${formatted}`,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tthis.legendArea.appendChild(dot);\n\t\t\tcount++;\n\t\t});\n\t}\n}\n","import AggregationChart from './AggregationChart';\nimport { getOffset } from '../utils/dom';\nimport { getComponent } from '../objects/ChartComponents';\nimport { PERCENTAGE_BAR_DEFAULT_HEIGHT, PERCENTAGE_BAR_DEFAULT_DEPTH } from '../utils/constants';\n\nexport default class PercentageChart extends AggregationChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t\tthis.type = 'percentage';\n\t\tthis.setup();\n\t}\n\n\tsetMeasures(options) {\n\t\tlet m = this.measures;\n\t\tthis.barOptions = options.barOptions || {};\n\n\t\tlet b = this.barOptions;\n\t\tb.height = b.height || PERCENTAGE_BAR_DEFAULT_HEIGHT;\n\t\tb.depth = b.depth || PERCENTAGE_BAR_DEFAULT_DEPTH;\n\n\t\tm.paddings.right = 30;\n\t\tm.legendHeight = 60;\n\t\tm.baseHeight = (b.height + b.depth * 0.5) * 8;\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'percentageBars',\n\t\t\t\t{\n\t\t\t\t\tbarHeight: this.barOptions.height,\n\t\t\t\t\tbarDepth: this.barOptions.depth,\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\txPositions: s.xPositions,\n\t\t\t\t\t\twidths: s.widths,\n\t\t\t\t\t\tcolors: this.colors\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tcalc() {\n\t\tsuper.calc();\n\t\tlet s = this.state;\n\n\t\ts.xPositions = [];\n\t\ts.widths = [];\n\n\t\tlet xPos = 0;\n\t\ts.sliceTotals.map((value) => {\n\t\t\tlet width = this.width * value / s.grandTotal;\n\t\t\ts.widths.push(width);\n\t\t\ts.xPositions.push(xPos);\n\t\t\txPos += width;\n\t\t});\n\t}\n\n\tmakeDataByIndex() { }\n\n\tbindTooltip() {\n\t\tlet s = this.state;\n\t\tthis.container.addEventListener('mousemove', (e) => {\n\t\t\tlet bars = this.components.get('percentageBars').store;\n\t\t\tlet bar = e.target;\n\t\t\tif(bars.includes(bar)) {\n\n\t\t\t\tlet i = bars.indexOf(bar);\n\t\t\t\tlet gOff = getOffset(this.container), pOff = getOffset(bar);\n\n\t\t\t\tlet x = pOff.left - gOff.left + parseInt(bar.getAttribute('width'))/2;\n\t\t\t\tlet y = pOff.top - gOff.top;\n\t\t\t\tlet title = (this.formattedLabels && this.formattedLabels.length>0\n\t\t\t\t\t? this.formattedLabels[i] : this.state.labels[i]) + ': ';\n\t\t\t\tlet fraction = s.sliceTotals[i]/s.grandTotal;\n\n\t\t\t\tthis.tip.setValues(x, y, {name: title, value: (fraction*100).toFixed(1) + \"%\"});\n\t\t\t\tthis.tip.showTip();\n\t\t\t}\n\t\t});\n\t}\n}\n","import AggregationChart from './AggregationChart';\nimport { getComponent } from '../objects/ChartComponents';\nimport { getOffset } from '../utils/dom';\nimport { getPositionByAngle } from '../utils/helpers';\nimport { makeArcPathStr, makeCircleStr } from '../utils/draw';\nimport { lightenDarkenColor } from '../utils/colors';\nimport { transform } from '../utils/animation';\nimport { FULL_ANGLE } from '../utils/constants';\n\nexport default class PieChart extends AggregationChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t\tthis.type = 'pie';\n\t\tthis.initTimeout = 0;\n\t\tthis.init = 1;\n\n\t\tthis.setup();\n\t}\n\n\tconfigure(args) {\n\t\tsuper.configure(args);\n\t\tthis.mouseMove = this.mouseMove.bind(this);\n\t\tthis.mouseLeave = this.mouseLeave.bind(this);\n\n\t\tthis.hoverRadio = args.hoverRadio || 0.1;\n\t\tthis.config.startAngle = args.startAngle || 0;\n\n\t\tthis.clockWise = args.clockWise || false;\n\t}\n\n\tcalc() {\n\t\tsuper.calc();\n\t\tlet s = this.state;\n\t\tthis.radius = (this.height > this.width ? this.center.x : this.center.y);\n\n\t\tconst { radius, clockWise } = this;\n\n\t\tconst prevSlicesProperties = s.slicesProperties || [];\n\t\ts.sliceStrings = [];\n\t\ts.slicesProperties = [];\n\t\tlet curAngle = 180 - this.config.startAngle;\n\t\ts.sliceTotals.map((total, i) => {\n\t\t\tconst startAngle = curAngle;\n\t\t\tconst originDiffAngle = (total / s.grandTotal) * FULL_ANGLE;\n\t\t\tconst largeArc = originDiffAngle > 180 ? 1: 0;\n\t\t\tconst diffAngle = clockWise ? -originDiffAngle : originDiffAngle;\n\t\t\tconst endAngle = curAngle = curAngle + diffAngle;\n\t\t\tconst startPosition = getPositionByAngle(startAngle, radius);\n\t\t\tconst endPosition = getPositionByAngle(endAngle, radius);\n\n\t\t\tconst prevProperty = this.init && prevSlicesProperties[i];\n\n\t\t\tlet curStart,curEnd;\n\t\t\tif(this.init) {\n\t\t\t\tcurStart = prevProperty ? prevProperty.startPosition : startPosition;\n\t\t\t\tcurEnd = prevProperty ? prevProperty.endPosition : startPosition;\n\t\t\t} else {\n\t\t\t\tcurStart = startPosition;\n\t\t\t\tcurEnd = endPosition;\n\t\t\t}\n\t\t\tconst curPath =\n\t\t\t\toriginDiffAngle === 360\n\t\t\t\t\t? makeCircleStr(curStart, curEnd, this.center, this.radius, clockWise, largeArc)\n\t\t\t\t\t: makeArcPathStr(curStart, curEnd, this.center, this.radius, clockWise, largeArc);\n\n\t\t\ts.sliceStrings.push(curPath);\n\t\t\ts.slicesProperties.push({\n\t\t\t\tstartPosition,\n\t\t\t\tendPosition,\n\t\t\t\tvalue: total,\n\t\t\t\ttotal: s.grandTotal,\n\t\t\t\tstartAngle,\n\t\t\t\tendAngle,\n\t\t\t\tangle: diffAngle\n\t\t\t});\n\n\t\t});\n\t\tthis.init = 0;\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'pieSlices',\n\t\t\t\t{ },\n\t\t\t\tfunction() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsliceStrings: s.sliceStrings,\n\t\t\t\t\t\tcolors: this.colors\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tcalTranslateByAngle(property){\n\t\tconst{radius,hoverRadio} = this;\n\t\tconst position = getPositionByAngle(property.startAngle+(property.angle / 2),radius);\n\t\treturn `translate3d(${(position.x) * hoverRadio}px,${(position.y) * hoverRadio}px,0)`;\n\t}\n\n\thoverSlice(path,i,flag,e){\n\t\tif(!path) return;\n\t\tconst color = this.colors[i];\n\t\tif(flag) {\n\t\t\ttransform(path, this.calTranslateByAngle(this.state.slicesProperties[i]));\n\t\t\tpath.style.fill = lightenDarkenColor(color, 50);\n\t\t\tlet g_off = getOffset(this.svg);\n\t\t\tlet x = e.pageX - g_off.left + 10;\n\t\t\tlet y = e.pageY - g_off.top - 10;\n\t\t\tlet title = (this.formatted_labels && this.formatted_labels.length > 0\n\t\t\t\t? this.formatted_labels[i] : this.state.labels[i]) + ': ';\n\t\t\tlet percent = (this.state.sliceTotals[i] * 100 / this.state.grandTotal).toFixed(1);\n\t\t\tthis.tip.setValues(x, y, {name: title, value: percent + \"%\"});\n\t\t\tthis.tip.showTip();\n\t\t} else {\n\t\t\ttransform(path,'translate3d(0,0,0)');\n\t\t\tthis.tip.hideTip();\n\t\t\tpath.style.fill = color;\n\t\t}\n\t}\n\n\tbindTooltip() {\n\t\tthis.container.addEventListener('mousemove', this.mouseMove);\n\t\tthis.container.addEventListener('mouseleave', this.mouseLeave);\n\t}\n\n\tmouseMove(e){\n\t\tconst target = e.target;\n\t\tlet slices = this.components.get('pieSlices').store;\n\t\tlet prevIndex = this.curActiveSliceIndex;\n\t\tlet prevAcitve = this.curActiveSlice;\n\t\tif(slices.includes(target)) {\n\t\t\tlet i = slices.indexOf(target);\n\t\t\tthis.hoverSlice(prevAcitve, prevIndex,false);\n\t\t\tthis.curActiveSlice = target;\n\t\t\tthis.curActiveSliceIndex = i;\n\t\t\tthis.hoverSlice(target, i, true, e);\n\t\t} else {\n\t\t\tthis.mouseLeave();\n\t\t}\n\t}\n\n\tmouseLeave(){\n\t\tthis.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,false);\n\t}\n}\n","import BaseChart from './BaseChart';\nimport { getComponent } from '../objects/ChartComponents';\nimport { makeText, heatSquare } from '../utils/draw';\nimport { DAY_NAMES_SHORT, addDays, areInSameMonth, getLastDateInMonth, setDayToSunday, getYyyyMmDd, getWeeksBetween, getMonthName, clone,\n\tNO_OF_MILLIS, NO_OF_YEAR_MONTHS, NO_OF_DAYS_IN_WEEK } from '../utils/date-utils';\nimport { calcDistribution, getMaxCheckpoint } from '../utils/intervals';\nimport { getExtraHeight, getExtraWidth, HEATMAP_DISTRIBUTION_SIZE, HEATMAP_SQUARE_SIZE,\n\tHEATMAP_GUTTER_SIZE } from '../utils/constants';\n\nconst COL_WIDTH = HEATMAP_SQUARE_SIZE + HEATMAP_GUTTER_SIZE;\nconst ROW_HEIGHT = COL_WIDTH;\n// const DAY_INCR = 1;\n\nexport default class Heatmap extends BaseChart {\n\tconstructor(parent, options) {\n\t\tsuper(parent, options);\n\t\tthis.type = 'heatmap';\n\n\t\tthis.countLabel = options.countLabel || '';\n\n\t\tlet validStarts = ['Sunday', 'Monday'];\n\t\tlet startSubDomain = validStarts.includes(options.startSubDomain)\n\t\t\t? options.startSubDomain : 'Sunday';\n\t\tthis.startSubDomainIndex = validStarts.indexOf(startSubDomain);\n\n\t\tthis.setup();\n\t}\n\n\tsetMeasures(options) {\n\t\tlet m = this.measures;\n\t\tthis.discreteDomains = options.discreteDomains === 0 ? 0 : 1;\n\n\t\tm.paddings.top = ROW_HEIGHT * 3;\n\t\tm.paddings.bottom = 0;\n\t\tm.legendHeight = ROW_HEIGHT * 2;\n\t\tm.baseHeight = ROW_HEIGHT * NO_OF_DAYS_IN_WEEK\n\t\t\t+ getExtraHeight(m);\n\n\t\tlet d = this.data;\n\t\tlet spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;\n\t\tthis.independentWidth = (getWeeksBetween(d.start, d.end)\n\t\t\t+ spacing) * COL_WIDTH + getExtraWidth(m);\n\t}\n\n\tupdateWidth() {\n\t\tlet spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;\n\t\tlet noOfWeeks = this.state.noOfWeeks ? this.state.noOfWeeks : 52;\n\t\tthis.baseWidth = (noOfWeeks + spacing) * COL_WIDTH\n\t\t\t+ getExtraWidth(this.measures);\n\t}\n\n\tprepareData(data=this.data) {\n\t\tif(data.start && data.end && data.start > data.end) {\n\t\t\tthrow new Error('Start date cannot be greater than end date.');\n\t\t}\n\n\t\tif(!data.start) {\n\t\t\tdata.start = new Date();\n\t\t\tdata.start.setFullYear( data.start.getFullYear() - 1 );\n\t\t}\n\t\tif(!data.end) { data.end = new Date(); }\n\t\tdata.dataPoints = data.dataPoints || {};\n\n\t\tif(parseInt(Object.keys(data.dataPoints)[0]) > 100000) {\n\t\t\tlet points = {};\n\t\t\tObject.keys(data.dataPoints).forEach(timestampSec => {\n\t\t\t\tlet date = new Date(timestampSec * NO_OF_MILLIS);\n\t\t\t\tpoints[getYyyyMmDd(date)] = data.dataPoints[timestampSec];\n\t\t\t});\n\t\t\tdata.dataPoints = points;\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tcalc() {\n\t\tlet s = this.state;\n\n\t\ts.start = clone(this.data.start);\n\t\ts.end = clone(this.data.end);\n\n\t\ts.firstWeekStart = clone(s.start);\n\t\ts.noOfWeeks = getWeeksBetween(s.start, s.end);\n\t\ts.distribution = calcDistribution(\n\t\t\tObject.values(this.data.dataPoints), HEATMAP_DISTRIBUTION_SIZE);\n\n\t\ts.domainConfigs = this.getDomains();\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\t\tlet lessCol = this.discreteDomains ? 0 : 1;\n\n\t\tlet componentConfigs = s.domainConfigs.map((config, i) => [\n\t\t\t'heatDomain',\n\t\t\t{\n\t\t\t\tindex: config.index,\n\t\t\t\tcolWidth: COL_WIDTH,\n\t\t\t\trowHeight: ROW_HEIGHT,\n\t\t\t\tsquareSize: HEATMAP_SQUARE_SIZE,\n\t\t\t\tradius: this.rawChartArgs.radius || 0,\n\t\t\t\txTranslate: s.domainConfigs\n\t\t\t\t\t.filter((config, j) => j < i)\n\t\t\t\t\t.map(config => config.cols.length - lessCol)\n\t\t\t\t\t.reduce((a, b) => a + b, 0)\n\t\t\t\t\t* COL_WIDTH\n\t\t\t},\n\t\t\tfunction() {\n\t\t\t\treturn s.domainConfigs[i];\n\t\t\t}.bind(this)\n\n\t\t]);\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map((args, i) => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0] + '-' + i, component];\n\t\t\t})\n\t\t);\n\n\t\tlet y = 0;\n\t\tDAY_NAMES_SHORT.forEach((dayName, i) => {\n\t\t\tif([1, 3, 5].includes(i)) {\n\t\t\t\tlet dayText = makeText('subdomain-name', -COL_WIDTH/2, y, dayName,\n\t\t\t\t\t{\n\t\t\t\t\t\tfontSize: HEATMAP_SQUARE_SIZE,\n\t\t\t\t\t\tdy: 8,\n\t\t\t\t\t\ttextAnchor: 'end'\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tthis.drawArea.appendChild(dayText);\n\t\t\t}\n\t\t\ty += ROW_HEIGHT;\n\t\t});\n\t}\n\n\tupdate(data) {\n\t\tif(!data) {\n\t\t\tconsole.error('No data to update.');\n\t\t}\n\n\t\tthis.data = this.prepareData(data);\n\t\tthis.draw();\n\t\tthis.bindTooltip();\n\t}\n\n\tbindTooltip() {\n\t\tthis.container.addEventListener('mousemove', (e) => {\n\t\t\tthis.components.forEach(comp => {\n\t\t\t\tlet daySquares = comp.store;\n\t\t\t\tlet daySquare = e.target;\n\t\t\t\tif(daySquares.includes(daySquare)) {\n\n\t\t\t\t\tlet count = daySquare.getAttribute('data-value');\n\t\t\t\t\tlet dateParts = daySquare.getAttribute('data-date').split('-');\n\n\t\t\t\t\tlet month = getMonthName(parseInt(dateParts[1])-1, true);\n\n\t\t\t\t\tlet gOff = this.container.getBoundingClientRect(), pOff = daySquare.getBoundingClientRect();\n\n\t\t\t\t\tlet width = parseInt(e.target.getAttribute('width'));\n\t\t\t\t\tlet x = pOff.left - gOff.left + width/2;\n\t\t\t\t\tlet y = pOff.top - gOff.top;\n\t\t\t\t\tlet value = count + ' ' + this.countLabel;\n\t\t\t\t\tlet name = ' on ' + month + ' ' + dateParts[0] + ', ' + dateParts[2];\n\n\t\t\t\t\tthis.tip.setValues(x, y, {name: name, value: value, valueFirst: 1}, []);\n\t\t\t\t\tthis.tip.showTip();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\trenderLegend() {\n\t\tthis.legendArea.textContent = '';\n\t\tlet x = 0;\n\t\tlet y = ROW_HEIGHT;\n\t\tlet radius = this.rawChartArgs.radius || 0;\n\n\t\tlet lessText = makeText('subdomain-name', x, y, 'Less',\n\t\t\t{\n\t\t\t\tfontSize: HEATMAP_SQUARE_SIZE + 1,\n\t\t\t\tdy: 9\n\t\t\t}\n\t\t);\n\t\tx = (COL_WIDTH * 2) + COL_WIDTH/2;\n\t\tthis.legendArea.appendChild(lessText);\n\n\t\tthis.colors.slice(0, HEATMAP_DISTRIBUTION_SIZE).map((color, i) => {\n\t\t\tconst square = heatSquare('heatmap-legend-unit', x + (COL_WIDTH + 3) * i,\n\t\t\t\ty, HEATMAP_SQUARE_SIZE, radius, color);\n\t\t\tthis.legendArea.appendChild(square);\n\t\t});\n\n\t\tlet moreTextX = x + HEATMAP_DISTRIBUTION_SIZE * (COL_WIDTH + 3) + COL_WIDTH/4;\n\t\tlet moreText = makeText('subdomain-name', moreTextX, y, 'More',\n\t\t\t{\n\t\t\t\tfontSize: HEATMAP_SQUARE_SIZE + 1,\n\t\t\t\tdy: 9\n\t\t\t}\n\t\t);\n\t\tthis.legendArea.appendChild(moreText);\n\t}\n\n\tgetDomains() {\n\t\tlet s = this.state;\n\t\tconst [startMonth, startYear] = [s.start.getMonth(), s.start.getFullYear()];\n\t\tconst [endMonth, endYear] = [s.end.getMonth(), s.end.getFullYear()];\n\n\t\tconst noOfMonths = (endMonth - startMonth + 1) + (endYear - startYear) * 12;\n\n\t\tlet domainConfigs = [];\n\n\t\tlet startOfMonth = clone(s.start);\n\t\tfor(var i = 0; i < noOfMonths; i++) {\n\t\t\tlet endDate = s.end;\n\t\t\tif(!areInSameMonth(startOfMonth, s.end)) {\n\t\t\t\tlet [month, year] = [startOfMonth.getMonth(), startOfMonth.getFullYear()];\n\t\t\t\tendDate = getLastDateInMonth(month, year);\n\t\t\t}\n\t\t\tdomainConfigs.push(this.getDomainConfig(startOfMonth, endDate));\n\n\t\t\taddDays(endDate, 1);\n\t\t\tstartOfMonth = endDate;\n\t\t}\n\n\t\treturn domainConfigs;\n\t}\n\n\tgetDomainConfig(startDate, endDate='') {\n\t\tlet [month, year] = [startDate.getMonth(), startDate.getFullYear()];\n\t\tlet startOfWeek = setDayToSunday(startDate); // TODO: Monday as well\n\t\tendDate = clone(endDate) || getLastDateInMonth(month, year);\n\n\t\tlet domainConfig = {\n\t\t\tindex: month,\n\t\t\tcols: []\n\t\t};\n\n\t\taddDays(endDate, 1);\n\t\tlet noOfMonthWeeks = getWeeksBetween(startOfWeek, endDate);\n\n\t\tlet cols = [], col;\n\t\tfor(var i = 0; i < noOfMonthWeeks; i++) {\n\t\t\tcol = this.getCol(startOfWeek, month);\n\t\t\tcols.push(col);\n\n\t\t\tstartOfWeek = new Date(col[NO_OF_DAYS_IN_WEEK - 1].yyyyMmDd);\n\t\t\taddDays(startOfWeek, 1);\n\t\t}\n\n\t\tif(col[NO_OF_DAYS_IN_WEEK - 1].dataValue !== undefined) {\n\t\t\taddDays(startOfWeek, 1);\n\t\t\tcols.push(this.getCol(startOfWeek, month, true));\n\t\t}\n\n\t\tdomainConfig.cols = cols;\n\n\t\treturn domainConfig;\n\t}\n\n\tgetCol(startDate, month, empty = false) {\n\t\tlet s = this.state;\n\n\t\t// startDate is the start of week\n\t\tlet currentDate = clone(startDate);\n\t\tlet col = [];\n\n\t\tfor(var i = 0; i < NO_OF_DAYS_IN_WEEK; i++, addDays(currentDate, 1)) {\n\t\t\tlet config = {};\n\n\t\t\t// Non-generic adjustment for entire heatmap, needs state\n\t\t\tlet currentDateWithinData = currentDate >= s.start && currentDate <= s.end;\n\n\t\t\tif(empty || currentDate.getMonth() !== month || !currentDateWithinData) {\n\t\t\t\tconfig.yyyyMmDd = getYyyyMmDd(currentDate);\n\t\t\t} else {\n\t\t\t\tconfig = this.getSubDomainConfig(currentDate);\n\t\t\t}\n\t\t\tcol.push(config);\n\t\t}\n\n\t\treturn col;\n\t}\n\n\tgetSubDomainConfig(date) {\n\t\tlet yyyyMmDd = getYyyyMmDd(date);\n\t\tlet dataValue = this.data.dataPoints[yyyyMmDd];\n\t\tlet config = {\n\t\t\tyyyyMmDd: yyyyMmDd,\n\t\t\tdataValue: dataValue || 0,\n\t\t\tfill: this.colors[getMaxCheckpoint(dataValue, this.state.distribution)]\n\t\t};\n\t\treturn config;\n\t}\n}\n","import BaseChart from './BaseChart';\nimport { dataPrep, zeroDataPrep, getShortenedLabels } from '../utils/axis-chart-utils';\nimport { AXIS_LEGEND_BAR_SIZE } from '../utils/constants';\nimport { getComponent } from '../objects/ChartComponents';\nimport { getOffset, fire } from '../utils/dom';\nimport { calcChartIntervals, getIntervalSize, getValueRange, getZeroIndex, scale, getClosestInArray } from '../utils/intervals';\nimport { floatTwo } from '../utils/helpers';\nimport { makeOverlay, updateOverlay, legendBar } from '../utils/draw';\nimport { getTopOffset, getLeftOffset, MIN_BAR_PERCENT_HEIGHT, BAR_CHART_SPACE_RATIO,\n\tLINE_CHART_DOT_SIZE } from '../utils/constants';\n\nexport default class AxisChart extends BaseChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\n\t\tthis.barOptions = args.barOptions || {};\n\t\tthis.lineOptions = args.lineOptions || {};\n\n\t\tthis.type = args.type || 'line';\n\t\tthis.init = 1;\n\n\t\tthis.setup();\n\t}\n\n\tsetMeasures() {\n\t\tif(this.data.datasets.length <= 1) {\n\t\t\tthis.config.showLegend = 0;\n\t\t\tthis.measures.paddings.bottom = 30;\n\t\t}\n\t}\n\n\tconfigure(options) {\n\t\tsuper.configure(options);\n\n\t\toptions.axisOptions = options.axisOptions || {};\n\t\toptions.tooltipOptions = options.tooltipOptions || {};\n\n\t\tthis.config.xAxisMode = options.axisOptions.xAxisMode || 'span';\n\t\tthis.config.yAxisMode = options.axisOptions.yAxisMode || 'span';\n\t\tthis.config.xIsSeries = options.axisOptions.xIsSeries || 0;\n\t\tthis.config.shortenYAxisNumbers = options.axisOptions.shortenYAxisNumbers || 0;\n\n\t\tthis.config.formatTooltipX = options.tooltipOptions.formatTooltipX;\n\t\tthis.config.formatTooltipY = options.tooltipOptions.formatTooltipY;\n\n\t\tthis.config.valuesOverPoints = options.valuesOverPoints;\n\t}\n\n\tprepareData(data=this.data) {\n\t\treturn dataPrep(data, this.type);\n\t}\n\n\tprepareFirstData(data=this.data) {\n\t\treturn zeroDataPrep(data);\n\t}\n\n\tcalc(onlyWidthChange = false) {\n\t\tthis.calcXPositions();\n\t\tif(!onlyWidthChange) {\n\t\t\tthis.calcYAxisParameters(this.getAllYValues(), this.type === 'line');\n\t\t}\n\t\tthis.makeDataByIndex();\n\t}\n\n\tcalcXPositions() {\n\t\tlet s = this.state;\n\t\tlet labels = this.data.labels;\n\t\ts.datasetLength = labels.length;\n\n\t\ts.unitWidth = this.width/(s.datasetLength);\n\t\t// Default, as per bar, and mixed. Only line will be a special case\n\t\ts.xOffset = s.unitWidth/2;\n\n\t\t// // For a pure Line Chart\n\t\t// s.unitWidth = this.width/(s.datasetLength - 1);\n\t\t// s.xOffset = 0;\n\n\t\ts.xAxis = {\n\t\t\tlabels: labels,\n\t\t\tpositions: labels.map((d, i) =>\n\t\t\t\tfloatTwo(s.xOffset + i * s.unitWidth)\n\t\t\t)\n\t\t};\n\t}\n\n\tcalcYAxisParameters(dataValues, withMinimum = 'false') {\n\t\tconst yPts = calcChartIntervals(dataValues, withMinimum);\n\t\tconst scaleMultiplier = this.height / getValueRange(yPts);\n\t\tconst intervalHeight = getIntervalSize(yPts) * scaleMultiplier;\n\t\tconst zeroLine = this.height - (getZeroIndex(yPts) * intervalHeight);\n\n\t\tthis.state.yAxis = {\n\t\t\tlabels: yPts,\n\t\t\tpositions: yPts.map(d => zeroLine - d * scaleMultiplier),\n\t\t\tscaleMultiplier: scaleMultiplier,\n\t\t\tzeroLine: zeroLine,\n\t\t};\n\n\t\t// Dependent if above changes\n\t\tthis.calcDatasetPoints();\n\t\tthis.calcYExtremes();\n\t\tthis.calcYRegions();\n\t}\n\n\tcalcDatasetPoints() {\n\t\tlet s = this.state;\n\t\tlet scaleAll = values => values.map(val => scale(val, s.yAxis));\n\n\t\ts.datasets = this.data.datasets.map((d, i) => {\n\t\t\tlet values = d.values;\n\t\t\tlet cumulativeYs = d.cumulativeYs || [];\n\t\t\treturn {\n\t\t\t\tname: d.name && d.name.replace(/<|>|&/g, (char) => char == '&' ? '&' : char == '<' ? '<' : '>'),\n\t\t\t\tindex: i,\n\t\t\t\tchartType: d.chartType,\n\n\t\t\t\tvalues: values,\n\t\t\t\tyPositions: scaleAll(values),\n\n\t\t\t\tcumulativeYs: cumulativeYs,\n\t\t\t\tcumulativeYPos: scaleAll(cumulativeYs),\n\t\t\t};\n\t\t});\n\t}\n\n\tcalcYExtremes() {\n\t\tlet s = this.state;\n\t\tif(this.barOptions.stacked) {\n\t\t\ts.yExtremes = s.datasets[s.datasets.length - 1].cumulativeYPos;\n\t\t\treturn;\n\t\t}\n\t\ts.yExtremes = new Array(s.datasetLength).fill(9999);\n\t\ts.datasets.map(d => {\n\t\t\td.yPositions.map((pos, j) => {\n\t\t\t\tif(pos < s.yExtremes[j]) {\n\t\t\t\t\ts.yExtremes[j] = pos;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tcalcYRegions() {\n\t\tlet s = this.state;\n\t\tif(this.data.yMarkers) {\n\t\t\tthis.state.yMarkers = this.data.yMarkers.map(d => {\n\t\t\t\td.position = scale(d.value, s.yAxis);\n\t\t\t\tif(!d.options) d.options = {};\n\t\t\t\t// if(!d.label.includes(':')) {\n\t\t\t\t// \td.label += ': ' + d.value;\n\t\t\t\t// }\n\t\t\t\treturn d;\n\t\t\t});\n\t\t}\n\t\tif(this.data.yRegions) {\n\t\t\tthis.state.yRegions = this.data.yRegions.map(d => {\n\t\t\t\td.startPos = scale(d.start, s.yAxis);\n\t\t\t\td.endPos = scale(d.end, s.yAxis);\n\t\t\t\tif(!d.options) d.options = {};\n\t\t\t\treturn d;\n\t\t\t});\n\t\t}\n\t}\n\n\tgetAllYValues() {\n\t\tlet key = 'values';\n\n\t\tif(this.barOptions.stacked) {\n\t\t\tkey = 'cumulativeYs';\n\t\t\tlet cumulative = new Array(this.state.datasetLength).fill(0);\n\t\t\tthis.data.datasets.map((d, i) => {\n\t\t\t\tlet values = this.data.datasets[i].values;\n\t\t\t\td[key] = cumulative = cumulative.map((c, i) => c + values[i]);\n\t\t\t});\n\t\t}\n\n\t\tlet allValueLists = this.data.datasets.map(d => d[key]);\n\t\tif(this.data.yMarkers) {\n\t\t\tallValueLists.push(this.data.yMarkers.map(d => d.value));\n\t\t}\n\t\tif(this.data.yRegions) {\n\t\t\tthis.data.yRegions.map(d => {\n\t\t\t\tallValueLists.push([d.end, d.start]);\n\t\t\t});\n\t\t}\n\n\t\treturn [].concat(...allValueLists);\n\t}\n\n\tsetupComponents() {\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'yAxis',\n\t\t\t\t{\n\t\t\t\t\tmode: this.config.yAxisMode,\n\t\t\t\t\twidth: this.width,\n\t\t\t\t\tshortenNumbers: this.config.shortenYAxisNumbers\n\t\t\t\t\t// pos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn this.state.yAxis;\n\t\t\t\t}.bind(this)\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'xAxis',\n\t\t\t\t{\n\t\t\t\t\tmode: this.config.xAxisMode,\n\t\t\t\t\theight: this.height,\n\t\t\t\t\t// pos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\tlet s = this.state;\n\t\t\t\t\ts.xAxis.calcLabels = getShortenedLabels(this.width,\n\t\t\t\t\t\ts.xAxis.labels, this.config.xIsSeries);\n\n\t\t\t\t\treturn s.xAxis;\n\t\t\t\t}.bind(this)\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'yRegions',\n\t\t\t\t{\n\t\t\t\t\twidth: this.width,\n\t\t\t\t\tpos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn this.state.yRegions;\n\t\t\t\t}.bind(this)\n\t\t\t],\n\t\t];\n\n\t\tlet barDatasets = this.state.datasets.filter(d => d.chartType === 'bar');\n\t\tlet lineDatasets = this.state.datasets.filter(d => d.chartType === 'line');\n\n\t\tlet barsConfigs = barDatasets.map(d => {\n\t\t\tlet index = d.index;\n\t\t\treturn [\n\t\t\t\t'barGraph' + '-' + d.index,\n\t\t\t\t{\n\t\t\t\t\tindex: index,\n\t\t\t\t\tcolor: this.colors[index],\n\t\t\t\t\tstacked: this.barOptions.stacked,\n\n\t\t\t\t\t// same for all datasets\n\t\t\t\t\tvaluesOverPoints: this.config.valuesOverPoints,\n\t\t\t\t\tminHeight: this.height * MIN_BAR_PERCENT_HEIGHT,\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\tlet s = this.state;\n\t\t\t\t\tlet d = s.datasets[index];\n\t\t\t\t\tlet stacked = this.barOptions.stacked;\n\n\t\t\t\t\tlet spaceRatio = this.barOptions.spaceRatio || BAR_CHART_SPACE_RATIO;\n\t\t\t\t\tlet barsWidth = s.unitWidth * (1 - spaceRatio);\n\t\t\t\t\tlet barWidth = barsWidth/(stacked ? 1 : barDatasets.length);\n\n\t\t\t\t\tlet xPositions = s.xAxis.positions.map(x => x - barsWidth/2);\n\t\t\t\t\tif(!stacked) {\n\t\t\t\t\t\txPositions = xPositions.map(p => p + barWidth * index);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet labels = new Array(s.datasetLength).fill('');\n\t\t\t\t\tif(this.config.valuesOverPoints) {\n\t\t\t\t\t\tif(stacked && d.index === s.datasets.length - 1) {\n\t\t\t\t\t\t\tlabels = d.cumulativeYs;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlabels = d.values;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlet offsets = new Array(s.datasetLength).fill(0);\n\t\t\t\t\tif(stacked) {\n\t\t\t\t\t\toffsets = d.yPositions.map((y, j) => y - d.cumulativeYPos[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\txPositions: xPositions,\n\t\t\t\t\t\tyPositions: d.yPositions,\n\t\t\t\t\t\toffsets: offsets,\n\t\t\t\t\t\t// values: d.values,\n\t\t\t\t\t\tlabels: labels,\n\n\t\t\t\t\t\tzeroLine: s.yAxis.zeroLine,\n\t\t\t\t\t\tbarsWidth: barsWidth,\n\t\t\t\t\t\tbarWidth: barWidth,\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t];\n\t\t});\n\n\t\tlet lineConfigs = lineDatasets.map(d => {\n\t\t\tlet index = d.index;\n\t\t\treturn [\n\t\t\t\t'lineGraph' + '-' + d.index,\n\t\t\t\t{\n\t\t\t\t\tindex: index,\n\t\t\t\t\tcolor: this.colors[index],\n\t\t\t\t\tsvgDefs: this.svgDefs,\n\t\t\t\t\theatline: this.lineOptions.heatline,\n\t\t\t\t\tregionFill: this.lineOptions.regionFill,\n\t\t\t\t\tspline: this.lineOptions.spline,\n\t\t\t\t\thideDots: this.lineOptions.hideDots,\n\t\t\t\t\thideLine: this.lineOptions.hideLine,\n\n\t\t\t\t\t// same for all datasets\n\t\t\t\t\tvaluesOverPoints: this.config.valuesOverPoints,\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\tlet s = this.state;\n\t\t\t\t\tlet d = s.datasets[index];\n\t\t\t\t\tlet minLine = s.yAxis.positions[0] < s.yAxis.zeroLine\n\t\t\t\t\t\t? s.yAxis.positions[0] : s.yAxis.zeroLine;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\txPositions: s.xAxis.positions,\n\t\t\t\t\t\tyPositions: d.yPositions,\n\n\t\t\t\t\t\tvalues: d.values,\n\n\t\t\t\t\t\tzeroLine: minLine,\n\t\t\t\t\t\tradius: this.lineOptions.dotSize || LINE_CHART_DOT_SIZE,\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t];\n\t\t});\n\n\t\tlet markerConfigs = [\n\t\t\t[\n\t\t\t\t'yMarkers',\n\t\t\t\t{\n\t\t\t\t\twidth: this.width,\n\t\t\t\t\tpos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn this.state.yMarkers;\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tcomponentConfigs = componentConfigs.concat(barsConfigs, lineConfigs, markerConfigs);\n\n\t\tlet optionals = ['yMarkers', 'yRegions'];\n\t\tthis.dataUnitComponents = [];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.filter(args => !optionals.includes(args[0]) || this.state[args[0]])\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\tif(args[0].includes('lineGraph') || args[0].includes('barGraph')) {\n\t\t\t\t\tthis.dataUnitComponents.push(component);\n\t\t\t\t}\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tmakeDataByIndex() {\n\t\tthis.dataByIndex = {};\n\n\t\tlet s = this.state;\n\t\tlet formatX = this.config.formatTooltipX;\n\t\tlet formatY = this.config.formatTooltipY;\n\t\tlet titles = s.xAxis.labels;\n\n\t\ttitles.map((label, index) => {\n\t\t\tlet values = this.state.datasets.map((set, i) => {\n\t\t\t\tlet value = set.values[index];\n\t\t\t\treturn {\n\t\t\t\t\ttitle: set.name,\n\t\t\t\t\tvalue: value,\n\t\t\t\t\tyPos: set.yPositions[index],\n\t\t\t\t\tcolor: this.colors[i],\n\t\t\t\t\tformatted: formatY ? formatY(value) : value,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tthis.dataByIndex[index] = {\n\t\t\t\tlabel: label,\n\t\t\t\tformattedLabel: formatX ? formatX(label) : label,\n\t\t\t\txPos: s.xAxis.positions[index],\n\t\t\t\tvalues: values,\n\t\t\t\tyExtreme: s.yExtremes[index],\n\t\t\t};\n\t\t});\n\t}\n\n\tbindTooltip() {\n\t\t// NOTE: could be in tooltip itself, as it is a given functionality for its parent\n\t\tthis.container.addEventListener('mousemove', (e) => {\n\t\t\tlet m = this.measures;\n\t\t\tlet o = getOffset(this.container);\n\t\t\tlet relX = e.pageX - o.left - getLeftOffset(m);\n\t\t\tlet relY = e.pageY - o.top;\n\n\t\t\tif(relY < this.height + getTopOffset(m)\n\t\t\t\t&& relY > getTopOffset(m)) {\n\t\t\t\tthis.mapTooltipXPosition(relX);\n\t\t\t} else {\n\t\t\t\tthis.tip.hideTip();\n\t\t\t}\n\t\t});\n\t}\n\n\tmapTooltipXPosition(relX) {\n\t\tlet s = this.state;\n\t\tif(!s.yExtremes) return;\n\n\t\tlet index = getClosestInArray(relX, s.xAxis.positions, true);\n\t\tif (index >= 0) {\n\t\t\tlet dbi = this.dataByIndex[index];\n\n\t\t\tthis.tip.setValues(\n\t\t\t\tdbi.xPos + this.tip.offset.x,\n\t\t\t\tdbi.yExtreme + this.tip.offset.y,\n\t\t\t\t{name: dbi.formattedLabel, value: ''},\n\t\t\t\tdbi.values,\n\t\t\t\tindex\n\t\t\t);\n\n\t\t\tthis.tip.showTip();\n\t\t}\n\t}\n\n\trenderLegend() {\n\t\tlet s = this.data;\n\t\tif(s.datasets.length > 1) {\n\t\t\tthis.legendArea.textContent = '';\n\t\t\ts.datasets.map((d, i) => {\n\t\t\t\tlet barWidth = AXIS_LEGEND_BAR_SIZE;\n\t\t\t\t// let rightEndPoint = this.baseWidth - this.measures.margins.left - this.measures.margins.right;\n\t\t\t\t// let multiplier = s.datasets.length - i;\n\t\t\t\tlet rect = legendBar(\n\t\t\t\t\t// rightEndPoint - multiplier * barWidth,\t// To right align\n\t\t\t\t\tbarWidth * i,\n\t\t\t\t\t'0',\n\t\t\t\t\tbarWidth,\n\t\t\t\t\tthis.colors[i],\n\t\t\t\t\td.name,\n\t\t\t\t\tthis.config.truncateLegends);\n\t\t\t\tthis.legendArea.appendChild(rect);\n\t\t\t});\n\t\t}\n\t}\n\n\n\n\t// Overlay\n\tmakeOverlay() {\n\t\tif(this.init) {\n\t\t\tthis.init = 0;\n\t\t\treturn;\n\t\t}\n\t\tif(this.overlayGuides) {\n\t\t\tthis.overlayGuides.forEach(g => {\n\t\t\t\tlet o = g.overlay;\n\t\t\t\to.parentNode.removeChild(o);\n\t\t\t});\n\t\t}\n\n\t\tthis.overlayGuides = this.dataUnitComponents.map(c => {\n\t\t\treturn {\n\t\t\t\ttype: c.unitType,\n\t\t\t\toverlay: undefined,\n\t\t\t\tunits: c.units,\n\t\t\t};\n\t\t});\n\n\t\tif(this.state.currentIndex === undefined) {\n\t\t\tthis.state.currentIndex = this.state.datasetLength - 1;\n\t\t}\n\n\t\t// Render overlays\n\t\tthis.overlayGuides.map(d => {\n\t\t\tlet currentUnit = d.units[this.state.currentIndex];\n\n\t\t\td.overlay = makeOverlay[d.type](currentUnit);\n\t\t\tthis.drawArea.appendChild(d.overlay);\n\t\t});\n\t}\n\n\tupdateOverlayGuides() {\n\t\tif(this.overlayGuides) {\n\t\t\tthis.overlayGuides.forEach(g => {\n\t\t\t\tlet o = g.overlay;\n\t\t\t\to.parentNode.removeChild(o);\n\t\t\t});\n\t\t}\n\t}\n\n\tbindOverlay() {\n\t\tthis.parent.addEventListener('data-select', () => {\n\t\t\tthis.updateOverlay();\n\t\t});\n\t}\n\n\tbindUnits() {\n\t\tthis.dataUnitComponents.map(c => {\n\t\t\tc.units.map(unit => {\n\t\t\t\tunit.addEventListener('click', () => {\n\t\t\t\t\tlet index = unit.getAttribute('data-point-index');\n\t\t\t\t\tthis.setCurrentDataPoint(index);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// Note: Doesn't work as tooltip is absolutely positioned\n\t\tthis.tip.container.addEventListener('click', () => {\n\t\t\tlet index = this.tip.container.getAttribute('data-point-index');\n\t\t\tthis.setCurrentDataPoint(index);\n\t\t});\n\t}\n\n\tupdateOverlay() {\n\t\tthis.overlayGuides.map(d => {\n\t\t\tlet currentUnit = d.units[this.state.currentIndex];\n\t\t\tupdateOverlay[d.type](currentUnit, d.overlay);\n\t\t});\n\t}\n\n\tonLeftArrow() {\n\t\tthis.setCurrentDataPoint(this.state.currentIndex - 1);\n\t}\n\n\tonRightArrow() {\n\t\tthis.setCurrentDataPoint(this.state.currentIndex + 1);\n\t}\n\n\tgetDataPoint(index=this.state.currentIndex) {\n\t\tlet s = this.state;\n\t\tlet data_point = {\n\t\t\tindex: index,\n\t\t\tlabel: s.xAxis.labels[index],\n\t\t\tvalues: s.datasets.map(d => d.values[index])\n\t\t};\n\t\treturn data_point;\n\t}\n\n\tsetCurrentDataPoint(index) {\n\t\tlet s = this.state;\n\t\tindex = parseInt(index);\n\t\tif(index < 0) index = 0;\n\t\tif(index >= s.xAxis.labels.length) index = s.xAxis.labels.length - 1;\n\t\tif(index === s.currentIndex) return;\n\t\ts.currentIndex = index;\n\t\tfire(this.parent, \"data-select\", this.getDataPoint());\n\t}\n\n\n\n\t// API\n\taddDataPoint(label, datasetValues, index=this.state.datasetLength) {\n\t\tsuper.addDataPoint(label, datasetValues, index);\n\t\tthis.data.labels.splice(index, 0, label);\n\t\tthis.data.datasets.map((d, i) => {\n\t\t\td.values.splice(index, 0, datasetValues[i]);\n\t\t});\n\t\tthis.update(this.data);\n\t}\n\n\tremoveDataPoint(index = this.state.datasetLength-1) {\n\t\tif (this.data.labels.length <= 1) {\n\t\t\treturn;\n\t\t}\n\t\tsuper.removeDataPoint(index);\n\t\tthis.data.labels.splice(index, 1);\n\t\tthis.data.datasets.map(d => {\n\t\t\td.values.splice(index, 1);\n\t\t});\n\t\tthis.update(this.data);\n\t}\n\n\tupdateDataset(datasetValues, index=0) {\n\t\tthis.data.datasets[index].values = datasetValues;\n\t\tthis.update(this.data);\n\t}\n\t// addDataset(dataset, index) {}\n\t// removeDataset(index = 0) {}\n\n\tupdateDatasets(datasets) {\n\t\tthis.data.datasets.map((d, i) => {\n\t\t\tif(datasets[i]) {\n\t\t\t\td.values = datasets[i];\n\t\t\t}\n\t\t});\n\t\tthis.update(this.data);\n\t}\n\n\t// updateDataPoint(dataPoint, index = 0) {}\n\t// addDataPoint(dataPoint, index = 0) {}\n\t// removeDataPoint(index = 0) {}\n}\n","import { fillArray } from '../utils/helpers';\nimport { DEFAULT_AXIS_CHART_TYPE, AXIS_DATASET_CHART_TYPES, DEFAULT_CHAR_WIDTH } from '../utils/constants';\n\nexport function dataPrep(data, type) {\n\tdata.labels = data.labels || [];\n\n\tlet datasetLength = data.labels.length;\n\n\t// Datasets\n\tlet datasets = data.datasets;\n\tlet zeroArray = new Array(datasetLength).fill(0);\n\tif(!datasets) {\n\t\t// default\n\t\tdatasets = [{\n\t\t\tvalues: zeroArray\n\t\t}];\n\t}\n\n\tdatasets.map(d=> {\n\t\t// Set values\n\t\tif(!d.values) {\n\t\t\td.values = zeroArray;\n\t\t} else {\n\t\t\t// Check for non values\n\t\t\tlet vals = d.values;\n\t\t\tvals = vals.map(val => (!isNaN(val) ? val : 0));\n\n\t\t\t// Trim or extend\n\t\t\tif(vals.length > datasetLength) {\n\t\t\t\tvals = vals.slice(0, datasetLength);\n\t\t\t} else {\n\t\t\t\tvals = fillArray(vals, datasetLength - vals.length, 0);\n\t\t\t}\n\t\t\td.values = vals;\n\t\t}\n\n\t\t// Set type\n\t\tif(!d.chartType ) {\n\t\t\tif(!AXIS_DATASET_CHART_TYPES.includes(type)) type === DEFAULT_AXIS_CHART_TYPE;\n\t\t\td.chartType = type;\n\t\t}\n\n\t});\n\n\t// Markers\n\n\t// Regions\n\t// data.yRegions = data.yRegions || [];\n\tif(data.yRegions) {\n\t\tdata.yRegions.map(d => {\n\t\t\tif(d.end < d.start) {\n\t\t\t\t[d.start, d.end] = [d.end, d.start];\n\t\t\t}\n\t\t});\n\t}\n\n\treturn data;\n}\n\nexport function zeroDataPrep(realData) {\n\tlet datasetLength = realData.labels.length;\n\tlet zeroArray = new Array(datasetLength).fill(0);\n\n\tlet zeroData = {\n\t\tlabels: realData.labels.slice(0, -1),\n\t\tdatasets: realData.datasets.map(d => {\n\t\t\treturn {\n\t\t\t\tname: '',\n\t\t\t\tvalues: zeroArray.slice(0, -1),\n\t\t\t\tchartType: d.chartType\n\t\t\t};\n\t\t}),\n\t};\n\n\tif(realData.yMarkers) {\n\t\tzeroData.yMarkers = [\n\t\t\t{\n\t\t\t\tvalue: 0,\n\t\t\t\tlabel: ''\n\t\t\t}\n\t\t];\n\t}\n\n\tif(realData.yRegions) {\n\t\tzeroData.yRegions = [\n\t\t\t{\n\t\t\t\tstart: 0,\n\t\t\t\tend: 0,\n\t\t\t\tlabel: ''\n\t\t\t}\n\t\t];\n\t}\n\n\treturn zeroData;\n}\n\nexport function getShortenedLabels(chartWidth, labels=[], isSeries=true) {\n\tlet allowedSpace = chartWidth / labels.length;\n\tif(allowedSpace <= 0) allowedSpace = 1;\n\tlet allowedLetters = allowedSpace / DEFAULT_CHAR_WIDTH;\n\n\tlet seriesMultiple;\n\tif(isSeries) {\n\t\t// Find the maximum label length for spacing calculations\n\t\tlet maxLabelLength = Math.max(...labels.map(label => label.length));\n\t\tseriesMultiple = Math.ceil(maxLabelLength/allowedLetters);\n\t}\n\n\tlet calcLabels = labels.map((label, i) => {\n\t\tlabel += \"\";\n\t\tif(label.length > allowedLetters) {\n\n\t\t\tif(!isSeries) {\n\t\t\t\tif(allowedLetters-3 > 0) {\n\t\t\t\t\tlabel = label.slice(0, allowedLetters-3) + \" ...\";\n\t\t\t\t} else {\n\t\t\t\t\tlabel = label.slice(0, allowedLetters) + '..';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(i % seriesMultiple !== 0) {\n\t\t\t\t\tlabel = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn label;\n\t});\n\n\treturn calcLabels;\n}\n","import AggregationChart from './AggregationChart';\nimport { getComponent } from '../objects/ChartComponents';\nimport { getOffset } from '../utils/dom';\nimport { getPositionByAngle } from '../utils/helpers';\nimport { makeArcStrokePathStr, makeStrokeCircleStr } from '../utils/draw';\nimport { lightenDarkenColor } from '../utils/colors';\nimport { transform } from '../utils/animation';\nimport { FULL_ANGLE } from '../utils/constants';\n\nexport default class DonutChart extends AggregationChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t\tthis.type = 'donut';\n\t\tthis.initTimeout = 0;\n\t\tthis.init = 1;\n\n\t\tthis.setup();\n\t}\n\n\tconfigure(args) {\n\t\tsuper.configure(args);\n\t\tthis.mouseMove = this.mouseMove.bind(this);\n\t\tthis.mouseLeave = this.mouseLeave.bind(this);\n\n\t\tthis.hoverRadio = args.hoverRadio || 0.1;\n\t\tthis.config.startAngle = args.startAngle || 0;\n\n\t\tthis.clockWise = args.clockWise || false;\n\t\tthis.strokeWidth = args.strokeWidth || 30;\n\t}\n\n\tcalc() {\n\t\tsuper.calc();\n\t\tlet s = this.state;\n\t\tthis.radius =\n\t\t\tthis.height > this.width\n\t\t\t\t? this.center.x - this.strokeWidth / 2\n\t\t\t\t: this.center.y - this.strokeWidth / 2;\n\n\t\tconst { radius, clockWise } = this;\n\n\t\tconst prevSlicesProperties = s.slicesProperties || [];\n\t\ts.sliceStrings = [];\n\t\ts.slicesProperties = [];\n\t\tlet curAngle = 180 - this.config.startAngle;\n\n\t\ts.sliceTotals.map((total, i) => {\n\t\t\tconst startAngle = curAngle;\n\t\t\tconst originDiffAngle = (total / s.grandTotal) * FULL_ANGLE;\n\t\t\tconst largeArc = originDiffAngle > 180 ? 1: 0;\n\t\t\tconst diffAngle = clockWise ? -originDiffAngle : originDiffAngle;\n\t\t\tconst endAngle = curAngle = curAngle + diffAngle;\n\t\t\tconst startPosition = getPositionByAngle(startAngle, radius);\n\t\t\tconst endPosition = getPositionByAngle(endAngle, radius);\n\n\t\t\tconst prevProperty = this.init && prevSlicesProperties[i];\n\n\t\t\tlet curStart,curEnd;\n\t\t\tif(this.init) {\n\t\t\t\tcurStart = prevProperty ? prevProperty.startPosition : startPosition;\n\t\t\t\tcurEnd = prevProperty ? prevProperty.endPosition : startPosition;\n\t\t\t} else {\n\t\t\t\tcurStart = startPosition;\n\t\t\t\tcurEnd = endPosition;\n\t\t\t}\n\t\t\tconst curPath =\n\t\t\t\toriginDiffAngle === 360\n\t\t\t\t\t? makeStrokeCircleStr(curStart, curEnd, this.center, this.radius, this.clockWise, largeArc)\n\t\t\t\t\t: makeArcStrokePathStr(curStart, curEnd, this.center, this.radius, this.clockWise, largeArc);\n\n\t\t\ts.sliceStrings.push(curPath);\n\t\t\ts.slicesProperties.push({\n\t\t\t\tstartPosition,\n\t\t\t\tendPosition,\n\t\t\t\tvalue: total,\n\t\t\t\ttotal: s.grandTotal,\n\t\t\t\tstartAngle,\n\t\t\t\tendAngle,\n\t\t\t\tangle: diffAngle\n\t\t\t});\n\n\t\t});\n\t\tthis.init = 0;\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'donutSlices',\n\t\t\t\t{ },\n\t\t\t\tfunction() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsliceStrings: s.sliceStrings,\n\t\t\t\t\t\tcolors: this.colors,\n\t\t\t\t\t\tstrokeWidth: this.strokeWidth,\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tcalTranslateByAngle(property){\n\t\tconst{ radius, hoverRadio } = this;\n\t\tconst position = getPositionByAngle(property.startAngle+(property.angle / 2),radius);\n\t\treturn `translate3d(${(position.x) * hoverRadio}px,${(position.y) * hoverRadio}px,0)`;\n\t}\n\n\thoverSlice(path,i,flag,e){\n\t\tif(!path) return;\n\t\tconst color = this.colors[i];\n\t\tif(flag) {\n\t\t\ttransform(path, this.calTranslateByAngle(this.state.slicesProperties[i]));\n\t\t\tpath.style.stroke = lightenDarkenColor(color, 50);\n\t\t\tlet g_off = getOffset(this.svg);\n\t\t\tlet x = e.pageX - g_off.left + 10;\n\t\t\tlet y = e.pageY - g_off.top - 10;\n\t\t\tlet title = (this.formatted_labels && this.formatted_labels.length > 0\n\t\t\t\t? this.formatted_labels[i] : this.state.labels[i]) + ': ';\n\t\t\tlet percent = (this.state.sliceTotals[i] * 100 / this.state.grandTotal).toFixed(1);\n\t\t\tthis.tip.setValues(x, y, {name: title, value: percent + \"%\"});\n\t\t\tthis.tip.showTip();\n\t\t} else {\n\t\t\ttransform(path,'translate3d(0,0,0)');\n\t\t\tthis.tip.hideTip();\n\t\t\tpath.style.stroke = color;\n\t\t}\n\t}\n\n\tbindTooltip() {\n\t\tthis.container.addEventListener('mousemove', this.mouseMove);\n\t\tthis.container.addEventListener('mouseleave', this.mouseLeave);\n\t}\n\n\tmouseMove(e){\n\t\tconst target = e.target;\n\t\tlet slices = this.components.get('donutSlices').store;\n\t\tlet prevIndex = this.curActiveSliceIndex;\n\t\tlet prevAcitve = this.curActiveSlice;\n\t\tif(slices.includes(target)) {\n\t\t\tlet i = slices.indexOf(target);\n\t\t\tthis.hoverSlice(prevAcitve, prevIndex,false);\n\t\t\tthis.curActiveSlice = target;\n\t\t\tthis.curActiveSliceIndex = i;\n\t\t\tthis.hoverSlice(target, i, true, e);\n\t\t} else {\n\t\t\tthis.mouseLeave();\n\t\t}\n\t}\n\n\tmouseLeave(){\n\t\tthis.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,false);\n\t}\n}\n","import '../css/charts.scss';\n\n// import MultiAxisChart from './charts/MultiAxisChart';\nimport PercentageChart from './charts/PercentageChart';\nimport PieChart from './charts/PieChart';\nimport Heatmap from './charts/Heatmap';\nimport AxisChart from './charts/AxisChart';\nimport DonutChart from './charts/DonutChart';\n\nconst chartTypes = {\n\tbar: AxisChart,\n\tline: AxisChart,\n\t// multiaxis: MultiAxisChart,\n\tpercentage: PercentageChart,\n\theatmap: Heatmap,\n\tpie: PieChart,\n\tdonut: DonutChart,\n};\n\nfunction getChartByType(chartType = 'line', parent, options) {\n\tif (chartType === 'axis-mixed') {\n\t\toptions.type = 'line';\n\t\treturn new AxisChart(parent, options);\n\t}\n\n\tif (!chartTypes[chartType]) {\n\t\tconsole.error(\"Undefined chart type: \" + chartType);\n\t\treturn;\n\t}\n\n\treturn new chartTypes[chartType](parent, options);\n}\n\nclass Chart {\n\tconstructor(parent, options) {\n\t\treturn getChartByType(options.type, parent, options);\n\t}\n}\n\nexport { Chart, PercentageChart, PieChart, Heatmap, AxisChart };","import * as Charts from './chart';\n\nlet frappe = { };\n\nfrappe.NAME = 'Frappe Charts';\nfrappe.VERSION = '1.6.2';\n\nfrappe = Object.assign({ }, frappe, Charts);\n\nexport default frappe;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/DashboardPage');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/DashboardWidget');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/abbreviateNumber');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport DashboardWidget from 'flarum/admin/components/DashboardWidget';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Link from 'flarum/common/components/Link';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nexport default class MiniStatisticsWidget extends DashboardWidget {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"entities\", ['users', 'discussions', 'posts']);\n _defineProperty(this, \"lifetimeData\", void 0);\n _defineProperty(this, \"loadingLifetime\", true);\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.loadLifetimeData();\n }\n async loadLifetimeData() {\n this.loadingLifetime = true;\n m.redraw();\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'lifetime'\n }\n });\n this.lifetimeData = data;\n this.loadingLifetime = false;\n m.redraw();\n }\n className() {\n return 'StatisticsWidget StatisticsWidget--mini';\n }\n content() {\n return m(\"div\", {\n className: \"StatisticsWidget-table\"\n }, m(\"h4\", {\n className: \"StatisticsWidget-title\"\n }, app.translator.trans('flarum-statistics.admin.statistics.mini_heading')), m(\"div\", {\n className: \"StatisticsWidget-entities\"\n }, m(\"div\", {\n className: \"StatisticsWidget-labels\"\n }, m(\"div\", {\n className: \"StatisticsWidget-label\"\n }, app.translator.trans('flarum-statistics.admin.statistics.total_label'))), this.entities.map(entity => {\n const totalCount = this.loadingLifetime ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getTotalCount(entity);\n return m(\"div\", {\n className: \"StatisticsWidget-entity\"\n }, m(\"h3\", {\n className: \"StatisticsWidget-heading\"\n }, app.translator.trans('flarum-statistics.admin.statistics.' + entity + '_heading')), m(\"div\", {\n className: \"StatisticsWidget-total\",\n title: totalCount\n }, this.loadingLifetime ? m(LoadingIndicator, {\n display: \"inline\"\n }) : abbreviateNumber(totalCount)));\n })), m(\"div\", {\n className: \"StatisticsWidget-viewFull\"\n }, m(Link, {\n href: app.route('extension', {\n id: 'flarum-statistics'\n })\n }, app.translator.trans('flarum-statistics.admin.statistics.view_full'))));\n }\n getTotalCount(entity) {\n return this.lifetimeData[entity];\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/MiniStatisticsWidget', MiniStatisticsWidget);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/SelectDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Placeholder');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/generateElementId');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport generateElementId from 'flarum/common/utils/generateElementId';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport dayjs from 'dayjs';\nimport dayjsUtc from 'dayjs/plugin/utc';\ndayjs.extend(dayjsUtc);\nexport default class StatisticsWidgetDateSelectionModal extends FormModal {\n constructor() {\n super(...arguments);\n /* @ts-expect-error core typings don't allow us to set the type of the state attr :( */\n _defineProperty(this, \"state\", {\n inputs: {\n startDateVal: dayjs().format('YYYY-MM-DD'),\n endDateVal: dayjs().format('YYYY-MM-DD')\n },\n ids: {\n startDate: generateElementId(),\n endDate: generateElementId()\n }\n });\n }\n oninit(vnode) {\n super.oninit(vnode);\n if (this.attrs.value) {\n this.state.inputs = {\n startDateVal: dayjs.utc(this.attrs.value.start * 1000).format('YYYY-MM-DD'),\n endDateVal: dayjs.utc(this.attrs.value.end * 1000).format('YYYY-MM-DD')\n };\n }\n }\n className() {\n return 'StatisticsWidgetDateSelectionModal Modal--small';\n }\n title() {\n return app.translator.trans('flarum-statistics.admin.date_selection_modal.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, this.items().toArray());\n }\n items() {\n const items = new ItemList();\n items.add('intro', m(\"p\", null, app.translator.trans('flarum-statistics.admin.date_selection_modal.description')), 100);\n items.add('date_start', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", {\n htmlFor: this.state.ids.startDate\n }, app.translator.trans('flarum-statistics.admin.date_selection_modal.start_date')), m(\"input\", {\n type: \"date\",\n id: this.state.ids.startDate,\n value: this.state.inputs.startDateVal,\n onchange: this.updateState('startDateVal'),\n className: \"FormControl\"\n })), 90);\n items.add('date_end', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", {\n htmlFor: this.state.ids.endDate\n }, app.translator.trans('flarum-statistics.admin.date_selection_modal.end_date')), m(\"input\", {\n type: \"date\",\n id: this.state.ids.endDate,\n value: this.state.inputs.endDateVal,\n onchange: this.updateState('endDateVal'),\n className: \"FormControl\"\n })), 80);\n items.add('submit', m(Button, {\n className: \"Button Button--primary\",\n type: \"submit\"\n }, app.translator.trans('flarum-statistics.admin.date_selection_modal.submit_button')), 0);\n return items;\n }\n updateState(field) {\n return e => {\n this.state.inputs[field] = e.currentTarget.value;\n };\n }\n submitData() {\n // We force 'zulu' time (UTC)\n return {\n start: Math.floor(+dayjs.utc(this.state.inputs.startDateVal + 'Z') / 1000),\n // Ensures that the end date is the end of the day\n end: Math.floor(+dayjs.utc(this.state.inputs.endDateVal + 'Z').hour(23).minute(59).second(59).millisecond(999) / 1000)\n };\n }\n onsubmit(e) {\n e.preventDefault();\n const data = this.submitData();\n if (data.end < data.start) {\n this.alertAttrs = {\n type: 'error',\n controls: app.translator.trans('flarum-statistics.admin.date_selection_modal.errors.end_before_start')\n };\n return;\n }\n this.attrs.onModalSubmit(data);\n this.hide();\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/StatisticsWidgetDateSelectionModal', StatisticsWidgetDateSelectionModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport Button from 'flarum/common/components/Button';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport extractText from 'flarum/common/utils/extractText';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport Icon from 'flarum/common/components/Icon';\nimport classList from 'flarum/common/utils/classList';\nimport DashboardWidget from 'flarum/admin/components/DashboardWidget';\nimport StatisticsWidgetDateSelectionModal from './StatisticsWidgetDateSelectionModal';\nimport dayjs from 'dayjs';\nimport dayjsUtc from 'dayjs/plugin/utc';\nimport dayjsLocalizedFormat from 'dayjs/plugin/localizedFormat';\n// @ts-expect-error No typings available\nimport { Chart } from 'frappe-charts';\ndayjs.extend(dayjsUtc);\ndayjs.extend(dayjsLocalizedFormat);\nexport default class StatisticsWidget extends DashboardWidget {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"entities\", ['users', 'discussions', 'posts']);\n _defineProperty(this, \"periods\", void 0);\n _defineProperty(this, \"chart\", void 0);\n _defineProperty(this, \"customPeriod\", null);\n _defineProperty(this, \"timedData\", {});\n _defineProperty(this, \"lifetimeData\", void 0);\n _defineProperty(this, \"customPeriodData\", {});\n _defineProperty(this, \"noData\", false);\n _defineProperty(this, \"loadingLifetime\", true);\n _defineProperty(this, \"loadingTimed\", this.entities.reduce((acc, curr) => {\n acc[curr] = 'unloaded';\n return acc;\n }, {}));\n _defineProperty(this, \"loadingCustom\", this.entities.reduce((acc, curr) => {\n acc[curr] = 'unloaded';\n return acc;\n }, {}));\n _defineProperty(this, \"selectedEntity\", 'users');\n _defineProperty(this, \"selectedPeriod\", void 0);\n _defineProperty(this, \"chartEntity\", void 0);\n _defineProperty(this, \"chartPeriod\", void 0);\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.loadLifetimeData();\n }\n async loadLifetimeData() {\n this.loadingLifetime = true;\n m.redraw();\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'lifetime'\n }\n });\n this.lifetimeData = data;\n this.loadingLifetime = false;\n m.redraw();\n }\n async loadTimedData(model) {\n this.loadingTimed[model] = 'loading';\n m.redraw();\n try {\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'timed',\n model\n }\n });\n this.timedData[model] = data;\n this.loadingTimed[model] = 'loaded';\n\n // Create a Date object which represents the start of the day.\n let todayDate = new Date();\n todayDate.setUTCHours(0, 0, 0, 0);\n const today = todayDate.getTime() / 1000;\n this.periods = {\n today: {\n start: today,\n end: today + 86400,\n step: 3600\n },\n last_7_days: {\n start: today - 86400 * 7,\n end: today,\n step: 86400\n },\n previous_7_days: {\n start: today - 86400 * 14,\n end: today - 86400 * 7,\n step: 86400\n },\n last_28_days: {\n start: today - 86400 * 28,\n end: today,\n step: 86400\n },\n previous_28_days: {\n start: today - 86400 * 28 * 2,\n end: today - 86400 * 28,\n step: 86400\n },\n last_12_months: {\n start: today - 86400 * 364,\n end: today,\n step: 86400 * 7\n }\n };\n this.selectedPeriod = 'last_7_days';\n } catch (e) {\n console.error(e);\n this.loadingTimed[model] = 'fail';\n }\n m.redraw();\n }\n async loadCustomRangeData(model) {\n this.loadingCustom[model] = 'loading';\n m.redraw();\n\n // We clone so we can check that the same period is still selected\n // once the HTTP request is complete and the data is to be displayed\n const range = {\n ...this.customPeriod\n };\n try {\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'custom',\n model,\n dateRange: {\n start: range.start,\n end: range.end\n }\n }\n });\n if (JSON.stringify(range) !== JSON.stringify(this.customPeriod)) {\n // The range this method was called with is no longer the selected.\n // Bail out here.\n return;\n }\n this.customPeriodData[model] = data;\n this.loadingCustom[model] = 'loaded';\n m.redraw();\n } catch (e) {\n if (JSON.stringify(range) !== JSON.stringify(this.customPeriod)) {\n // The range this method was called with is no longer the selected.\n // Bail out here.\n return;\n }\n console.error(e);\n this.loadingCustom[model] = 'fail';\n }\n }\n className() {\n return 'StatisticsWidget';\n }\n content() {\n const loadingSelectedEntity = (this.selectedPeriod === 'custom' ? this.loadingCustom : this.loadingTimed)[this.selectedEntity] !== 'loaded';\n const thisPeriod = loadingSelectedEntity ? null : this.selectedPeriod === 'custom' ? {\n start: this.customPeriod?.end,\n end: this.customPeriod?.end,\n step: 86400\n } : this.periods[this.selectedPeriod];\n if (this.selectedPeriod === 'custom') {\n if (!this.customPeriodData[this.selectedEntity] && this.loadingCustom[this.selectedEntity] === 'unloaded') {\n this.loadCustomRangeData(this.selectedEntity);\n }\n } else {\n if (!this.timedData[this.selectedEntity] && this.loadingTimed[this.selectedEntity] === 'unloaded') {\n this.loadTimedData(this.selectedEntity);\n }\n }\n return m(\"div\", {\n className: \"StatisticsWidget-table\"\n }, m(\"div\", {\n className: \"StatisticsWidget-entities\"\n }, m(\"div\", {\n className: \"StatisticsWidget-labels\"\n }, m(\"div\", {\n className: \"StatisticsWidget-label\"\n }, app.translator.trans('flarum-statistics.admin.statistics.total_label')), m(\"div\", {\n className: \"StatisticsWidget-label\"\n }, loadingSelectedEntity ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(SelectDropdown, {\n disabled: loadingSelectedEntity,\n buttonClassName: \"Button Button--text\",\n caretIcon: \"fas fa-caret-down\"\n }, Object.keys(this.periods).map(period => m(Button, {\n key: period,\n active: period === this.selectedPeriod,\n onclick: this.changePeriod.bind(this, period),\n icon: period === this.selectedPeriod ? 'fas fa-check' : true\n }, app.translator.trans(`flarum-statistics.admin.statistics.${period}_label`))).concat([m(Button, {\n key: \"custom\",\n active: this.selectedPeriod === 'custom',\n onclick: () => {\n const attrs = {\n onModalSubmit: dates => {\n if (JSON.stringify(dates) === JSON.stringify(this.customPeriod)) {\n // If same period is selected, don't reload data\n return;\n }\n this.customPeriodData = {};\n Object.keys(this.loadingCustom).forEach(k => this.loadingCustom[k] = 'unloaded');\n this.customPeriod = dates;\n this.changePeriod('custom');\n }\n };\n\n // If we have a custom period set already,\n // let's prefill the modal with it\n if (this.customPeriod) {\n attrs.value = this.customPeriod;\n }\n app.modal.show(StatisticsWidgetDateSelectionModal, attrs);\n },\n icon: this.selectedPeriod === 'custom' ? 'fas fa-check' : true\n }, this.selectedPeriod === 'custom' ? extractText(app.translator.trans(`flarum-statistics.admin.statistics.custom_label_specified`, {\n fromDate: dayjs.utc(this.customPeriod.start * 1000).format('ll'),\n toDate: dayjs.utc(this.customPeriod.end * 1000).format('ll')\n })) : app.translator.trans(`flarum-statistics.admin.statistics.custom_label`))])))), this.entities.map(entity => {\n const totalCount = this.loadingLifetime ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getTotalCount(entity);\n const thisPeriodCount = loadingSelectedEntity ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getPeriodCount(entity, thisPeriod);\n const lastPeriodCount = this.selectedPeriod === 'custom' ? null : loadingSelectedEntity ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getPeriodCount(entity, this.getLastPeriod(thisPeriod));\n const periodChange = loadingSelectedEntity || lastPeriodCount === 0 || lastPeriodCount === null ? 0 : (thisPeriodCount - lastPeriodCount) / lastPeriodCount * 100;\n return m(\"button\", {\n className: classList('Button--ua-reset StatisticsWidget-entity', {\n active: this.selectedEntity === entity\n }),\n onclick: this.changeEntity.bind(this, entity)\n }, m(\"h3\", {\n className: \"StatisticsWidget-heading\"\n }, app.translator.trans('flarum-statistics.admin.statistics.' + entity + '_heading')), m(\"div\", {\n className: \"StatisticsWidget-total\",\n title: totalCount\n }, this.loadingLifetime ? m(LoadingIndicator, {\n display: \"inline\"\n }) : abbreviateNumber(totalCount)), m(\"div\", {\n className: \"StatisticsWidget-period\",\n title: thisPeriodCount\n }, loadingSelectedEntity ? m(LoadingIndicator, {\n display: \"inline\"\n }) : abbreviateNumber(thisPeriodCount), periodChange !== 0 && m('[', null, ' ', m(\"span\", {\n className: 'StatisticsWidget-change StatisticsWidget-change--' + (periodChange > 0 ? 'up' : 'down')\n }, m(Icon, {\n name: 'fas fa-arrow-' + (periodChange > 0 ? 'up' : 'down')\n }), Math.abs(periodChange).toFixed(1), \"%\"))));\n })), m('[', null, loadingSelectedEntity ? m(\"div\", {\n key: \"loading\",\n className: \"StatisticsWidget-chart\",\n \"data-loading\": \"true\"\n }, m(LoadingIndicator, {\n size: \"large\"\n })) : m(\"div\", {\n key: \"loaded\",\n className: \"StatisticsWidget-chart\",\n \"data-loading\": \"false\",\n oncreate: this.drawChart.bind(this),\n onupdate: this.drawChart.bind(this)\n })), this.noData && m(Placeholder, {\n text: app.translator.trans(`flarum-statistics.admin.statistics.no_data`)\n }), !this.noData && !!this.chart && m(Button, {\n className: \"StatisticsWidget-chartExport Button\",\n icon: \"fas fa-file-export\",\n onclick: () => {\n this.chart.export();\n }\n }, app.translator.trans('flarum-statistics.admin.statistics.export_chart_button')));\n }\n drawChart(vnode) {\n if (this.chart && this.chartEntity === this.selectedEntity && this.chartPeriod === this.selectedPeriod) {\n return;\n }\n const period = this.selectedPeriod === 'custom' ? {\n start: this.customPeriod?.start,\n end: this.customPeriod?.end,\n step: 86400\n } : this.periods[this.selectedPeriod];\n const periodLength = period.end - period.start;\n const labels = [];\n const thisPeriod = [];\n const lastPeriod = [];\n for (let i = period.start; i < period.end; i += period.step) {\n let label;\n if (period.step < 86400) {\n label = dayjs.unix(i).utc().format('h A');\n } else {\n label = dayjs.unix(i).utc().format('D MMM');\n if (period.step > 86400) {\n label += ' - ' + dayjs.unix(i + period.step - 1).utc().format('D MMM');\n }\n }\n labels.push(label);\n thisPeriod.push(this.getPeriodCount(this.selectedEntity, {\n start: i,\n end: i + period.step\n }));\n lastPeriod.push(this.getPeriodCount(this.selectedEntity, {\n start: i - periodLength,\n end: i - periodLength\n }));\n }\n if (thisPeriod.length === 0) {\n this.noData = true;\n m.redraw();\n return;\n } else {\n this.noData = false;\n m.redraw();\n }\n const datasets = [{\n name: extractText(app.translator.trans('flarum-statistics.admin.statistics.current_period')),\n values: thisPeriod\n }, {\n name: extractText(app.translator.trans('flarum-statistics.admin.statistics.previous_period')),\n values: lastPeriod\n }];\n const data = {\n labels,\n datasets\n };\n\n // If the dom element no longer exists, recreate the chart\n // https://stackoverflow.com/a/2620373/11091039\n if (!this.chart || !(document.compareDocumentPosition(this.chart.parent) & 16)) {\n this.chart = new Chart(vnode.dom, {\n data,\n type: 'line',\n height: 280,\n axisOptions: {\n xAxisMode: 'tick',\n yAxisMode: 'span',\n xIsSeries: true\n },\n lineOptions: {\n hideDots: 1,\n regionFill: 1\n },\n colors: [app.forum.attribute('themePrimaryColor'), 'black']\n });\n } else {\n this.chart.update(data);\n }\n this.chartEntity = this.selectedEntity;\n this.chartPeriod = this.selectedPeriod;\n }\n changeEntity(entity) {\n this.selectedEntity = entity;\n }\n changePeriod(period) {\n this.selectedPeriod = period;\n }\n getTotalCount(entity) {\n return this.lifetimeData[entity];\n }\n getPeriodCount(entity, period) {\n const timed = (this.selectedPeriod === 'custom' ? this.customPeriodData : this.timedData)[entity];\n let count = 0;\n for (const t in timed) {\n const time = parseInt(t);\n if (time >= period.start && time < period.end) {\n count += timed[time];\n }\n }\n return count;\n }\n getLastPeriod(thisPeriod) {\n return {\n start: thisPeriod.start - (thisPeriod.end - thisPeriod.start),\n end: thisPeriod.start\n };\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/StatisticsWidget', StatisticsWidget);","import ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport StatisticsWidget from './StatisticsWidget';\nexport default class StatisticsPage extends ExtensionPage {\n content() {\n return m(\"div\", {\n className: \"StatisticsPage\"\n }, m(\"div\", {\n className: \"container\"\n }, m(StatisticsWidget, null)));\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/StatisticsPage', StatisticsPage);","import Extend from 'flarum/common/extenders';\nimport StatisticsPage from './components/StatisticsPage';\nexport default [new Extend.Admin().page(StatisticsPage)];","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport DashboardPage from 'flarum/admin/components/DashboardPage';\nimport MiniStatisticsWidget from './components/MiniStatisticsWidget';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-statistics', () => {\n extend(DashboardPage.prototype, 'availableWidgets', function (widgets) {\n widgets.add('statistics', m(MiniStatisticsWidget, null), 20);\n });\n});"],"names":["module","exports","e","n","r","i","s","u","a","o","c","f","h","d","l","$","y","M","name","weekdays","split","months","ordinal","t","m","String","length","Array","join","v","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","g","S","_","O","args","arguments","b","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","meridiem","monthsShort","weekdaysMin","weekdaysShort","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","k","forEach","extend","$i","isDayjs","en","Ls","LTS","LT","L","LL","LLL","LLLL","formats","toUpperCase","call","local","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","document","querySelector","getBoundingClientRect","top","documentElement","scrollTop","body","left","scrollLeft","titleHeight","margins","paddings","bottom","legendHeight","right","parseFloat","toFixed","fill","concat","sin","Zt","cos","isNaN","isFinite","Ft","isArray","push","sqrt","pow","angle","atan2","PI","reduce","A","ie","parseInt","T","createElementNS","appendChild","parentNode","insertBefore","Object","keys","map","style","textContent","setAttribute","inside","offset","N","className","transform","styles","stroke","j","id","x1","x2","y1","y2","H","width","height","rx","Y","fontSize","re","dy","le","textAnchor","innerHTML","V","oe","lineType","shortenNumbers","log10","ae","G","pos","mode","ne","B","ve","tt","pe","it","zeroLine","Vt","nodeName","childNodes","ce","getAttribute","st","rt","cloneNode","attributeName","from","to","begin","dur","values","keySplines","ge","keyTimes","calcMode","type","ot","webkitTransform","msTransform","mozTransform","oTransform","lt","Ut","replaceChild","ct","classList","create","me","firstChild","dt","setMinutes","pt","ft","vt","xt","we","ke","gt","xe","mt","yt","Ae","bt","kt","setDate","wt","Le","filter","includes","assign","constants","getData","Te","At","mantissa","exponent","Tt","Pt","Mt","Dt","scaleMultiplier","Et","insertAt","head","getElementsByTagName","createElement","styleSheet","cssText","createTextNode","Symbol","iterator","constructor","Ht","value","Promise","resolve","then","done","reject","next","key","arg","_invoke","return","asyncIterator","throw","TypeError","It","enumerable","configurable","writable","defineProperty","Rt","Function","getOwnPropertyDescriptor","getPrototypeOf","Yt","setPrototypeOf","__proto__","Bt","ReferenceError","Gt","baseHeight","titleFontSize","Xt","Jt","Kt","$t","Qt","bar","line","pie","percentage","heatmap","donut","te","parent","colors","titleName","titleValue","listValues","titleValueFirst","setup","makeTooltip","calcPosition","container","hideTip","title","dataPointList","addEventListener","index","formatted","offsetWidth","offsetHeight","valueFirst","refresh","opacity","ee","blue","violet","red","orange","yellow","green","purple","magenta","black","grey","exec","se","ue","dot","heat_square","he","attributes","specified","nodeValue","de","fe","ease","linear","easein","easeout","easeinout","ye","HTMLElement","Error","rawChartArgs","realData","prepareData","data","prepareFirstData","validateColors","config","showTooltip","showLegend","isNavigable","animate","truncateLegends","measures","JSON","stringify","setMeasures","argHeight","state","options","initTimeout","overlays","configure","P","console","warn","boundDrawFn","draw","ResizeObserver","resizeObserver","observe","window","disconnect","removeEventListener","makeContainer","updateWidth","independentWidth","tip","bindTooltip","offsetParent","calc","makeChartArea","setupComponents","components","drawArea","render","setTimeout","update","renderLegend","setupNavigation","baseWidth","getComputedStyle","paddingLeft","paddingRight","clientWidth","svg","removeChild","C","svgDefs","titleEL","legendArea","updateTipOffset","Map","error","ut","make","updateNav","makeOverlay","bindUnits","bindOverlay","keyActions","onEnterKey","bind","onLeftArrow","onUpArrow","onRightArrow","onDownArrow","innerHeight","clientHeight","innerWidth","event","keyCode","Blob","URL","createObjectURL","href","download","click","revokeObjectURL","ht","be","formatTooltipY","tooltipOptions","maxSlices","maxLegendPoints","sliceTotals","labels","datasets","sort","grandTotal","center","legendTotals","cx","cy","dx","R","Pe","layerClass","layerTransform","makeElements","animateElements","store","layer","oldData","donutSlices","sliceStrings","strokeWidth","transition","pieSlices","percentageBars","xPositions","F","widths","barHeight","barDepth","yAxis","positions","U","xAxis","calcLabels","Z","yMarkers","labelPos","q","position","label","yRegions","X","startPos","endPos","et","heatDomain","colWidth","rowHeight","squareSize","radius","xTranslate","serializedSubDomains","cols","yyyyMmDd","dataValue","barGraph","unitType","units","yPositions","minHeight","J","barWidth","color","offsets","barsWidth","lineGraph","paths","hideLine","spline","heatline","path","regionFill","region","hideDots","K","valuesOverPoints","at","nt","Oe","barOptions","depth","target","indexOf","formattedLabels","setValues","showTip","Me","mouseMove","mouseLeave","hoverRadio","startAngle","clockWise","slicesProperties","startPosition","endPosition","E","total","endAngle","calTranslateByAngle","pageX","pageY","formatted_labels","curActiveSliceIndex","curActiveSlice","hoverSlice","Ce","countLabel","startSubDomain","startSubDomainIndex","discreteDomains","start","end","noOfWeeks","setFullYear","dataPoints","firstWeekStart","distribution","max","St","domainConfigs","getDomains","getDomainConfig","getCol","getSubDomainConfig","De","lineOptions","axisOptions","xAxisMode","yAxisMode","xIsSeries","shortenYAxisNumbers","formatTooltipX","chartType","_t","zt","calcXPositions","calcYAxisParameters","getAllYValues","makeDataByIndex","datasetLength","unitWidth","xOffset","unshift","reverse","Lt","Ct","Ot","calcDatasetPoints","calcYExtremes","calcYRegions","cumulativeYs","cumulativeYPos","stacked","yExtremes","Wt","spaceRatio","dotSize","dataUnitComponents","dataByIndex","yPos","formattedLabel","xPos","yExtreme","mapTooltipXPosition","Nt","I","overlayGuides","overlay","currentIndex","updateOverlay","setCurrentDataPoint","createEvent","initEvent","dispatchEvent","getDataPoint","splice","Ne","W","Se","_e","freeze","Chart","jt","PercentageChart","PieChart","Heatmap","AxisChart","ze","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","obj","prop","hasOwnProperty","toStringTag","flarum","reg","_typeof","_defineProperty","toPrimitive","toPropertyKey","MiniStatisticsWidget","super","oncreate","vnode","loadLifetimeData","loadingLifetime","redraw","method","url","attribute","params","period","lifetimeData","content","trans","entities","entity","totalCount","getTotalCount","display","StatisticsWidgetDateSelectionModal","inputs","startDateVal","endDateVal","ids","startDate","endDate","oninit","attrs","items","toArray","htmlFor","onchange","updateState","field","currentTarget","submitData","hour","minute","second","millisecond","onsubmit","preventDefault","alertAttrs","controls","onModalSubmit","hide","StatisticsWidget","acc","curr","loadTimedData","model","loadingTimed","timedData","todayDate","setUTCHours","today","periods","step","last_7_days","previous_7_days","last_28_days","previous_28_days","last_12_months","selectedPeriod","loadCustomRangeData","loadingCustom","range","customPeriod","dateRange","customPeriodData","loadingSelectedEntity","selectedEntity","thisPeriod","size","disabled","buttonClassName","caretIcon","active","onclick","changePeriod","icon","dates","show","fromDate","thisPeriodCount","getPeriodCount","lastPeriodCount","getLastPeriod","periodChange","changeEntity","drawChart","onupdate","noData","text","chart","export","chartEntity","chartPeriod","periodLength","lastPeriod","compareDocumentPosition","dom","timed","count","time","StatisticsPage","page","widgets"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"6BAAoEA,EAAOC,QAAmI,WAAW,aAAa,IAAUC,EAAE,IAAIC,EAAE,KAAKC,EAAE,cAAcC,EAAE,SAASC,EAAE,SAASC,EAAE,OAAOC,EAAE,MAAMC,EAAE,OAAOC,EAAE,QAAQC,EAAE,UAAUC,EAAE,OAAOC,EAAE,OAAOC,EAAE,eAAeC,EAAE,6FAA6FC,EAAE,sFAAsFC,EAAE,CAACC,KAAK,KAAKC,SAAS,2DAA2DC,MAAM,KAAKC,OAAO,wFAAwFD,MAAM,KAAKE,QAAQ,SAASC,GAAG,IAAIrB,EAAE,CAAC,KAAK,KAAK,KAAK,MAAMC,EAAEoB,EAAE,IAAI,MAAM,IAAIA,GAAGrB,GAAGC,EAAE,IAAI,KAAKD,EAAEC,IAAID,EAAE,IAAI,GAAG,GAAGsB,EAAE,SAASD,EAAErB,EAAEC,GAAG,IAAIC,EAAEqB,OAAOF,GAAG,OAAOnB,GAAGA,EAAEsB,QAAQxB,EAAEqB,EAAE,GAAGI,MAAMzB,EAAE,EAAEE,EAAEsB,QAAQE,KAAKzB,GAAGoB,CAAC,EAAEM,EAAE,CAACvB,EAAEkB,EAAEM,EAAE,SAASP,GAAG,IAAIrB,GAAGqB,EAAEQ,YAAY5B,EAAE6B,KAAKC,IAAI/B,GAAGE,EAAE4B,KAAKE,MAAM/B,EAAE,IAAIE,EAAEF,EAAE,GAAG,OAAOD,GAAG,EAAE,IAAI,KAAKsB,EAAEpB,EAAE,EAAE,KAAK,IAAIoB,EAAEnB,EAAE,EAAE,IAAI,EAAEmB,EAAE,SAASD,EAAErB,EAAEC,GAAG,GAAGD,EAAEiC,OAAOhC,EAAEgC,OAAO,OAAOZ,EAAEpB,EAAED,GAAG,IAAIE,EAAE,IAAID,EAAEiC,OAAOlC,EAAEkC,SAASjC,EAAEkC,QAAQnC,EAAEmC,SAAShC,EAAEH,EAAE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B,GAAQ9F,EAAO7G,OAAS2M,EAAO9F,EAAO5G,MACxCyM,GAASD,EAAME,GAEnB,CACA,OAAOD,CACT,CACA,aAAAhB,CAAcf,GACZ,MAAO,CACL3K,MAAO2K,EAAW3K,OAAS2K,EAAW1K,IAAM0K,EAAW3K,OACvDC,IAAK0K,EAAW3K,MAEpB,EAEFiF,OAAOC,IAAIjpB,IAAI,oBAAqB,oCAAqCgtB,GC5X1D,MAAM2D,UAAuB,KAC1C,OAAA7F,GACE,OAAO7rB,EAAE,MAAO,CACdkL,UAAW,kBACVlL,EAAE,MAAO,CACVkL,UAAW,aACVlL,EAAE+tB,EAAkB,OACzB,EAEFhE,OAAOC,IAAIjpB,IAAI,oBAAqB,kCAAmC2wB,GCTvE,UAAgB,IAAI,YAAeC,KAAKD,ICGxC,iBAAiB3wB,IAAI,qBAAqB,MACxC,IAAAwF,QAAO,cAAyB,oBAAoB,SAAUqrB,GAC5DA,EAAQ7wB,IAAI,aAAcf,EAAEgrB,EAAsB,MAAO,GAC3D,GAAE,G","sources":["webpack://@flarum/statistics/../../../node_modules/dayjs/dayjs.min.js","webpack://@flarum/statistics/../../../node_modules/dayjs/plugin/localizedFormat.js","webpack://@flarum/statistics/../../../node_modules/dayjs/plugin/utc.js","webpack://@flarum/statistics/../src/js/utils/dom.js","webpack://@flarum/statistics/../src/js/utils/constants.js","webpack://@flarum/statistics/../src/js/utils/helpers.js","webpack://@flarum/statistics/../src/js/utils/draw-utils.js","webpack://@flarum/statistics/../src/js/utils/colors.js","webpack://@flarum/statistics/../src/js/utils/draw.js","webpack://@flarum/statistics/../src/js/utils/animate.js","webpack://@flarum/statistics/../src/js/utils/animation.js","webpack://@flarum/statistics/../src/js/utils/export.js","webpack://@flarum/statistics/../src/js/utils/date-utils.js","webpack://@flarum/statistics/../src/js/objects/ChartComponents.js","webpack://@flarum/statistics/../src/js/utils/intervals.js","webpack://@flarum/statistics/../node_modules/style-inject/dist/style-inject.es.js","webpack://@flarum/statistics/../src/js/objects/SvgTip.js","webpack://@flarum/statistics/../src/css/chartsCss.js","webpack://@flarum/statistics/../src/js/charts/BaseChart.js","webpack://@flarum/statistics/../src/js/charts/AggregationChart.js","webpack://@flarum/statistics/../src/js/charts/PercentageChart.js","webpack://@flarum/statistics/../src/js/charts/PieChart.js","webpack://@flarum/statistics/../src/js/charts/Heatmap.js","webpack://@flarum/statistics/../src/js/charts/AxisChart.js","webpack://@flarum/statistics/../src/js/utils/axis-chart-utils.js","webpack://@flarum/statistics/../src/js/charts/DonutChart.js","webpack://@flarum/statistics/../src/js/chart.js","webpack://@flarum/statistics/../src/js/index.js","webpack://@flarum/statistics/webpack/bootstrap","webpack://@flarum/statistics/webpack/runtime/compat get default export","webpack://@flarum/statistics/webpack/runtime/define property getters","webpack://@flarum/statistics/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/statistics/webpack/runtime/make namespace object","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/components/DashboardPage')\"","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/statistics/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/components/DashboardWidget')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/abbreviateNumber')\"","webpack://@flarum/statistics/./src/admin/components/MiniStatisticsWidget.tsx","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/SelectDropdown')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Placeholder')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/utils/generateElementId')\"","webpack://@flarum/statistics/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/statistics/./src/admin/components/StatisticsWidgetDateSelectionModal.tsx","webpack://@flarum/statistics/./src/admin/components/StatisticsWidget.tsx","webpack://@flarum/statistics/./src/admin/components/StatisticsPage.tsx","webpack://@flarum/statistics/./src/admin/extend.tsx","webpack://@flarum/statistics/./src/admin/index.tsx"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) {\n\tvar element = document.createElement(tag);\n\n\tfor (var i in o) {\n\t\tvar val = o[i];\n\n\t\tif (i === \"inside\") {\n\t\t\t$(val).appendChild(element);\n\t\t}\n\t\telse if (i === \"around\") {\n\t\t\tvar ref = $(val);\n\t\t\tref.parentNode.insertBefore(element, ref);\n\t\t\telement.appendChild(ref);\n\n\t\t} else if (i === \"styles\") {\n\t\t\tif(typeof val === \"object\") {\n\t\t\t\tObject.keys(val).map(prop => {\n\t\t\t\t\telement.style[prop] = val[prop];\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (i in element ) {\n\t\t\telement[i] = val;\n\t\t}\n\t\telse {\n\t\t\telement.setAttribute(i, val);\n\t\t}\n\t}\n\n\treturn element;\n};\n\nexport function getOffset(element) {\n\tlet rect = element.getBoundingClientRect();\n\treturn {\n\t\t// https://stackoverflow.com/a/7436602/6495043\n\t\t// rect.top varies with scroll, so we add whatever has been\n\t\t// scrolled to it to get absolute distance from actual page top\n\t\ttop: rect.top + (document.documentElement.scrollTop || document.body.scrollTop),\n\t\tleft: rect.left + (document.documentElement.scrollLeft || document.body.scrollLeft)\n\t};\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n// an element's offsetParent property will return null whenever it, or any of its parents,\n// is hidden via the display style property.\nexport function isHidden(el) {\n\treturn (el.offsetParent === null);\n}\n\nexport function isElementInViewport(el) {\n\t// Although straightforward: https://stackoverflow.com/a/7557433/6495043\n\tvar rect = el.getBoundingClientRect();\n\n\treturn (\n\t\trect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */\n\t);\n}\n\nexport function getElementContentWidth(element) {\n\tvar styles = window.getComputedStyle(element);\n\tvar padding = parseFloat(styles.paddingLeft) +\n\t\tparseFloat(styles.paddingRight);\n\n\treturn element.clientWidth - padding;\n}\n\nexport function bind(element, o){\n\tif (element) {\n\t\tfor (var event in o) {\n\t\t\tvar callback = o[event];\n\n\t\t\tevent.split(/\\s+/).forEach(function (event) {\n\t\t\t\telement.addEventListener(event, callback);\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport function unbind(element, o){\n\tif (element) {\n\t\tfor (var event in o) {\n\t\t\tvar callback = o[event];\n\n\t\t\tevent.split(/\\s+/).forEach(function(event) {\n\t\t\t\telement.removeEventListener(event, callback);\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport function fire(target, type, properties) {\n\tvar evt = document.createEvent(\"HTMLEvents\");\n\n\tevt.initEvent(type, true, true );\n\n\tfor (var j in properties) {\n\t\tevt[j] = properties[j];\n\t}\n\n\treturn target.dispatchEvent(evt);\n}\n\n// https://css-tricks.com/snippets/javascript/loop-queryselectorall-matches/\nexport function forEachNode(nodeList, callback, scope) {\n\tif(!nodeList) return;\n\tfor (var i = 0; i < nodeList.length; i++) {\n\t\tcallback.call(scope, nodeList[i], i);\n\t}\n}\n\nexport function activate($parent, $child, commonClass, activeClass='active', index = -1) {\n\tlet $children = $parent.querySelectorAll(`.${commonClass}.${activeClass}`);\n\n\tforEachNode($children, (node, i) => {\n\t\tif(index >= 0 && i <= index) return;\n\t\tnode.classList.remove(activeClass);\n\t});\n\n\t$child.classList.add(activeClass);\n}\n","export const ALL_CHART_TYPES = ['line', 'scatter', 'bar', 'percentage', 'heatmap', 'pie'];\n\nexport const COMPATIBLE_CHARTS = {\n\tbar: ['line', 'scatter', 'percentage', 'pie'],\n\tline: ['scatter', 'bar', 'percentage', 'pie'],\n\tpie: ['line', 'scatter', 'percentage', 'bar'],\n\tpercentage: ['bar', 'line', 'scatter', 'pie'],\n\theatmap: []\n};\n\nexport const DATA_COLOR_DIVISIONS = {\n\tbar: 'datasets',\n\tline: 'datasets',\n\tpie: 'labels',\n\tpercentage: 'labels',\n\theatmap: HEATMAP_DISTRIBUTION_SIZE\n};\n\nexport const BASE_MEASURES = {\n\tmargins: {\n\t\ttop: 10,\n\t\tbottom: 10,\n\t\tleft: 20,\n\t\tright: 20\n\t},\n\tpaddings: {\n\t\ttop: 20,\n\t\tbottom: 40,\n\t\tleft: 30,\n\t\tright: 10\n\t},\n\n\tbaseHeight: 240,\n\ttitleHeight: 20,\n\tlegendHeight: 30,\n\n\ttitleFontSize: 12,\n};\n\nexport function getTopOffset(m) {\n\treturn m.titleHeight + m.margins.top + m.paddings.top;\n}\n\nexport function getLeftOffset(m) {\n\treturn m.margins.left + m.paddings.left;\n}\n\nexport function getExtraHeight(m) {\n\tlet totalExtraHeight = m.margins.top + m.margins.bottom\n\t\t+ m.paddings.top + m.paddings.bottom\n\t\t+ m.titleHeight + m.legendHeight;\n\treturn totalExtraHeight;\n}\n\nexport function getExtraWidth(m) {\n\tlet totalExtraWidth = m.margins.left + m.margins.right\n\t\t+ m.paddings.left + m.paddings.right;\n\n\treturn totalExtraWidth;\n}\n\nexport const INIT_CHART_UPDATE_TIMEOUT = 700;\nexport const CHART_POST_ANIMATE_TIMEOUT = 400;\n\nexport const DEFAULT_AXIS_CHART_TYPE = 'line';\nexport const AXIS_DATASET_CHART_TYPES = ['line', 'bar'];\n\nexport const AXIS_LEGEND_BAR_SIZE = 100;\n\nexport const BAR_CHART_SPACE_RATIO = 0.5;\nexport const MIN_BAR_PERCENT_HEIGHT = 0.00;\n\nexport const LINE_CHART_DOT_SIZE = 4;\nexport const DOT_OVERLAY_SIZE_INCR = 4;\n\nexport const PERCENTAGE_BAR_DEFAULT_HEIGHT = 20;\nexport const PERCENTAGE_BAR_DEFAULT_DEPTH = 2;\n\n// Fixed 5-color theme,\n// More colors are difficult to parse visually\nexport const HEATMAP_DISTRIBUTION_SIZE = 5;\n\nexport const HEATMAP_SQUARE_SIZE = 10;\nexport const HEATMAP_GUTTER_SIZE = 2;\n\nexport const DEFAULT_CHAR_WIDTH = 7;\n\nexport const TOOLTIP_POINTER_TRIANGLE_HEIGHT = 5;\n\nconst DEFAULT_CHART_COLORS = ['light-blue', 'blue', 'violet', 'red', 'orange',\n\t'yellow', 'green', 'light-green', 'purple', 'magenta', 'light-grey', 'dark-grey'];\nconst HEATMAP_COLORS_GREEN = ['#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127'];\nexport const HEATMAP_COLORS_BLUE = ['#ebedf0', '#c0ddf9', '#73b3f3', '#3886e1', '#17459e'];\nexport const HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001c'];\n\nexport const DEFAULT_COLORS = {\n\tbar: DEFAULT_CHART_COLORS,\n\tline: DEFAULT_CHART_COLORS,\n\tpie: DEFAULT_CHART_COLORS,\n\tpercentage: DEFAULT_CHART_COLORS,\n\theatmap: HEATMAP_COLORS_GREEN,\n\tdonut: DEFAULT_CHART_COLORS\n};\n\n// Universal constants\nexport const ANGLE_RATIO = Math.PI / 180;\nexport const FULL_ANGLE = 360;\n","import { ANGLE_RATIO } from './constants';\n\n/**\n * Returns the value of a number upto 2 decimal places.\n * @param {Number} d Any number\n */\nexport function floatTwo(d) {\n\treturn parseFloat(d.toFixed(2));\n}\n\n/**\n * Returns whether or not two given arrays are equal.\n * @param {Array} arr1 First array\n * @param {Array} arr2 Second array\n */\nexport function arraysEqual(arr1, arr2) {\n\tif(arr1.length !== arr2.length) return false;\n\tlet areEqual = true;\n\tarr1.map((d, i) => {\n\t\tif(arr2[i] !== d) areEqual = false;\n\t});\n\treturn areEqual;\n}\n\n/**\n * Shuffles array in place. ES6 version\n * @param {Array} array An array containing the items.\n */\nexport function shuffle(array) {\n\t// Awesomeness: https://bost.ocks.org/mike/shuffle/\n\t// https://stackoverflow.com/a/2450976/6495043\n\t// https://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array?noredirect=1&lq=1\n\n\tfor (let i = array.length - 1; i > 0; i--) {\n\t\tlet j = Math.floor(Math.random() * (i + 1));\n\t\t[array[i], array[j]] = [array[j], array[i]];\n\t}\n\n\treturn array;\n}\n\n/**\n * Fill an array with extra points\n * @param {Array} array Array\n * @param {Number} count number of filler elements\n * @param {Object} element element to fill with\n * @param {Boolean} start fill at start?\n */\nexport function fillArray(array, count, element, start=false) {\n\tif(!element) {\n\t\telement = start ? array[0] : array[array.length - 1];\n\t}\n\tlet fillerArray = new Array(Math.abs(count)).fill(element);\n\tarray = start ? fillerArray.concat(array) : array.concat(fillerArray);\n\treturn array;\n}\n\n/**\n * Returns pixel width of string.\n * @param {String} string\n * @param {Number} charWidth Width of single char in pixels\n */\nexport function getStringWidth(string, charWidth) {\n\treturn (string+\"\").length * charWidth;\n}\n\nexport function bindChange(obj, getFn, setFn) {\n\treturn new Proxy(obj, {\n\t\tset: function(target, prop, value) {\n\t\t\tsetFn();\n\t\t\treturn Reflect.set(target, prop, value);\n\t\t},\n\t\tget: function(target, prop) {\n\t\t\tgetFn();\n\t\t\treturn Reflect.get(target, prop);\n\t\t}\n\t});\n}\n\n// https://stackoverflow.com/a/29325222\nexport function getRandomBias(min, max, bias, influence) {\n\tconst range = max - min;\n\tconst biasValue = range * bias + min;\n\tvar rnd = Math.random() * range + min,\t\t// random in range\n\t\tmix = Math.random() * influence;\t\t// random mixer\n\treturn rnd * (1 - mix) + biasValue * mix;\t// mix full range and bias\n}\n\nexport function getPositionByAngle(angle, radius) {\n\treturn {\n\t\tx: Math.sin(angle * ANGLE_RATIO) * radius,\n\t\ty: Math.cos(angle * ANGLE_RATIO) * radius,\n\t};\n}\n\n/**\n * Check if a number is valid for svg attributes\n * @param {object} candidate Candidate to test\n * @param {Boolean} nonNegative flag to treat negative number as invalid\n */\nexport function isValidNumber(candidate, nonNegative=false) {\n\tif (Number.isNaN(candidate)) return false;\n\telse if (candidate === undefined) return false;\n\telse if (!Number.isFinite(candidate)) return false;\n\telse if (nonNegative && candidate < 0) return false;\n\telse return true;\n}\n\n/**\n * Round a number to the closes precision, max max precision 4\n * @param {Number} d Any Number\n */\nexport function round(d) {\n\t// https://floating-point-gui.de/\n\t// https://www.jacklmoore.com/notes/rounding-in-javascript/\n\treturn Number(Math.round(d + 'e4') + 'e-4');\n}\n\n/**\n * Creates a deep clone of an object\n * @param {Object} candidate Any Object\n */\n export function deepClone(candidate) {\n\tlet cloned, value, key;\n \n\tif (candidate instanceof Date) {\n\t return new Date(candidate.getTime());\n\t}\n \n\tif (typeof candidate !== \"object\" || candidate === null) {\n\t return candidate;\n\t}\n \n\tcloned = Array.isArray(candidate) ? [] : {};\n \n\tfor (key in candidate) {\n\t value = candidate[key];\n \n\t cloned[key] = deepClone(value);\n\t}\n \n\treturn cloned;\n }","import { fillArray } from './helpers';\n\nexport function getBarHeightAndYAttr(yTop, zeroLine) {\n\tlet height, y;\n\tif (yTop <= zeroLine) {\n\t\theight = zeroLine - yTop;\n\t\ty = yTop;\n\t} else {\n\t\theight = yTop - zeroLine;\n\t\ty = zeroLine;\n\t}\n\n\treturn [height, y];\n}\n\nexport function equilizeNoOfElements(array1, array2,\n\textraCount = array2.length - array1.length) {\n\n\t// Doesn't work if either has zero elements.\n\tif(extraCount > 0) {\n\t\tarray1 = fillArray(array1, extraCount);\n\t} else {\n\t\tarray2 = fillArray(array2, extraCount);\n\t}\n\treturn [array1, array2];\n}\n\nexport function truncateString(txt, len) {\n\tif (!txt) {\n\t\treturn;\n\t}\n\tif (txt.length > len) {\n\t\treturn txt.slice(0, len-3) + '...';\n\t} else {\n\t\treturn txt;\n\t}\n}\n\nexport function shortenLargeNumber(label) {\n\tlet number;\n\tif (typeof label === 'number') number = label;\n\telse if (typeof label === 'string') {\n\t\tnumber = Number(label);\n\t\tif (Number.isNaN(number)) return label;\n\t}\n\n\t// Using absolute since log wont work for negative numbers\n\tlet p = Math.floor(Math.log10(Math.abs(number)));\n\tif (p <= 2) return number; // Return as is for a 3 digit number of less\n\tlet\tl = Math.floor(p / 3);\n\tlet shortened = (Math.pow(10, p - l * 3) * +(number / Math.pow(10, p)).toFixed(1));\n\n\t// Correct for floating point error upto 2 decimal places\n\treturn Math.round(shortened*100)/100 + ' ' + ['', 'K', 'M', 'B', 'T'][l];\n}\n\n// cubic bezier curve calculation (from example by François Romain)\nexport function getSplineCurvePointsStr(xList, yList) {\n\n\tlet points=[];\n\tfor(let i=0;i {\n\t\tlet lengthX = pointB[0] - pointA[0];\n\t\tlet lengthY = pointB[1] - pointA[1];\n\t\treturn {\n\t\t\tlength: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),\n\t\t\tangle: Math.atan2(lengthY, lengthX)\n\t\t};\n\t};\n \n\tlet controlPoint = (current, previous, next, reverse) => {\n\t\tlet p = previous || current;\n\t\tlet n = next || current;\n\t\tlet o = line(p, n);\n\t\tlet angle = o.angle + (reverse ? Math.PI : 0);\n\t\tlet length = o.length * smoothing;\n\t\tlet x = current[0] + Math.cos(angle) * length;\n\t\tlet y = current[1] + Math.sin(angle) * length;\n\t\treturn [x, y];\n\t};\n \n\tlet bezierCommand = (point, i, a) => {\n\t\tlet cps = controlPoint(a[i - 1], a[i - 2], point);\n\t\tlet cpe = controlPoint(point, a[i - 1], a[i + 1], true);\n\t\treturn `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`;\n\t};\n \n\tlet pointStr = (points, command) => {\n\t\treturn points.reduce((acc, point, i, a) => i === 0\n\t\t\t? `${point[0]},${point[1]}`\n\t\t\t: `${acc} ${command(point, i, a)}`, '');\n\t};\n \n\treturn pointStr(points, bezierCommand);\n}\n","const PRESET_COLOR_MAP = {\n\t'light-blue': '#7cd6fd',\n\t'blue': '#5e64ff',\n\t'violet': '#743ee2',\n\t'red': '#ff5858',\n\t'orange': '#ffa00a',\n\t'yellow': '#feef72',\n\t'green': '#28a745',\n\t'light-green': '#98d85b',\n\t'purple': '#b554ff',\n\t'magenta': '#ffa3ef',\n\t'black': '#36114C',\n\t'grey': '#bdd3e6',\n\t'light-grey': '#f0f4f7',\n\t'dark-grey': '#b8c2cc'\n};\n\nfunction limitColor(r){\n\tif (r > 255) return 255;\n\telse if (r < 0) return 0;\n\treturn r;\n}\n\nexport function lightenDarkenColor(color, amt) {\n\tlet col = getColor(color);\n\tlet usePound = false;\n\tif (col[0] == \"#\") {\n\t\tcol = col.slice(1);\n\t\tusePound = true;\n\t}\n\tlet num = parseInt(col,16);\n\tlet r = limitColor((num >> 16) + amt);\n\tlet b = limitColor(((num >> 8) & 0x00FF) + amt);\n\tlet g = limitColor((num & 0x0000FF) + amt);\n\treturn (usePound?\"#\":\"\") + (g | (b << 8) | (r << 16)).toString(16);\n}\n\nexport function isValidColor(string) {\n\t// https://stackoverflow.com/a/32685393\n\tlet HEX_RE = /(^\\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i;\n\tlet RGB_RE = /(^\\s*)(rgb|hsl)(a?)[(]\\s*([\\d.]+\\s*%?)\\s*,\\s*([\\d.]+\\s*%?)\\s*,\\s*([\\d.]+\\s*%?)\\s*(?:,\\s*([\\d.]+)\\s*)?[)]$/i;\n\treturn HEX_RE.test(string) || RGB_RE.test(string);\n}\n\nexport const getColor = (color) => {\n\t// When RGB color, convert to hexadecimal (alpha value is omitted)\n\tif((/rgb[a]{0,1}\\([\\d, ]+\\)/gim).test(color)) {\n\t\treturn (/\\D+(\\d*)\\D+(\\d*)\\D+(\\d*)/gim).exec(color)\n\t\t\t.map((x, i) => (i !== 0 ? Number(x).toString(16) : '#'))\n\t\t\t.reduce((c, ch) => `${c}${ch}`);\n\t}\n\treturn PRESET_COLOR_MAP[color] || color;\n};\n","import { getBarHeightAndYAttr, truncateString, shortenLargeNumber, getSplineCurvePointsStr } from './draw-utils';\nimport { getStringWidth, isValidNumber } from './helpers';\nimport { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants';\nimport { lightenDarkenColor } from './colors';\n\nexport const AXIS_TICK_LENGTH = 6;\nconst LABEL_MARGIN = 4;\nconst LABEL_MAX_CHARS = 15;\nexport const FONT_SIZE = 10;\nconst BASE_LINE_COLOR = '#dadada';\nconst FONT_FILL = '#555b51';\n\nfunction $(expr, con) {\n\treturn typeof expr === \"string\"? (con || document).querySelector(expr) : expr || null;\n}\n\nexport function createSVG(tag, o) {\n\tvar element = document.createElementNS(\"http://www.w3.org/2000/svg\", tag);\n\n\tfor (var i in o) {\n\t\tvar val = o[i];\n\n\t\tif (i === \"inside\") {\n\t\t\t$(val).appendChild(element);\n\t\t}\n\t\telse if (i === \"around\") {\n\t\t\tvar ref = $(val);\n\t\t\tref.parentNode.insertBefore(element, ref);\n\t\t\telement.appendChild(ref);\n\n\t\t} else if (i === \"styles\") {\n\t\t\tif(typeof val === \"object\") {\n\t\t\t\tObject.keys(val).map(prop => {\n\t\t\t\t\telement.style[prop] = val[prop];\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif(i === \"className\") { i = \"class\"; }\n\t\t\tif(i === \"innerHTML\") {\n\t\t\t\telement['textContent'] = val;\n\t\t\t} else {\n\t\t\t\telement.setAttribute(i, val);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn element;\n}\n\nfunction renderVerticalGradient(svgDefElem, gradientId) {\n\treturn createSVG('linearGradient', {\n\t\tinside: svgDefElem,\n\t\tid: gradientId,\n\t\tx1: 0,\n\t\tx2: 0,\n\t\ty1: 0,\n\t\ty2: 1\n\t});\n}\n\nfunction setGradientStop(gradElem, offset, color, opacity) {\n\treturn createSVG('stop', {\n\t\t'inside': gradElem,\n\t\t'style': `stop-color: ${color}`,\n\t\t'offset': offset,\n\t\t'stop-opacity': opacity\n\t});\n}\n\nexport function makeSVGContainer(parent, className, width, height) {\n\treturn createSVG('svg', {\n\t\tclassName: className,\n\t\tinside: parent,\n\t\twidth: width,\n\t\theight: height\n\t});\n}\n\nexport function makeSVGDefs(svgContainer) {\n\treturn createSVG('defs', {\n\t\tinside: svgContainer,\n\t});\n}\n\nexport function makeSVGGroup(className, transform='', parent=undefined) {\n\tlet args = {\n\t\tclassName: className,\n\t\ttransform: transform\n\t};\n\tif(parent) args.inside = parent;\n\treturn createSVG('g', args);\n}\n\nexport function wrapInSVGGroup(elements, className='') {\n\tlet g = createSVG('g', {\n\t\tclassName: className\n\t});\n\telements.forEach(e => g.appendChild(e));\n\treturn g;\n}\n\nexport function makePath(pathStr, className='', stroke='none', fill='none', strokeWidth=2) {\n\treturn createSVG('path', {\n\t\tclassName: className,\n\t\td: pathStr,\n\t\tstyles: {\n\t\t\tstroke: stroke,\n\t\t\tfill: fill,\n\t\t\t'stroke-width': strokeWidth\n\t\t}\n\t});\n}\n\nexport function makeArcPathStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, arcEndY] = [center.x + endPosition.x, center.y + endPosition.y];\n\treturn `M${center.x} ${center.y}\n\t\tL${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY} z`;\n}\n\nexport function makeCircleStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, midArc, arcEndY] = [center.x + endPosition.x, center.y * 2, center.y + endPosition.y];\n\treturn `M${center.x} ${center.y}\n\t\tL${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${midArc} z\n\t\tL${arcStartX} ${midArc}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY} z`;\n}\n\nexport function makeArcStrokePathStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, arcEndY] = [center.x + endPosition.x, center.y + endPosition.y];\n\n\treturn `M${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY}`;\n}\n\nexport function makeStrokeCircleStr(startPosition, endPosition, center, radius, clockWise=1, largeArc=0){\n\tlet [arcStartX, arcStartY] = [center.x + startPosition.x, center.y + startPosition.y];\n\tlet [arcEndX, midArc, arcEndY] = [center.x + endPosition.x, radius * 2 + arcStartY, center.y + startPosition.y];\n\n\treturn `M${arcStartX} ${arcStartY}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${midArc}\n\t\tM${arcStartX} ${midArc}\n\t\tA ${radius} ${radius} 0 ${largeArc} ${clockWise ? 1 : 0}\n\t\t${arcEndX} ${arcEndY}`;\n}\n\nexport function makeGradient(svgDefElem, color, lighter = false) {\n\tlet gradientId ='path-fill-gradient' + '-' + color + '-' +(lighter ? 'lighter' : 'default');\n\tlet gradientDef = renderVerticalGradient(svgDefElem, gradientId);\n\tlet opacities = [1, 0.6, 0.2];\n\tif(lighter) {\n\t\topacities = [0.4, 0.2, 0];\n\t}\n\n\tsetGradientStop(gradientDef, \"0%\", color, opacities[0]);\n\tsetGradientStop(gradientDef, \"50%\", color, opacities[1]);\n\tsetGradientStop(gradientDef, \"100%\", color, opacities[2]);\n\n\treturn gradientId;\n}\n\nexport function percentageBar(x, y, width, height,\n\tdepth=PERCENTAGE_BAR_DEFAULT_DEPTH, fill='none') {\n\n\tlet args = {\n\t\tclassName: 'percentage-bar',\n\t\tx: x,\n\t\ty: y,\n\t\twidth: width,\n\t\theight: height,\n\t\tfill: fill,\n\t\tstyles: {\n\t\t\t'stroke': lightenDarkenColor(fill, -25),\n\t\t\t// Diabolically good: https://stackoverflow.com/a/9000859\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n\t\t\t'stroke-dasharray': `0, ${height + width}, ${width}, ${height}`,\n\t\t\t'stroke-width': depth\n\t\t},\n\t};\n\n\treturn createSVG(\"rect\", args);\n}\n\nexport function heatSquare(className, x, y, size, radius, fill='none', data={}) {\n\tlet args = {\n\t\tclassName: className,\n\t\tx: x,\n\t\ty: y,\n\t\twidth: size,\n\t\theight: size,\n\t\trx: radius,\n\t\tfill: fill\n\t};\n\n\tObject.keys(data).map(key => {\n\t\targs[key] = data[key];\n\t});\n\n\treturn createSVG(\"rect\", args);\n}\n\nexport function legendBar(x, y, size, fill='none', label, truncate=false) {\n\tlabel = truncate ? truncateString(label, LABEL_MAX_CHARS) : label;\n\n\tlet args = {\n\t\tclassName: 'legend-bar',\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: size,\n\t\theight: '2px',\n\t\tfill: fill\n\t};\n\tlet text = createSVG('text', {\n\t\tclassName: 'legend-dataset-text',\n\t\tx: 0,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE * 2) + 'px',\n\t\t'font-size': (FONT_SIZE * 1.2) + 'px',\n\t\t'text-anchor': 'start',\n\t\tfill: FONT_FILL,\n\t\tinnerHTML: label\n\t});\n\n\tlet group = createSVG('g', {\n\t\ttransform: `translate(${x}, ${y})`\n\t});\n\tgroup.appendChild(createSVG(\"rect\", args));\n\tgroup.appendChild(text);\n\n\treturn group;\n}\n\nexport function legendDot(x, y, size, fill='none', label, truncate=false) {\n\tlabel = truncate ? truncateString(label, LABEL_MAX_CHARS) : label;\n\n\tlet args = {\n\t\tclassName: 'legend-dot',\n\t\tcx: 0,\n\t\tcy: 0,\n\t\tr: size,\n\t\tfill: fill\n\t};\n\tlet text = createSVG('text', {\n\t\tclassName: 'legend-dataset-text',\n\t\tx: 0,\n\t\ty: 0,\n\t\tdx: (FONT_SIZE) + 'px',\n\t\tdy: (FONT_SIZE/3) + 'px',\n\t\t'font-size': (FONT_SIZE * 1.2) + 'px',\n\t\t'text-anchor': 'start',\n\t\tfill: FONT_FILL,\n\t\tinnerHTML: label\n\t});\n\n\tlet group = createSVG('g', {\n\t\ttransform: `translate(${x}, ${y})`\n\t});\n\tgroup.appendChild(createSVG(\"circle\", args));\n\tgroup.appendChild(text);\n\n\treturn group;\n}\n\nexport function makeText(className, x, y, content, options = {}) {\n\tlet fontSize = options.fontSize || FONT_SIZE;\n\tlet dy = options.dy !== undefined ? options.dy : (fontSize / 2);\n\tlet fill = options.fill || FONT_FILL;\n\tlet textAnchor = options.textAnchor || 'start';\n\treturn createSVG('text', {\n\t\tclassName: className,\n\t\tx: x,\n\t\ty: y,\n\t\tdy: dy + 'px',\n\t\t'font-size': fontSize + 'px',\n\t\tfill: fill,\n\t\t'text-anchor': textAnchor,\n\t\tinnerHTML: content\n\t});\n}\n\nfunction makeVertLine(x, label, y1, y2, options={}) {\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tlet l = createSVG('line', {\n\t\tclassName: 'line-vertical ' + options.className,\n\t\tx1: 0,\n\t\tx2: 0,\n\t\ty1: y1,\n\t\ty2: y2,\n\t\tstyles: {\n\t\t\tstroke: options.stroke\n\t\t}\n\t});\n\n\tlet text = createSVG('text', {\n\t\tx: 0,\n\t\ty: y1 > y2 ? y1 + LABEL_MARGIN : y1 - LABEL_MARGIN - FONT_SIZE,\n\t\tdy: FONT_SIZE + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': 'middle',\n\t\tinnerHTML: label + \"\"\n\t});\n\n\tlet line = createSVG('g', {\n\t\ttransform: `translate(${ x }, 0)`\n\t});\n\n\tline.appendChild(l);\n\tline.appendChild(text);\n\n\treturn line;\n}\n\nfunction makeHoriLine(y, label, x1, x2, options={}) {\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tif(!options.lineType) options.lineType = '';\n\tif (options.shortenNumbers) label = shortenLargeNumber(label);\n\n\tlet className = 'line-horizontal ' + options.className +\n\t\t(options.lineType === \"dashed\" ? \"dashed\": \"\");\n\n\tlet l = createSVG('line', {\n\t\tclassName: className,\n\t\tx1: x1,\n\t\tx2: x2,\n\t\ty1: 0,\n\t\ty2: 0,\n\t\tstyles: {\n\t\t\tstroke: options.stroke\n\t\t}\n\t});\n\n\tlet text = createSVG('text', {\n\t\tx: x1 < x2 ? x1 - LABEL_MARGIN : x1 + LABEL_MARGIN,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE / 2 - 2) + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': x1 < x2 ? 'end' : 'start',\n\t\tinnerHTML: label+\"\"\n\t});\n\n\tlet line = createSVG('g', {\n\t\ttransform: `translate(0, ${y})`,\n\t\t'stroke-opacity': 1\n\t});\n\n\tif(text === 0 || text === '0') {\n\t\tline.style.stroke = \"rgba(27, 31, 35, 0.6)\";\n\t}\n\n\tline.appendChild(l);\n\tline.appendChild(text);\n\n\treturn line;\n}\n\nexport function yLine(y, label, width, options={}) {\n\tif (!isValidNumber(y)) y = 0;\n\n\tif(!options.pos) options.pos = 'left';\n\tif(!options.offset) options.offset = 0;\n\tif(!options.mode) options.mode = 'span';\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tif(!options.className) options.className = '';\n\n\tlet x1 = -1 * AXIS_TICK_LENGTH;\n\tlet x2 = options.mode === 'span' ? width + AXIS_TICK_LENGTH : 0;\n\n\tif(options.mode === 'tick' && options.pos === 'right') {\n\t\tx1 = width + AXIS_TICK_LENGTH;\n\t\tx2 = width;\n\t}\n\n\t// let offset = options.pos === 'left' ? -1 * options.offset : options.offset;\n\n\tx1 += options.offset;\n\tx2 += options.offset;\n\n\treturn makeHoriLine(y, label, x1, x2, {\n\t\tstroke: options.stroke,\n\t\tclassName: options.className,\n\t\tlineType: options.lineType,\n\t\tshortenNumbers: options.shortenNumbers\n\t});\n}\n\nexport function xLine(x, label, height, options={}) {\n\tif (!isValidNumber(x)) x = 0;\n\n\tif(!options.pos) options.pos = 'bottom';\n\tif(!options.offset) options.offset = 0;\n\tif(!options.mode) options.mode = 'span';\n\tif(!options.stroke) options.stroke = BASE_LINE_COLOR;\n\tif(!options.className) options.className = '';\n\n\t// Draw X axis line in span/tick mode with optional label\n\t// \ty2(span)\n\t// \t\t\t\t\t\t|\n\t// \t\t\t\t\t\t|\n\t//\t\t\t\tx line\t|\n\t//\t\t\t\t\t\t|\n\t// \t\t\t\t\t \t|\n\t// ---------------------+-- y2(tick)\n\t//\t\t\t\t\t\t|\n\t//\t\t\t\t\t\t\ty1\n\n\tlet y1 = height + AXIS_TICK_LENGTH;\n\tlet y2 = options.mode === 'span' ? -1 * AXIS_TICK_LENGTH : height;\n\n\tif(options.mode === 'tick' && options.pos === 'top') {\n\t\t// top axis ticks\n\t\ty1 = -1 * AXIS_TICK_LENGTH;\n\t\ty2 = 0;\n\t}\n\n\treturn makeVertLine(x, label, y1, y2, {\n\t\tstroke: options.stroke,\n\t\tclassName: options.className,\n\t\tlineType: options.lineType\n\t});\n}\n\nexport function yMarker(y, label, width, options={}) {\n\tif(!options.labelPos) options.labelPos = 'right';\n\tlet x = options.labelPos === 'left' ? LABEL_MARGIN\n\t\t: width - getStringWidth(label, 5) - LABEL_MARGIN;\n\n\tlet labelSvg = createSVG('text', {\n\t\tclassName: 'chart-label',\n\t\tx: x,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE / -2) + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': 'start',\n\t\tinnerHTML: label+\"\"\n\t});\n\n\tlet line = makeHoriLine(y, '', 0, width, {\n\t\tstroke: options.stroke || BASE_LINE_COLOR,\n\t\tclassName: options.className || '',\n\t\tlineType: options.lineType\n\t});\n\n\tline.appendChild(labelSvg);\n\n\treturn line;\n}\n\nexport function yRegion(y1, y2, width, label, options={}) {\n\t// return a group\n\tlet height = y1 - y2;\n\n\tlet rect = createSVG('rect', {\n\t\tclassName: `bar mini`, // remove class\n\t\tstyles: {\n\t\t\tfill: `rgba(228, 234, 239, 0.49)`,\n\t\t\tstroke: BASE_LINE_COLOR,\n\t\t\t'stroke-dasharray': `${width}, ${height}`\n\t\t},\n\t\t// 'data-point-index': index,\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: width,\n\t\theight: height\n\t});\n\n\tif(!options.labelPos) options.labelPos = 'right';\n\tlet x = options.labelPos === 'left' ? LABEL_MARGIN\n\t\t: width - getStringWidth(label+\"\", 4.5) - LABEL_MARGIN;\n\n\tlet labelSvg = createSVG('text', {\n\t\tclassName: 'chart-label',\n\t\tx: x,\n\t\ty: 0,\n\t\tdy: (FONT_SIZE / -2) + 'px',\n\t\t'font-size': FONT_SIZE + 'px',\n\t\t'text-anchor': 'start',\n\t\tinnerHTML: label+\"\"\n\t});\n\n\tlet region = createSVG('g', {\n\t\ttransform: `translate(0, ${y2})`\n\t});\n\n\tregion.appendChild(rect);\n\tregion.appendChild(labelSvg);\n\n\treturn region;\n}\n\nexport function datasetBar(x, yTop, width, color, label='', index=0, offset=0, meta={}) {\n\tlet [height, y] = getBarHeightAndYAttr(yTop, meta.zeroLine);\n\ty -= offset;\n\n\tif(height === 0) {\n\t\theight = meta.minHeight;\n\t\ty -= meta.minHeight;\n\t}\n\n\t// Preprocess numbers to avoid svg building errors\n\tif (!isValidNumber(x)) x = 0;\n\tif (!isValidNumber(y)) y = 0;\n\tif (!isValidNumber(height, true)) height = 0;\n\tif (!isValidNumber(width, true)) width = 0;\n\n\tlet rect = createSVG('rect', {\n\t\tclassName: `bar mini`,\n\t\tstyle: `fill: ${color}`,\n\t\t'data-point-index': index,\n\t\tx: x,\n\t\ty: y,\n\t\twidth: width,\n\t\theight: height\n\t});\n\n\tlabel += \"\";\n\n\tif(!label && !label.length) {\n\t\treturn rect;\n\t} else {\n\t\trect.setAttribute('y', 0);\n\t\trect.setAttribute('x', 0);\n\t\tlet text = createSVG('text', {\n\t\t\tclassName: 'data-point-value',\n\t\t\tx: width/2,\n\t\t\ty: 0,\n\t\t\tdy: (FONT_SIZE / 2 * -1) + 'px',\n\t\t\t'font-size': FONT_SIZE + 'px',\n\t\t\t'text-anchor': 'middle',\n\t\t\tinnerHTML: label\n\t\t});\n\n\t\tlet group = createSVG('g', {\n\t\t\t'data-point-index': index,\n\t\t\ttransform: `translate(${x}, ${y})`\n\t\t});\n\t\tgroup.appendChild(rect);\n\t\tgroup.appendChild(text);\n\n\t\treturn group;\n\t}\n}\n\nexport function datasetDot(x, y, radius, color, label='', index=0) {\n\tlet dot = createSVG('circle', {\n\t\tstyle: `fill: ${color}`,\n\t\t'data-point-index': index,\n\t\tcx: x,\n\t\tcy: y,\n\t\tr: radius\n\t});\n\n\tlabel += \"\";\n\n\tif(!label && !label.length) {\n\t\treturn dot;\n\t} else {\n\t\tdot.setAttribute('cy', 0);\n\t\tdot.setAttribute('cx', 0);\n\n\t\tlet text = createSVG('text', {\n\t\t\tclassName: 'data-point-value',\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\tdy: (FONT_SIZE / 2 * -1 - radius) + 'px',\n\t\t\t'font-size': FONT_SIZE + 'px',\n\t\t\t'text-anchor': 'middle',\n\t\t\tinnerHTML: label\n\t\t});\n\n\t\tlet group = createSVG('g', {\n\t\t\t'data-point-index': index,\n\t\t\ttransform: `translate(${x}, ${y})`\n\t\t});\n\t\tgroup.appendChild(dot);\n\t\tgroup.appendChild(text);\n\n\t\treturn group;\n\t}\n}\n\nexport function getPaths(xList, yList, color, options={}, meta={}) {\n\tlet pointsList = yList.map((y, i) => (xList[i] + ',' + y));\n\tlet pointsStr = pointsList.join(\"L\");\n\n\t// Spline\n\tif (options.spline)\n\t\tpointsStr = getSplineCurvePointsStr(xList, yList);\n\n\tlet path = makePath(\"M\"+pointsStr, 'line-graph-path', color);\n\n\t// HeatLine\n\tif(options.heatline) {\n\t\tlet gradient_id = makeGradient(meta.svgDefs, color);\n\t\tpath.style.stroke = `url(#${gradient_id})`;\n\t}\n\n\tlet paths = {\n\t\tpath: path\n\t};\n\n\t// Region\n\tif(options.regionFill) {\n\t\tlet gradient_id_region = makeGradient(meta.svgDefs, color, true);\n\n\t\tlet pathStr = \"M\" + `${xList[0]},${meta.zeroLine}L` + pointsStr + `L${xList.slice(-1)[0]},${meta.zeroLine}`;\n\t\tpaths.region = makePath(pathStr, `region-fill`, 'none', `url(#${gradient_id_region})`);\n\t}\n\n\treturn paths;\n}\n\nexport let makeOverlay = {\n\t'bar': (unit) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'rect') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet overlay = unit.cloneNode();\n\t\toverlay.style.fill = '#000000';\n\t\toverlay.style.opacity = '0.4';\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t\treturn overlay;\n\t},\n\n\t'dot': (unit) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet overlay = unit.cloneNode();\n\t\tlet radius = unit.getAttribute('r');\n\t\tlet fill = unit.getAttribute('fill');\n\t\toverlay.setAttribute('r', parseInt(radius) + DOT_OVERLAY_SIZE_INCR);\n\t\toverlay.setAttribute('fill', fill);\n\t\toverlay.style.opacity = '0.6';\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t\treturn overlay;\n\t},\n\n\t'heat_square': (unit) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet overlay = unit.cloneNode();\n\t\tlet radius = unit.getAttribute('r');\n\t\tlet fill = unit.getAttribute('fill');\n\t\toverlay.setAttribute('r', parseInt(radius) + DOT_OVERLAY_SIZE_INCR);\n\t\toverlay.setAttribute('fill', fill);\n\t\toverlay.style.opacity = '0.6';\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t\treturn overlay;\n\t}\n};\n\nexport let updateOverlay = {\n\t'bar': (unit, overlay) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'rect') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet attributes = ['x', 'y', 'width', 'height'];\n\t\tObject.values(unit.attributes)\n\t\t\t.filter(attr => attributes.includes(attr.name) && attr.specified)\n\t\t\t.map(attr => {\n\t\t\t\toverlay.setAttribute(attr.name, attr.nodeValue);\n\t\t\t});\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t},\n\n\t'dot': (unit, overlay) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet attributes = ['cx', 'cy'];\n\t\tObject.values(unit.attributes)\n\t\t\t.filter(attr => attributes.includes(attr.name) && attr.specified)\n\t\t\t.map(attr => {\n\t\t\t\toverlay.setAttribute(attr.name, attr.nodeValue);\n\t\t\t});\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t},\n\n\t'heat_square': (unit, overlay) => {\n\t\tlet transformValue;\n\t\tif(unit.nodeName !== 'circle') {\n\t\t\ttransformValue = unit.getAttribute('transform');\n\t\t\tunit = unit.childNodes[0];\n\t\t}\n\t\tlet attributes = ['cx', 'cy'];\n\t\tObject.values(unit.attributes)\n\t\t\t.filter(attr => attributes.includes(attr.name) && attr.specified)\n\t\t\t.map(attr => {\n\t\t\t\toverlay.setAttribute(attr.name, attr.nodeValue);\n\t\t\t});\n\n\t\tif(transformValue) {\n\t\t\toverlay.setAttribute('transform', transformValue);\n\t\t}\n\t},\n};\n","import { getBarHeightAndYAttr, getSplineCurvePointsStr } from './draw-utils';\n\nexport const UNIT_ANIM_DUR = 350;\nexport const PATH_ANIM_DUR = 350;\nexport const MARKER_LINE_ANIM_DUR = UNIT_ANIM_DUR;\nexport const REPLACE_ALL_NEW_DUR = 250;\n\nexport const STD_EASING = 'easein';\n\nexport function translate(unit, oldCoord, newCoord, duration) {\n\tlet old = typeof oldCoord === 'string' ? oldCoord : oldCoord.join(', ');\n\treturn [\n\t\tunit,\n\t\t{transform: newCoord.join(', ')},\n\t\tduration,\n\t\tSTD_EASING,\n\t\t\"translate\",\n\t\t{transform: old}\n\t];\n}\n\nexport function translateVertLine(xLine, newX, oldX) {\n\treturn translate(xLine, [oldX, 0], [newX, 0], MARKER_LINE_ANIM_DUR);\n}\n\nexport function translateHoriLine(yLine, newY, oldY) {\n\treturn translate(yLine, [0, oldY], [0, newY], MARKER_LINE_ANIM_DUR);\n}\n\nexport function animateRegion(rectGroup, newY1, newY2, oldY2) {\n\tlet newHeight = newY1 - newY2;\n\tlet rect = rectGroup.childNodes[0];\n\tlet width = rect.getAttribute(\"width\");\n\tlet rectAnim = [\n\t\trect,\n\t\t{ height: newHeight, 'stroke-dasharray': `${width}, ${newHeight}` },\n\t\tMARKER_LINE_ANIM_DUR,\n\t\tSTD_EASING\n\t];\n\n\tlet groupAnim = translate(rectGroup, [0, oldY2], [0, newY2], MARKER_LINE_ANIM_DUR);\n\treturn [rectAnim, groupAnim];\n}\n\nexport function animateBar(bar, x, yTop, width, offset=0, meta={}) {\n\tlet [height, y] = getBarHeightAndYAttr(yTop, meta.zeroLine);\n\ty -= offset;\n\tif(bar.nodeName !== 'rect') {\n\t\tlet rect = bar.childNodes[0];\n\t\tlet rectAnim = [\n\t\t\trect,\n\t\t\t{width: width, height: height},\n\t\t\tUNIT_ANIM_DUR,\n\t\t\tSTD_EASING\n\t\t];\n\n\t\tlet oldCoordStr = bar.getAttribute(\"transform\").split(\"(\")[1].slice(0, -1);\n\t\tlet groupAnim = translate(bar, oldCoordStr, [x, y], MARKER_LINE_ANIM_DUR);\n\t\treturn [rectAnim, groupAnim];\n\t} else {\n\t\treturn [[bar, {width: width, height: height, x: x, y: y}, UNIT_ANIM_DUR, STD_EASING]];\n\t}\n\t// bar.animate({height: args.newHeight, y: yTop}, UNIT_ANIM_DUR, mina.easein);\n}\n\nexport function animateDot(dot, x, y) {\n\tif(dot.nodeName !== 'circle') {\n\t\tlet oldCoordStr = dot.getAttribute(\"transform\").split(\"(\")[1].slice(0, -1);\n\t\tlet groupAnim = translate(dot, oldCoordStr, [x, y], MARKER_LINE_ANIM_DUR);\n\t\treturn [groupAnim];\n\t} else {\n\t\treturn [[dot, {cx: x, cy: y}, UNIT_ANIM_DUR, STD_EASING]];\n\t}\n\t// dot.animate({cy: yTop}, UNIT_ANIM_DUR, mina.easein);\n}\n\nexport function animatePath(paths, newXList, newYList, zeroLine, spline) {\n\tlet pathComponents = [];\n\tlet pointsStr = newYList.map((y, i) => (newXList[i] + ',' + y)).join(\"L\");\n\n\tif (spline)\n\t\tpointsStr = getSplineCurvePointsStr(newXList, newYList);\n\n\tconst animPath = [paths.path, {d:\"M\" + pointsStr}, PATH_ANIM_DUR, STD_EASING];\n\tpathComponents.push(animPath);\n\n\tif(paths.region) {\n\t\tlet regStartPt = `${newXList[0]},${zeroLine}L`;\n\t\tlet regEndPt = `L${newXList.slice(-1)[0]}, ${zeroLine}`;\n\n\t\tconst animRegion = [\n\t\t\tpaths.region,\n\t\t\t{d:\"M\" + regStartPt + pointsStr + regEndPt},\n\t\t\tPATH_ANIM_DUR,\n\t\t\tSTD_EASING\n\t\t];\n\t\tpathComponents.push(animRegion);\n\t}\n\n\treturn pathComponents;\n}\n\nexport function animatePathStr(oldPath, pathStr) {\n\treturn [oldPath, {d: pathStr}, UNIT_ANIM_DUR, STD_EASING];\n}\n","// Leveraging SMIL Animations\n\nimport { REPLACE_ALL_NEW_DUR } from './animate';\n\nconst EASING = {\n\tease: \"0.25 0.1 0.25 1\",\n\tlinear: \"0 0 1 1\",\n\t// easein: \"0.42 0 1 1\",\n\teasein: \"0.1 0.8 0.2 1\",\n\teaseout: \"0 0 0.58 1\",\n\teaseinout: \"0.42 0 0.58 1\"\n};\n\nfunction animateSVGElement(element, props, dur, easingType=\"linear\", type=undefined, oldValues={}) {\n\n\tlet animElement = element.cloneNode(true);\n\tlet newElement = element.cloneNode(true);\n\n\tfor(var attributeName in props) {\n\t\tlet animateElement;\n\t\tif(attributeName === 'transform') {\n\t\t\tanimateElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"animateTransform\");\n\t\t} else {\n\t\t\tanimateElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"animate\");\n\t\t}\n\t\tlet currentValue = oldValues[attributeName] || element.getAttribute(attributeName);\n\t\tlet value = props[attributeName];\n\n\t\tlet animAttr = {\n\t\t\tattributeName: attributeName,\n\t\t\tfrom: currentValue,\n\t\t\tto: value,\n\t\t\tbegin: \"0s\",\n\t\t\tdur: dur/1000 + \"s\",\n\t\t\tvalues: currentValue + \";\" + value,\n\t\t\tkeySplines: EASING[easingType],\n\t\t\tkeyTimes: \"0;1\",\n\t\t\tcalcMode: \"spline\",\n\t\t\tfill: 'freeze'\n\t\t};\n\n\t\tif(type) {\n\t\t\tanimAttr[\"type\"] = type;\n\t\t}\n\n\t\tfor (var i in animAttr) {\n\t\t\tanimateElement.setAttribute(i, animAttr[i]);\n\t\t}\n\n\t\tanimElement.appendChild(animateElement);\n\n\t\tif(type) {\n\t\t\tnewElement.setAttribute(attributeName, `translate(${value})`);\n\t\t} else {\n\t\t\tnewElement.setAttribute(attributeName, value);\n\t\t}\n\t}\n\n\treturn [animElement, newElement];\n}\n\nexport function transform(element, style) { // eslint-disable-line no-unused-vars\n\telement.style.transform = style;\n\telement.style.webkitTransform = style;\n\telement.style.msTransform = style;\n\telement.style.mozTransform = style;\n\telement.style.oTransform = style;\n}\n\nfunction animateSVG(svgContainer, elements) {\n\tlet newElements = [];\n\tlet animElements = [];\n\n\telements.map(element => {\n\t\tlet unit = element[0];\n\t\tlet parent = unit.parentNode;\n\n\t\tlet animElement, newElement;\n\n\t\telement[0] = unit;\n\t\t[animElement, newElement] = animateSVGElement(...element);\n\n\t\tnewElements.push(newElement);\n\t\tanimElements.push([animElement, parent]);\n\t\t\n\t\tif (parent) {\n\t\t\tparent.replaceChild(animElement, unit);\n\t\t}\n\t});\n\n\tlet animSvg = svgContainer.cloneNode(true);\n\n\tanimElements.map((animElement, i) => {\n\t\tif (animElement[1]) {\n\t\t\tanimElement[1].replaceChild(newElements[i], animElement[0]);\n\t\t\telements[i][0] = newElements[i];\n\t\t}\n\t});\n\n\treturn animSvg;\n}\n\nexport function runSMILAnimation(parent, svgElement, elementsToAnimate) {\n\tif(elementsToAnimate.length === 0) return;\n\n\tlet animSvgElement = animateSVG(svgElement, elementsToAnimate);\n\tif(svgElement.parentNode == parent) {\n\t\tparent.removeChild(svgElement);\n\t\tparent.appendChild(animSvgElement);\n\n\t}\n\n\t// Replace the new svgElement (data has already been replaced)\n\tsetTimeout(() => {\n\t\tif(animSvgElement.parentNode == parent) {\n\t\t\tparent.removeChild(animSvgElement);\n\t\t\tparent.appendChild(svgElement);\n\t\t}\n\t}, REPLACE_ALL_NEW_DUR);\n}\n","import { $ } from '../utils/dom';\nimport { CSSTEXT } from '../../css/chartsCss';\n\nexport function downloadFile(filename, data) {\n\tvar a = document.createElement('a');\n\ta.style = \"display: none\";\n\tvar blob = new Blob(data, {type: \"image/svg+xml; charset=utf-8\"});\n\tvar url = window.URL.createObjectURL(blob);\n\ta.href = url;\n\ta.download = filename;\n\tdocument.body.appendChild(a);\n\ta.click();\n\tsetTimeout(function(){\n\t\tdocument.body.removeChild(a);\n\t\twindow.URL.revokeObjectURL(url);\n\t}, 300);\n}\n\nexport function prepareForExport(svg) {\n\tlet clone = svg.cloneNode(true);\n\tclone.classList.add('chart-container');\n\tclone.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n\tclone.setAttribute('xmlns:xlink', \"http://www.w3.org/1999/xlink\");\n\tlet styleEl = $.create('style', {\n\t\t'innerHTML': CSSTEXT\n\t});\n\tclone.insertBefore(styleEl, clone.firstChild);\n\n\tlet container = $.create('div');\n\tcontainer.appendChild(clone);\n\n\treturn container.innerHTML;\n}\n","// Playing around with dates\n\nexport const NO_OF_YEAR_MONTHS = 12;\nexport const NO_OF_DAYS_IN_WEEK = 7;\nexport const DAYS_IN_YEAR = 375;\nexport const NO_OF_MILLIS = 1000;\nexport const SEC_IN_DAY = 86400;\n\nexport const MONTH_NAMES = [\"January\", \"February\", \"March\", \"April\", \"May\",\n\t\"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\nexport const MONTH_NAMES_SHORT = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\n\t\"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nexport const DAY_NAMES_SHORT = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nexport const DAY_NAMES = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\",\n\t\"Thursday\", \"Friday\", \"Saturday\"];\n\n// https://stackoverflow.com/a/11252167/6495043\nfunction treatAsUtc(date) {\n\tlet result = new Date(date);\n\tresult.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n\treturn result;\n}\n\nexport function getYyyyMmDd(date) {\n\tlet dd = date.getDate();\n\tlet mm = date.getMonth() + 1; // getMonth() is zero-based\n\treturn [\n\t\tdate.getFullYear(),\n\t\t(mm>9 ? '' : '0') + mm,\n\t\t(dd>9 ? '' : '0') + dd\n\t].join('-');\n}\n\nexport function clone(date) {\n\treturn new Date(date.getTime());\n}\n\nexport function timestampSec(date) {\n\treturn date.getTime()/NO_OF_MILLIS;\n}\n\nexport function timestampToMidnight(timestamp, roundAhead = false) {\n\tlet midnightTs = Math.floor(timestamp - (timestamp % SEC_IN_DAY));\n\tif(roundAhead) {\n\t\treturn midnightTs + SEC_IN_DAY;\n\t}\n\treturn midnightTs;\n}\n\n// export function getMonthsBetween(startDate, endDate) {}\n\nexport function getWeeksBetween(startDate, endDate) {\n\tlet weekStartDate = setDayToSunday(startDate);\n\treturn Math.ceil(getDaysBetween(weekStartDate, endDate) / NO_OF_DAYS_IN_WEEK);\n}\n\nexport function getDaysBetween(startDate, endDate) {\n\tlet millisecondsPerDay = SEC_IN_DAY * NO_OF_MILLIS;\n\treturn (treatAsUtc(endDate) - treatAsUtc(startDate)) / millisecondsPerDay;\n}\n\nexport function areInSameMonth(startDate, endDate) {\n\treturn startDate.getMonth() === endDate.getMonth()\n\t\t&& startDate.getFullYear() === endDate.getFullYear();\n}\n\nexport function getMonthName(i, short=false) {\n\tlet monthName = MONTH_NAMES[i];\n\treturn short ? monthName.slice(0, 3) : monthName;\n}\n\nexport function getLastDateInMonth (month, year) {\n\treturn new Date(year, month + 1, 0); // 0: last day in previous month\n}\n\n// mutates\nexport function setDayToSunday(date) {\n\tlet newDate = clone(date);\n\tconst day = newDate.getDay();\n\tif(day !== 0) {\n\t\taddDays(newDate, (-1) * day);\n\t}\n\treturn newDate;\n}\n\n// mutates\nexport function addDays(date, numberOfDays) {\n\tdate.setDate(date.getDate() + numberOfDays);\n}\n","import { makeSVGGroup } from '../utils/draw';\nimport { makeText, makePath, xLine, yLine, yMarker, yRegion, datasetBar, datasetDot, percentageBar, getPaths, heatSquare } from '../utils/draw';\nimport { equilizeNoOfElements } from '../utils/draw-utils';\nimport { translateHoriLine, translateVertLine, animateRegion, animateBar,\n\tanimateDot, animatePath, animatePathStr } from '../utils/animate';\nimport { getMonthName } from '../utils/date-utils';\n\nclass ChartComponent {\n\tconstructor({\n\t\tlayerClass = '',\n\t\tlayerTransform = '',\n\t\tconstants,\n\n\t\tgetData,\n\t\tmakeElements,\n\t\tanimateElements\n\t}) {\n\t\tthis.layerTransform = layerTransform;\n\t\tthis.constants = constants;\n\n\t\tthis.makeElements = makeElements;\n\t\tthis.getData = getData;\n\n\t\tthis.animateElements = animateElements;\n\n\t\tthis.store = [];\n\t\tthis.labels = [];\n\n\t\tthis.layerClass = layerClass;\n\t\tthis.layerClass = typeof(this.layerClass) === 'function'\n\t\t\t? this.layerClass() : this.layerClass;\n\n\t\tthis.refresh();\n\t}\n\n\trefresh(data) {\n\t\tthis.data = data || this.getData();\n\t}\n\n\tsetup(parent) {\n\t\tthis.layer = makeSVGGroup(this.layerClass, this.layerTransform, parent);\n\t}\n\n\tmake() {\n\t\tthis.render(this.data);\n\t\tthis.oldData = this.data;\n\t}\n\n\trender(data) {\n\t\tthis.store = this.makeElements(data);\n\n\t\tthis.layer.textContent = '';\n\t\tthis.store.forEach(element => {\n\t\t\tthis.layer.appendChild(element);\n\t\t});\n\t\tthis.labels.forEach(element => {\n\t\t\tthis.layer.appendChild(element);\n\t\t});\n\t}\n\n\tupdate(animate = true) {\n\t\tthis.refresh();\n\t\tlet animateElements = [];\n\t\tif(animate) {\n\t\t\tanimateElements = this.animateElements(this.data) || [];\n\t\t}\n\t\treturn animateElements;\n\t}\n}\n\nlet componentConfigs = {\n\tdonutSlices: {\n\t\tlayerClass: 'donut-slices',\n\t\tmakeElements(data) {\n\t\t\treturn data.sliceStrings.map((s, i) => {\n\t\t\t\tlet slice = makePath(s, 'donut-path', data.colors[i], 'none', data.strokeWidth);\n\t\t\t\tslice.style.transition = 'transform .3s;';\n\t\t\t\treturn slice;\n\t\t\t});\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\treturn this.store.map((slice, i) => animatePathStr(slice, newData.sliceStrings[i]));\n\t\t},\n\t},\n\tpieSlices: {\n\t\tlayerClass: 'pie-slices',\n\t\tmakeElements(data) {\n\t\t\treturn data.sliceStrings.map((s, i) =>{\n\t\t\t\tlet slice = makePath(s, 'pie-path', 'none', data.colors[i]);\n\t\t\t\tslice.style.transition = 'transform .3s;';\n\t\t\t\treturn slice;\n\t\t\t});\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\treturn this.store.map((slice, i) =>\n\t\t\t\tanimatePathStr(slice, newData.sliceStrings[i])\n\t\t\t);\n\t\t}\n\t},\n\tpercentageBars: {\n\t\tlayerClass: 'percentage-bars',\n\t\tmakeElements(data) {\n\t\t\treturn data.xPositions.map((x, i) =>{\n\t\t\t\tlet y = 0;\n\t\t\t\tlet bar = percentageBar(x, y, data.widths[i],\n\t\t\t\t\tthis.constants.barHeight, this.constants.barDepth, data.colors[i]);\n\t\t\t\treturn bar;\n\t\t\t});\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tif(newData) return [];\n\t\t}\n\t},\n\tyAxis: {\n\t\tlayerClass: 'y axis',\n\t\tmakeElements(data) {\n\t\t\treturn data.positions.map((position, i) =>\n\t\t\t\tyLine(position, data.labels[i], this.constants.width,\n\t\t\t\t\t{mode: this.constants.mode, pos: this.constants.pos, shortenNumbers: this.constants.shortenNumbers})\n\t\t\t);\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tlet newPos = newData.positions;\n\t\t\tlet newLabels = newData.labels;\n\t\t\tlet oldPos = this.oldData.positions;\n\t\t\tlet oldLabels = this.oldData.labels;\n\n\t\t\t[oldPos, newPos] = equilizeNoOfElements(oldPos, newPos);\n\t\t\t[oldLabels, newLabels] = equilizeNoOfElements(oldLabels, newLabels);\n\n\t\t\tthis.render({\n\t\t\t\tpositions: oldPos,\n\t\t\t\tlabels: newLabels\n\t\t\t});\n\n\t\t\treturn this.store.map((line, i) => {\n\t\t\t\treturn translateHoriLine(\n\t\t\t\t\tline, newPos[i], oldPos[i]\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t},\n\n\txAxis: {\n\t\tlayerClass: 'x axis',\n\t\tmakeElements(data) {\n\t\t\treturn data.positions.map((position, i) =>\n\t\t\t\txLine(position, data.calcLabels[i], this.constants.height,\n\t\t\t\t\t{mode: this.constants.mode, pos: this.constants.pos})\n\t\t\t);\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tlet newPos = newData.positions;\n\t\t\tlet newLabels = newData.calcLabels;\n\t\t\tlet oldPos = this.oldData.positions;\n\t\t\tlet oldLabels = this.oldData.calcLabels;\n\n\t\t\t[oldPos, newPos] = equilizeNoOfElements(oldPos, newPos);\n\t\t\t[oldLabels, newLabels] = equilizeNoOfElements(oldLabels, newLabels);\n\n\t\t\tthis.render({\n\t\t\t\tpositions: oldPos,\n\t\t\t\tcalcLabels: newLabels\n\t\t\t});\n\n\t\t\treturn this.store.map((line, i) => {\n\t\t\t\treturn translateVertLine(\n\t\t\t\t\tline, newPos[i], oldPos[i]\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t},\n\n\tyMarkers: {\n\t\tlayerClass: 'y-markers',\n\t\tmakeElements(data) {\n\t\t\treturn data.map(m =>\n\t\t\t\tyMarker(m.position, m.label, this.constants.width,\n\t\t\t\t\t{labelPos: m.options.labelPos, mode: 'span', lineType: 'dashed'})\n\t\t\t);\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\t[this.oldData, newData] = equilizeNoOfElements(this.oldData, newData);\n\n\t\t\tlet newPos = newData.map(d => d.position);\n\t\t\tlet newLabels = newData.map(d => d.label);\n\t\t\tlet newOptions = newData.map(d => d.options);\n\n\t\t\tlet oldPos = this.oldData.map(d => d.position);\n\n\t\t\tthis.render(oldPos.map((pos, i) => {\n\t\t\t\treturn {\n\t\t\t\t\tposition: oldPos[i],\n\t\t\t\t\tlabel: newLabels[i],\n\t\t\t\t\toptions: newOptions[i]\n\t\t\t\t};\n\t\t\t}));\n\n\t\t\treturn this.store.map((line, i) => {\n\t\t\t\treturn translateHoriLine(\n\t\t\t\t\tline, newPos[i], oldPos[i]\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t},\n\n\tyRegions: {\n\t\tlayerClass: 'y-regions',\n\t\tmakeElements(data) {\n\t\t\treturn data.map(r =>\n\t\t\t\tyRegion(r.startPos, r.endPos, this.constants.width,\n\t\t\t\t\tr.label, {labelPos: r.options.labelPos})\n\t\t\t);\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\t[this.oldData, newData] = equilizeNoOfElements(this.oldData, newData);\n\n\t\t\tlet newPos = newData.map(d => d.endPos);\n\t\t\tlet newLabels = newData.map(d => d.label);\n\t\t\tlet newStarts = newData.map(d => d.startPos);\n\t\t\tlet newOptions = newData.map(d => d.options);\n\n\t\t\tlet oldPos = this.oldData.map(d => d.endPos);\n\t\t\tlet oldStarts = this.oldData.map(d => d.startPos);\n\n\t\t\tthis.render(oldPos.map((pos, i) => {\n\t\t\t\treturn {\n\t\t\t\t\tstartPos: oldStarts[i],\n\t\t\t\t\tendPos: oldPos[i],\n\t\t\t\t\tlabel: newLabels[i],\n\t\t\t\t\toptions: newOptions[i]\n\t\t\t\t};\n\t\t\t}));\n\n\t\t\tlet animateElements = [];\n\n\t\t\tthis.store.map((rectGroup, i) => {\n\t\t\t\tanimateElements = animateElements.concat(animateRegion(\n\t\t\t\t\trectGroup, newStarts[i], newPos[i], oldPos[i]\n\t\t\t\t));\n\t\t\t});\n\n\t\t\treturn animateElements;\n\t\t}\n\t},\n\n\theatDomain: {\n\t\tlayerClass: function() { return 'heat-domain domain-' + this.constants.index; },\n\t\tmakeElements(data) {\n\t\t\tlet {index, colWidth, rowHeight, squareSize, radius, xTranslate} = this.constants;\n\t\t\tlet monthNameHeight = -12;\n\t\t\tlet x = xTranslate, y = 0;\n\n\t\t\tthis.serializedSubDomains = [];\n\n\t\t\tdata.cols.map((week, weekNo) => {\n\t\t\t\tif(weekNo === 1) {\n\t\t\t\t\tthis.labels.push(\n\t\t\t\t\t\tmakeText('domain-name', x, monthNameHeight, getMonthName(index, true).toUpperCase(),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfontSize: 9\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tweek.map((day, i) => {\n\t\t\t\t\tif(day.fill) {\n\t\t\t\t\t\tlet data = {\n\t\t\t\t\t\t\t'data-date': day.yyyyMmDd,\n\t\t\t\t\t\t\t'data-value': day.dataValue,\n\t\t\t\t\t\t\t'data-day': i\n\t\t\t\t\t\t};\n\t\t\t\t\t\tlet square = heatSquare('day', x, y, squareSize, radius, day.fill, data);\n\t\t\t\t\t\tthis.serializedSubDomains.push(square);\n\t\t\t\t\t}\n\t\t\t\t\ty += rowHeight;\n\t\t\t\t});\n\t\t\t\ty = 0;\n\t\t\t\tx += colWidth;\n\t\t\t});\n\n\t\t\treturn this.serializedSubDomains;\n\t\t},\n\n\t\tanimateElements(newData) {\n\t\t\tif(newData) return [];\n\t\t}\n\t},\n\n\tbarGraph: {\n\t\tlayerClass: function() { return 'dataset-units dataset-bars dataset-' + this.constants.index; },\n\t\tmakeElements(data) {\n\t\t\tlet c = this.constants;\n\t\t\tthis.unitType = 'bar';\n\t\t\tthis.units = data.yPositions.map((y, j) => {\n\t\t\t\treturn datasetBar(\n\t\t\t\t\tdata.xPositions[j],\n\t\t\t\t\ty,\n\t\t\t\t\tdata.barWidth,\n\t\t\t\t\tc.color,\n\t\t\t\t\tdata.labels[j],\n\t\t\t\t\tj,\n\t\t\t\t\tdata.offsets[j],\n\t\t\t\t\t{\n\t\t\t\t\t\tzeroLine: data.zeroLine,\n\t\t\t\t\t\tbarsWidth: data.barsWidth,\n\t\t\t\t\t\tminHeight: c.minHeight\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t\treturn this.units;\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\tlet newXPos = newData.xPositions;\n\t\t\tlet newYPos = newData.yPositions;\n\t\t\tlet newOffsets = newData.offsets;\n\t\t\tlet newLabels = newData.labels;\n\n\t\t\tlet oldXPos = this.oldData.xPositions;\n\t\t\tlet oldYPos = this.oldData.yPositions;\n\t\t\tlet oldOffsets = this.oldData.offsets;\n\t\t\tlet oldLabels = this.oldData.labels;\n\n\t\t\t[oldXPos, newXPos] = equilizeNoOfElements(oldXPos, newXPos);\n\t\t\t[oldYPos, newYPos] = equilizeNoOfElements(oldYPos, newYPos);\n\t\t\t[oldOffsets, newOffsets] = equilizeNoOfElements(oldOffsets, newOffsets);\n\t\t\t[oldLabels, newLabels] = equilizeNoOfElements(oldLabels, newLabels);\n\n\t\t\tthis.render({\n\t\t\t\txPositions: oldXPos,\n\t\t\t\tyPositions: oldYPos,\n\t\t\t\toffsets: oldOffsets,\n\t\t\t\tlabels: newLabels,\n\n\t\t\t\tzeroLine: this.oldData.zeroLine,\n\t\t\t\tbarsWidth: this.oldData.barsWidth,\n\t\t\t\tbarWidth: this.oldData.barWidth,\n\t\t\t});\n\n\t\t\tlet animateElements = [];\n\n\t\t\tthis.store.map((bar, i) => {\n\t\t\t\tanimateElements = animateElements.concat(animateBar(\n\t\t\t\t\tbar, newXPos[i], newYPos[i], newData.barWidth, newOffsets[i],\n\t\t\t\t\t{zeroLine: newData.zeroLine}\n\t\t\t\t));\n\t\t\t});\n\n\t\t\treturn animateElements;\n\t\t}\n\t},\n\n\tlineGraph: {\n\t\tlayerClass: function() { return 'dataset-units dataset-line dataset-' + this.constants.index; },\n\t\tmakeElements(data) {\n\t\t\tlet c = this.constants;\n\t\t\tthis.unitType = 'dot';\n\t\t\tthis.paths = {};\n\t\t\tif(!c.hideLine) {\n\t\t\t\tthis.paths = getPaths(\n\t\t\t\t\tdata.xPositions,\n\t\t\t\t\tdata.yPositions,\n\t\t\t\t\tc.color,\n\t\t\t\t\t{\n\t\t\t\t\t\theatline: c.heatline,\n\t\t\t\t\t\tregionFill: c.regionFill,\n\t\t\t\t\t\tspline: c.spline\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tsvgDefs: c.svgDefs,\n\t\t\t\t\t\tzeroLine: data.zeroLine\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.units = [];\n\t\t\tif(!c.hideDots) {\n\t\t\t\tthis.units = data.yPositions.map((y, j) => {\n\t\t\t\t\treturn datasetDot(\n\t\t\t\t\t\tdata.xPositions[j],\n\t\t\t\t\t\ty,\n\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\tc.color,\n\t\t\t\t\t\t(c.valuesOverPoints ? data.values[j] : ''),\n\t\t\t\t\t\tj\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn Object.values(this.paths).concat(this.units);\n\t\t},\n\t\tanimateElements(newData) {\n\t\t\tlet newXPos = newData.xPositions;\n\t\t\tlet newYPos = newData.yPositions;\n\t\t\tlet newValues = newData.values;\n\n\t\t\tlet oldXPos = this.oldData.xPositions;\n\t\t\tlet oldYPos = this.oldData.yPositions;\n\t\t\tlet oldValues = this.oldData.values;\n\n\t\t\t[oldXPos, newXPos] = equilizeNoOfElements(oldXPos, newXPos);\n\t\t\t[oldYPos, newYPos] = equilizeNoOfElements(oldYPos, newYPos);\n\t\t\t[oldValues, newValues] = equilizeNoOfElements(oldValues, newValues);\n\n\t\t\tthis.render({\n\t\t\t\txPositions: oldXPos,\n\t\t\t\tyPositions: oldYPos,\n\t\t\t\tvalues: newValues,\n\n\t\t\t\tzeroLine: this.oldData.zeroLine,\n\t\t\t\tradius: this.oldData.radius,\n\t\t\t});\n\n\t\t\tlet animateElements = [];\n\n\t\t\tif(Object.keys(this.paths).length) {\n\t\t\t\tanimateElements = animateElements.concat(animatePath(\n\t\t\t\t\tthis.paths, newXPos, newYPos, newData.zeroLine, this.constants.spline));\n\t\t\t}\n\n\t\t\tif(this.units.length) {\n\t\t\t\tthis.units.map((dot, i) => {\n\t\t\t\t\tanimateElements = animateElements.concat(animateDot(\n\t\t\t\t\t\tdot, newXPos[i], newYPos[i]));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn animateElements;\n\t\t}\n\t}\n};\n\nexport function getComponent(name, constants, getData) {\n\tlet keys = Object.keys(componentConfigs).filter(k => name.includes(k));\n\tlet config = componentConfigs[keys[0]];\n\tObject.assign(config, {\n\t\tconstants: constants,\n\t\tgetData: getData\n\t});\n\treturn new ChartComponent(config);\n}\n","import { floatTwo } from './helpers';\n\nfunction normalize(x) {\n\t// Calculates mantissa and exponent of a number\n\t// Returns normalized number and exponent\n\t// https://stackoverflow.com/q/9383593/6495043\n\n\tif(x===0) {\n\t\treturn [0, 0];\n\t}\n\tif(isNaN(x)) {\n\t\treturn {mantissa: -6755399441055744, exponent: 972};\n\t}\n\tvar sig = x > 0 ? 1 : -1;\n\tif(!isFinite(x)) {\n\t\treturn {mantissa: sig * 4503599627370496, exponent: 972};\n\t}\n\n\tx = Math.abs(x);\n\tvar exp = Math.floor(Math.log10(x));\n\tvar man = x/Math.pow(10, exp);\n\n\treturn [sig * man, exp];\n}\n\nfunction getChartRangeIntervals(max, min=0) {\n\tlet upperBound = Math.ceil(max);\n\tlet lowerBound = Math.floor(min);\n\tlet range = upperBound - lowerBound;\n\n\tlet noOfParts = range;\n\tlet partSize = 1;\n\n\t// To avoid too many partitions\n\tif(range > 5) {\n\t\tif(range % 2 !== 0) {\n\t\t\tupperBound++;\n\t\t\t// Recalc range\n\t\t\trange = upperBound - lowerBound;\n\t\t}\n\t\tnoOfParts = range/2;\n\t\tpartSize = 2;\n\t}\n\n\t// Special case: 1 and 2\n\tif(range <= 2) {\n\t\tnoOfParts = 4;\n\t\tpartSize = range/noOfParts;\n\t}\n\n\t// Special case: 0\n\tif(range === 0) {\n\t\tnoOfParts = 5;\n\t\tpartSize = 1;\n\t}\n\n\tlet intervals = [];\n\tfor(var i = 0; i <= noOfParts; i++){\n\t\tintervals.push(lowerBound + partSize * i);\n\t}\n\treturn intervals;\n}\n\nfunction getChartIntervals(maxValue, minValue=0) {\n\tlet [normalMaxValue, exponent] = normalize(maxValue);\n\tlet normalMinValue = minValue ? minValue/Math.pow(10, exponent): 0;\n\n\t// Allow only 7 significant digits\n\tnormalMaxValue = normalMaxValue.toFixed(6);\n\n\tlet intervals = getChartRangeIntervals(normalMaxValue, normalMinValue);\n\tintervals = intervals.map(value => value * Math.pow(10, exponent));\n\treturn intervals;\n}\n\nexport function calcChartIntervals(values, withMinimum=false) {\n\t//*** Where the magic happens ***\n\n\t// Calculates best-fit y intervals from given values\n\t// and returns the interval array\n\n\tlet maxValue = Math.max(...values);\n\tlet minValue = Math.min(...values);\n\n\t// Exponent to be used for pretty print\n\tlet exponent = 0, intervals = []; // eslint-disable-line no-unused-vars\n\n\tfunction getPositiveFirstIntervals(maxValue, absMinValue) {\n\t\tlet intervals = getChartIntervals(maxValue);\n\n\t\tlet intervalSize = intervals[1] - intervals[0];\n\n\t\t// Then unshift the negative values\n\t\tlet value = 0;\n\t\tfor(var i = 1; value < absMinValue; i++) {\n\t\t\tvalue += intervalSize;\n\t\t\tintervals.unshift((-1) * value);\n\t\t}\n\t\treturn intervals;\n\t}\n\n\t// CASE I: Both non-negative\n\n\tif(maxValue >= 0 && minValue >= 0) {\n\t\texponent = normalize(maxValue)[1];\n\t\tif(!withMinimum) {\n\t\t\tintervals = getChartIntervals(maxValue);\n\t\t} else {\n\t\t\tintervals = getChartIntervals(maxValue, minValue);\n\t\t}\n\t}\n\n\t// CASE II: Only minValue negative\n\n\telse if(maxValue > 0 && minValue < 0) {\n\t\t// `withMinimum` irrelevant in this case,\n\t\t// We'll be handling both sides of zero separately\n\t\t// (both starting from zero)\n\t\t// Because ceil() and floor() behave differently\n\t\t// in those two regions\n\n\t\tlet absMinValue = Math.abs(minValue);\n\n\t\tif(maxValue >= absMinValue) {\n\t\t\texponent = normalize(maxValue)[1];\n\t\t\tintervals = getPositiveFirstIntervals(maxValue, absMinValue);\n\t\t} else {\n\t\t\t// Mirror: maxValue => absMinValue, then change sign\n\t\t\texponent = normalize(absMinValue)[1];\n\t\t\tlet posIntervals = getPositiveFirstIntervals(absMinValue, maxValue);\n\t\t\tintervals = posIntervals.reverse().map(d => d * (-1));\n\t\t}\n\n\t}\n\n\t// CASE III: Both non-positive\n\n\telse if(maxValue <= 0 && minValue <= 0) {\n\t\t// Mirrored Case I:\n\t\t// Work with positives, then reverse the sign and array\n\n\t\tlet pseudoMaxValue = Math.abs(minValue);\n\t\tlet pseudoMinValue = Math.abs(maxValue);\n\n\t\texponent = normalize(pseudoMaxValue)[1];\n\t\tif(!withMinimum) {\n\t\t\tintervals = getChartIntervals(pseudoMaxValue);\n\t\t} else {\n\t\t\tintervals = getChartIntervals(pseudoMaxValue, pseudoMinValue);\n\t\t}\n\n\t\tintervals = intervals.reverse().map(d => d * (-1));\n\t}\n\n\treturn intervals;\n}\n\nexport function getZeroIndex(yPts) {\n\tlet zeroIndex;\n\tlet interval = getIntervalSize(yPts);\n\tif(yPts.indexOf(0) >= 0) {\n\t\t// the range has a given zero\n\t\t// zero-line on the chart\n\t\tzeroIndex = yPts.indexOf(0);\n\t} else if(yPts[0] > 0) {\n\t\t// Minimum value is positive\n\t\t// zero-line is off the chart: below\n\t\tlet min = yPts[0];\n\t\tzeroIndex = (-1) * min / interval;\n\t} else {\n\t\t// Maximum value is negative\n\t\t// zero-line is off the chart: above\n\t\tlet max = yPts[yPts.length - 1];\n\t\tzeroIndex = (-1) * max / interval + (yPts.length - 1);\n\t}\n\treturn zeroIndex;\n}\n\nexport function getRealIntervals(max, noOfIntervals, min = 0, asc = 1) {\n\tlet range = max - min;\n\tlet part = range * 1.0 / noOfIntervals;\n\tlet intervals = [];\n\n\tfor(var i = 0; i <= noOfIntervals; i++) {\n\t\tintervals.push(min + part * i);\n\t}\n\n\treturn asc ? intervals : intervals.reverse();\n}\n\nexport function getIntervalSize(orderedArray) {\n\treturn orderedArray[1] - orderedArray[0];\n}\n\nexport function getValueRange(orderedArray) {\n\treturn orderedArray[orderedArray.length-1] - orderedArray[0];\n}\n\nexport function scale(val, yAxis) {\n\treturn floatTwo(yAxis.zeroLine - val * yAxis.scaleMultiplier);\n}\n\nexport function isInRange(val, min, max) {\n\treturn val > min && val < max;\n}\n\nexport function isInRange2D(coord, minCoord, maxCoord) {\n\treturn isInRange(coord[0], minCoord[0], maxCoord[0])\n\t\t&& isInRange(coord[1], minCoord[1], maxCoord[1]);\n}\n\nexport function getClosestInArray(goal, arr, index = false) {\n\tlet closest = arr.reduce(function(prev, curr) {\n\t\treturn (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev);\n\t}, []);\n\n\treturn index ? arr.indexOf(closest) : closest;\n}\n\nexport function calcDistribution(values, distributionSize) {\n\t// Assume non-negative values,\n\t// implying distribution minimum at zero\n\n\tlet dataMaxValue = Math.max(...values);\n\n\tlet distributionStep = 1 / (distributionSize - 1);\n\tlet distribution = [];\n\n\tfor(var i = 0; i < distributionSize; i++) {\n\t\tlet checkpoint = dataMaxValue * (distributionStep * i);\n\t\tdistribution.push(checkpoint);\n\t}\n\n\treturn distribution;\n}\n\nexport function getMaxCheckpoint(value, distribution) {\n\treturn distribution.filter(d => d < value).length;\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { $ } from '../utils/dom';\nimport { TOOLTIP_POINTER_TRIANGLE_HEIGHT } from '../utils/constants';\n\nexport default class SvgTip {\n\tconstructor({\n\t\tparent = null,\n\t\tcolors = []\n\t}) {\n\t\tthis.parent = parent;\n\t\tthis.colors = colors;\n\t\tthis.titleName = '';\n\t\tthis.titleValue = '';\n\t\tthis.listValues = [];\n\t\tthis.titleValueFirst = 0;\n\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\n\t\tthis.top = 0;\n\t\tthis.left = 0;\n\n\t\tthis.setup();\n\t}\n\n\tsetup() {\n\t\tthis.makeTooltip();\n\t}\n\n\trefresh() {\n\t\tthis.fill();\n\t\tthis.calcPosition();\n\t}\n\n\tmakeTooltip() {\n\t\tthis.container = $.create('div', {\n\t\t\tinside: this.parent,\n\t\t\tclassName: 'graph-svg-tip comparison',\n\t\t\tinnerHTML: `\n\t\t\t\t
          \n\t\t\t\t
          `\n\t\t});\n\t\tthis.hideTip();\n\n\t\tthis.title = this.container.querySelector('.title');\n\t\tthis.dataPointList = this.container.querySelector('.data-point-list');\n\n\t\tthis.parent.addEventListener('mouseleave', () => {\n\t\t\tthis.hideTip();\n\t\t});\n\t}\n\n\tfill() {\n\t\tlet title;\n\t\tif(this.index) {\n\t\t\tthis.container.setAttribute('data-point-index', this.index);\n\t\t}\n\t\tif(this.titleValueFirst) {\n\t\t\ttitle = `${this.titleValue}${this.titleName}`;\n\t\t} else {\n\t\t\ttitle = `${this.titleName}${this.titleValue}`;\n\t\t}\n\t\tthis.title.innerHTML = title;\n\t\tthis.dataPointList.innerHTML = '';\n\n\t\tthis.listValues.map((set, i) => {\n\t\t\tconst color = this.colors[i] || 'black';\n\t\t\tlet value = set.formatted === 0 || set.formatted ? set.formatted : set.value;\n\n\t\t\tlet li = $.create('li', {\n\t\t\t\tstyles: {\n\t\t\t\t\t'border-top': `3px solid ${color}`\n\t\t\t\t},\n\t\t\t\tinnerHTML: `${ value === 0 || value ? value : '' }\n\t\t\t\t\t${set.title ? set.title : '' }`\n\t\t\t});\n\n\t\t\tthis.dataPointList.appendChild(li);\n\t\t});\n\t}\n\n\tcalcPosition() {\n\t\tlet width = this.container.offsetWidth;\n\n\t\tthis.top = this.y - this.container.offsetHeight\n\t\t\t- TOOLTIP_POINTER_TRIANGLE_HEIGHT;\n\t\tthis.left = this.x - width/2;\n\t\tlet maxLeft = this.parent.offsetWidth - width;\n\n\t\tlet pointer = this.container.querySelector('.svg-pointer');\n\n\t\tif(this.left < 0) {\n\t\t\tpointer.style.left = `calc(50% - ${-1 * this.left}px)`;\n\t\t\tthis.left = 0;\n\t\t} else if(this.left > maxLeft) {\n\t\t\tlet delta = this.left - maxLeft;\n\t\t\tlet pointerOffset = `calc(50% + ${delta}px)`;\n\t\t\tpointer.style.left = pointerOffset;\n\n\t\t\tthis.left = maxLeft;\n\t\t} else {\n\t\t\tpointer.style.left = `50%`;\n\t\t}\n\t}\n\n\tsetValues(x, y, title = {}, listValues = [], index = -1) {\n\t\tthis.titleName = title.name;\n\t\tthis.titleValue = title.value;\n\t\tthis.listValues = listValues;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.titleValueFirst = title.valueFirst || 0;\n\t\tthis.index = index;\n\t\tthis.refresh();\n\t}\n\n\thideTip() {\n\t\tthis.container.style.top = '0px';\n\t\tthis.container.style.left = '0px';\n\t\tthis.container.style.opacity = '0';\n\t}\n\n\tshowTip() {\n\t\tthis.container.style.top = this.top + 'px';\n\t\tthis.container.style.left = this.left + 'px';\n\t\tthis.container.style.opacity = '1';\n\t}\n}\n","export const CSSTEXT = \".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}\";","import SvgTip from '../objects/SvgTip';\nimport { $, isElementInViewport, getElementContentWidth, isHidden } from '../utils/dom';\nimport { makeSVGContainer, makeSVGDefs, makeSVGGroup, makeText } from '../utils/draw';\nimport { BASE_MEASURES, getExtraHeight, getExtraWidth, getTopOffset, getLeftOffset,\n\tINIT_CHART_UPDATE_TIMEOUT, CHART_POST_ANIMATE_TIMEOUT, DEFAULT_COLORS} from '../utils/constants';\nimport { getColor, isValidColor } from '../utils/colors';\nimport { runSMILAnimation } from '../utils/animation';\nimport { downloadFile, prepareForExport } from '../utils/export';\nimport { deepClone } from '../utils/helpers';\n\nexport default class BaseChart {\n\tconstructor(parent, options) {\n\t\t// deepclone options to avoid making changes to orignal object\n\t\toptions = deepClone(options);\n\n\t\tthis.parent = typeof parent === 'string'\n\t\t\t? document.querySelector(parent)\n\t\t\t: parent;\n\n\t\tif (!(this.parent instanceof HTMLElement)) {\n\t\t\tthrow new Error('No `parent` element to render on was provided.');\n\t\t}\n\n\t\tthis.rawChartArgs = options;\n\n\t\tthis.title = options.title || '';\n\t\tthis.type = options.type || '';\n\n\t\tthis.realData = this.prepareData(options.data);\n\t\tthis.data = this.prepareFirstData(this.realData);\n\n\t\tthis.colors = this.validateColors(options.colors, this.type);\n\n\t\tthis.config = {\n\t\t\tshowTooltip: 1, // calculate\n\t\t\tshowLegend: 1, // calculate\n\t\t\tisNavigable: options.isNavigable || 0,\n\t\t\tanimate: (typeof options.animate !== 'undefined') ? options.animate : 1,\n\t\t\ttruncateLegends: options.truncateLegends || 1\n\t\t};\n\n\t\tthis.measures = JSON.parse(JSON.stringify(BASE_MEASURES));\n\t\tlet m = this.measures;\n\t\tthis.setMeasures(options);\n\t\tif(!this.title.length) { m.titleHeight = 0; }\n\t\tif(!this.config.showLegend) m.legendHeight = 0;\n\t\tthis.argHeight = options.height || m.baseHeight;\n\n\t\tthis.state = {};\n\t\tthis.options = {};\n\n\t\tthis.initTimeout = INIT_CHART_UPDATE_TIMEOUT;\n\n\t\tif(this.config.isNavigable) {\n\t\t\tthis.overlays = [];\n\t\t}\n\n\t\tthis.configure(options);\n\t}\n\n\tprepareData(data) {\n\t\treturn data;\n\t}\n\n\tprepareFirstData(data) {\n\t\treturn data;\n\t}\n\n\tvalidateColors(colors, type) {\n\t\tconst validColors = [];\n\t\tcolors = (colors || []).concat(DEFAULT_COLORS[type]);\n\t\tcolors.forEach((string) => {\n\t\t\tconst color = getColor(string);\n\t\t\tif(!isValidColor(color)) {\n\t\t\t\tconsole.warn('\"' + string + '\" is not a valid color.');\n\t\t\t} else {\n\t\t\t\tvalidColors.push(color);\n\t\t\t}\n\t\t});\n\t\treturn validColors;\n\t}\n\n\tsetMeasures() {\n\t\t// Override measures, including those for title and legend\n\t\t// set config for legend and title\n\t}\n\n\tconfigure() {\n\t\tlet height = this.argHeight;\n\t\tthis.baseHeight = height;\n\t\tthis.height = height - getExtraHeight(this.measures);\n\n\t\t// Bind window events\n\t\tthis.boundDrawFn = () => this.draw(true);\n\t\tif (ResizeObserver) {\n\t\t\tthis.resizeObserver = new ResizeObserver(this.boundDrawFn);\n\t\t\tthis.resizeObserver.observe(this.parent);\n\t\t}\n\t\twindow.addEventListener('resize', this.boundDrawFn);\n\t\twindow.addEventListener('orientationchange', this.boundDrawFn);\n\t}\n\n\tdestroy() {\n\t\tif (this.resizeObserver) this.resizeObserver.disconnect();\n\t\twindow.removeEventListener('resize', this.boundDrawFn);\n\t\twindow.removeEventListener('orientationchange', this.boundDrawFn);\n\t}\n\n\t// Has to be called manually\n\tsetup() {\n\t\tthis.makeContainer();\n\t\tthis.updateWidth();\n\t\tthis.makeTooltip();\n\n\t\tthis.draw(false, true);\n\t}\n\n\tmakeContainer() {\n\t\t// Chart needs a dedicated parent element\n\t\tthis.parent.innerHTML = '';\n\n\t\tlet args = {\n\t\t\tinside: this.parent,\n\t\t\tclassName: 'chart-container'\n\t\t};\n\n\t\tif(this.independentWidth) {\n\t\t\targs.styles = { width: this.independentWidth + 'px' };\n\t\t}\n\n\t\tthis.container = $.create('div', args);\n\t}\n\n\tmakeTooltip() {\n\t\tthis.tip = new SvgTip({\n\t\t\tparent: this.container,\n\t\t\tcolors: this.colors\n\t\t});\n\t\tthis.bindTooltip();\n\t}\n\n\tbindTooltip() {}\n\n\tdraw(onlyWidthChange=false, init=false) {\n\t\tif (onlyWidthChange && isHidden(this.parent)) {\n\t\t\t// Don't update anything if the chart is hidden\n\t\t\treturn;\n\t\t}\n\t\tthis.updateWidth();\n\n\t\tthis.calc(onlyWidthChange);\n\t\tthis.makeChartArea();\n\t\tthis.setupComponents();\n\n\t\tthis.components.forEach(c => c.setup(this.drawArea));\n\t\t// this.components.forEach(c => c.make());\n\t\tthis.render(this.components, false);\n\n\t\tif(init) {\n\t\t\tthis.data = this.realData;\n\t\t\tsetTimeout(() => {this.update(this.data);}, this.initTimeout);\n\t\t}\n\n\t\tthis.renderLegend();\n\n\t\tthis.setupNavigation(init);\n\t}\n\n\tcalc() {} // builds state\n\n\tupdateWidth() {\n\t\tthis.baseWidth = getElementContentWidth(this.parent);\n\t\tthis.width = this.baseWidth - getExtraWidth(this.measures);\n\t}\n\n\tmakeChartArea() {\n\t\tif(this.svg) {\n\t\t\tthis.container.removeChild(this.svg);\n\t\t}\n\t\tlet m = this.measures;\n\n\t\tthis.svg = makeSVGContainer(\n\t\t\tthis.container,\n\t\t\t'frappe-chart chart',\n\t\t\tthis.baseWidth,\n\t\t\tthis.baseHeight\n\t\t);\n\t\tthis.svgDefs = makeSVGDefs(this.svg);\n\n\t\tif(this.title.length) {\n\t\t\tthis.titleEL = makeText(\n\t\t\t\t'title',\n\t\t\t\tm.margins.left,\n\t\t\t\tm.margins.top,\n\t\t\t\tthis.title,\n\t\t\t\t{\n\t\t\t\t\tfontSize: m.titleFontSize,\n\t\t\t\t\tfill: '#666666',\n\t\t\t\t\tdy: m.titleFontSize\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tlet top = getTopOffset(m);\n\t\tthis.drawArea = makeSVGGroup(\n\t\t\tthis.type + '-chart chart-draw-area',\n\t\t\t`translate(${getLeftOffset(m)}, ${top})`\n\t\t);\n\n\t\tif(this.config.showLegend) {\n\t\t\ttop += this.height + m.paddings.bottom;\n\t\t\tthis.legendArea = makeSVGGroup(\n\t\t\t\t'chart-legend',\n\t\t\t\t`translate(${getLeftOffset(m)}, ${top})`\n\t\t\t);\n\t\t}\n\n\t\tif(this.title.length) { this.svg.appendChild(this.titleEL); }\n\t\tthis.svg.appendChild(this.drawArea);\n\t\tif(this.config.showLegend) { this.svg.appendChild(this.legendArea); }\n\n\t\tthis.updateTipOffset(getLeftOffset(m), getTopOffset(m));\n\t}\n\n\tupdateTipOffset(x, y) {\n\t\tthis.tip.offset = {\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\t}\n\n\tsetupComponents() { this.components = new Map(); }\n\n\tupdate(data) {\n\t\tif(!data) {\n\t\t\tconsole.error('No data to update.');\n\t\t}\n\t\tthis.data = this.prepareData(data);\n\t\tthis.calc(); // builds state\n\t\tthis.render(this.components, this.config.animate);\n\t\tthis.renderLegend();\n\t}\n\n\trender(components=this.components, animate=true) {\n\t\tif(this.config.isNavigable) {\n\t\t\t// Remove all existing overlays\n\t\t\tthis.overlays.map(o => o.parentNode.removeChild(o));\n\t\t\t// ref.parentNode.insertBefore(element, ref);\n\t\t}\n\t\tlet elementsToAnimate = [];\n\t\t// Can decouple to this.refreshComponents() first to save animation timeout\n\t\tcomponents.forEach(c => {\n\t\t\telementsToAnimate = elementsToAnimate.concat(c.update(animate));\n\t\t});\n\t\tif(elementsToAnimate.length > 0) {\n\t\t\trunSMILAnimation(this.container, this.svg, elementsToAnimate);\n\t\t\tsetTimeout(() => {\n\t\t\t\tcomponents.forEach(c => c.make());\n\t\t\t\tthis.updateNav();\n\t\t\t}, CHART_POST_ANIMATE_TIMEOUT);\n\t\t} else {\n\t\t\tcomponents.forEach(c => c.make());\n\t\t\tthis.updateNav();\n\t\t}\n\t}\n\n\tupdateNav() {\n\t\tif(this.config.isNavigable) {\n\t\t\tthis.makeOverlay();\n\t\t\tthis.bindUnits();\n\t\t}\n\t}\n\n\trenderLegend() {}\n\n\tsetupNavigation(init=false) {\n\t\tif(!this.config.isNavigable) return;\n\n\t\tif(init) {\n\t\t\tthis.bindOverlay();\n\n\t\t\tthis.keyActions = {\n\t\t\t\t'13': this.onEnterKey.bind(this),\n\t\t\t\t'37': this.onLeftArrow.bind(this),\n\t\t\t\t'38': this.onUpArrow.bind(this),\n\t\t\t\t'39': this.onRightArrow.bind(this),\n\t\t\t\t'40': this.onDownArrow.bind(this),\n\t\t\t};\n\n\t\t\tdocument.addEventListener('keydown', (e) => {\n\t\t\t\tif(isElementInViewport(this.container)) {\n\t\t\t\t\te = e || window.event;\n\t\t\t\t\tif(this.keyActions[e.keyCode]) {\n\t\t\t\t\t\tthis.keyActions[e.keyCode]();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tmakeOverlay() {}\n\tupdateOverlay() {}\n\tbindOverlay() {}\n\tbindUnits() {}\n\n\tonLeftArrow() {}\n\tonRightArrow() {}\n\tonUpArrow() {}\n\tonDownArrow() {}\n\tonEnterKey() {}\n\n\taddDataPoint() {}\n\tremoveDataPoint() {}\n\n\tgetDataPoint() {}\n\tsetCurrentDataPoint() {}\n\n\tupdateDataset() {}\n\n\texport() {\n\t\tlet chartSvg = prepareForExport(this.svg);\n\t\tdownloadFile(this.title || 'Chart', [chartSvg]);\n\t}\n}\n","import BaseChart from './BaseChart';\nimport { truncateString } from '../utils/draw-utils';\nimport { legendDot } from '../utils/draw';\nimport { round } from '../utils/helpers';\nimport { getExtraWidth } from '../utils/constants';\n\nexport default class AggregationChart extends BaseChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t}\n\n\tconfigure(args) {\n\t\tsuper.configure(args);\n\n\t\tthis.config.formatTooltipY = (args.tooltipOptions || {}).formatTooltipY;\n\t\tthis.config.maxSlices = args.maxSlices || 20;\n\t\tthis.config.maxLegendPoints = args.maxLegendPoints || 20;\n\t}\n\n\tcalc() {\n\t\tlet s = this.state;\n\t\tlet maxSlices = this.config.maxSlices;\n\t\ts.sliceTotals = [];\n\n\t\tlet allTotals = this.data.labels.map((label, i) => {\n\t\t\tlet total = 0;\n\t\t\tthis.data.datasets.map(e => {\n\t\t\t\ttotal += e.values[i];\n\t\t\t});\n\t\t\treturn [total, label];\n\t\t}).filter(d => { return d[0] >= 0; }); // keep only positive results\n\n\t\tlet totals = allTotals;\n\t\tif(allTotals.length > maxSlices) {\n\t\t\t// Prune and keep a grey area for rest as per maxSlices\n\t\t\tallTotals.sort((a, b) => { return b[0] - a[0]; });\n\n\t\t\ttotals = allTotals.slice(0, maxSlices-1);\n\t\t\tlet remaining = allTotals.slice(maxSlices-1);\n\n\t\t\tlet sumOfRemaining = 0;\n\t\t\tremaining.map(d => {sumOfRemaining += d[0];});\n\t\t\ttotals.push([sumOfRemaining, 'Rest']);\n\t\t\tthis.colors[maxSlices-1] = 'grey';\n\t\t}\n\n\t\ts.labels = [];\n\t\ttotals.map(d => {\n\t\t\ts.sliceTotals.push(round(d[0]));\n\t\t\ts.labels.push(d[1]);\n\t\t});\n\n\t\ts.grandTotal = s.sliceTotals.reduce((a, b) => a + b, 0);\n\n\t\tthis.center = {\n\t\t\tx: this.width / 2,\n\t\t\ty: this.height / 2\n\t\t};\n\t}\n\n\trenderLegend() {\n\t\tlet s = this.state;\n\t\tthis.legendArea.textContent = '';\n\t\tthis.legendTotals = s.sliceTotals.slice(0, this.config.maxLegendPoints);\n\n\t\tlet count = 0;\n\t\tlet y = 0;\n\t\tthis.legendTotals.map((d, i) => {\n\t\t\tlet barWidth = 150;\n\t\t\tlet divisor = Math.floor(\n\t\t\t\t(this.width - getExtraWidth(this.measures))/barWidth\n\t\t\t);\n\t\t\tif (this.legendTotals.length < divisor) {\n\t\t\t\tbarWidth = this.width/this.legendTotals.length;\n\t\t\t}\n\t\t\tif(count > divisor) {\n\t\t\t\tcount = 0;\n\t\t\t\ty += 20;\n\t\t\t}\n\t\t\tlet x = barWidth * count + 5;\n\t\t\tlet label = this.config.truncateLegends ? truncateString(s.labels[i], barWidth/10) : s.labels[i];\n\t\t\tlet formatted = this.config.formatTooltipY ? this.config.formatTooltipY(d) : d;\n\t\t\tlet dot = legendDot(\n\t\t\t\tx,\n\t\t\t\ty,\n\t\t\t\t5,\n\t\t\t\tthis.colors[i],\n\t\t\t\t`${label}: ${formatted}`,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tthis.legendArea.appendChild(dot);\n\t\t\tcount++;\n\t\t});\n\t}\n}\n","import AggregationChart from './AggregationChart';\nimport { getOffset } from '../utils/dom';\nimport { getComponent } from '../objects/ChartComponents';\nimport { PERCENTAGE_BAR_DEFAULT_HEIGHT, PERCENTAGE_BAR_DEFAULT_DEPTH } from '../utils/constants';\n\nexport default class PercentageChart extends AggregationChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t\tthis.type = 'percentage';\n\t\tthis.setup();\n\t}\n\n\tsetMeasures(options) {\n\t\tlet m = this.measures;\n\t\tthis.barOptions = options.barOptions || {};\n\n\t\tlet b = this.barOptions;\n\t\tb.height = b.height || PERCENTAGE_BAR_DEFAULT_HEIGHT;\n\t\tb.depth = b.depth || PERCENTAGE_BAR_DEFAULT_DEPTH;\n\n\t\tm.paddings.right = 30;\n\t\tm.legendHeight = 60;\n\t\tm.baseHeight = (b.height + b.depth * 0.5) * 8;\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'percentageBars',\n\t\t\t\t{\n\t\t\t\t\tbarHeight: this.barOptions.height,\n\t\t\t\t\tbarDepth: this.barOptions.depth,\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\txPositions: s.xPositions,\n\t\t\t\t\t\twidths: s.widths,\n\t\t\t\t\t\tcolors: this.colors\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tcalc() {\n\t\tsuper.calc();\n\t\tlet s = this.state;\n\n\t\ts.xPositions = [];\n\t\ts.widths = [];\n\n\t\tlet xPos = 0;\n\t\ts.sliceTotals.map((value) => {\n\t\t\tlet width = this.width * value / s.grandTotal;\n\t\t\ts.widths.push(width);\n\t\t\ts.xPositions.push(xPos);\n\t\t\txPos += width;\n\t\t});\n\t}\n\n\tmakeDataByIndex() { }\n\n\tbindTooltip() {\n\t\tlet s = this.state;\n\t\tthis.container.addEventListener('mousemove', (e) => {\n\t\t\tlet bars = this.components.get('percentageBars').store;\n\t\t\tlet bar = e.target;\n\t\t\tif(bars.includes(bar)) {\n\n\t\t\t\tlet i = bars.indexOf(bar);\n\t\t\t\tlet gOff = getOffset(this.container), pOff = getOffset(bar);\n\n\t\t\t\tlet x = pOff.left - gOff.left + parseInt(bar.getAttribute('width'))/2;\n\t\t\t\tlet y = pOff.top - gOff.top;\n\t\t\t\tlet title = (this.formattedLabels && this.formattedLabels.length>0\n\t\t\t\t\t? this.formattedLabels[i] : this.state.labels[i]) + ': ';\n\t\t\t\tlet fraction = s.sliceTotals[i]/s.grandTotal;\n\n\t\t\t\tthis.tip.setValues(x, y, {name: title, value: (fraction*100).toFixed(1) + \"%\"});\n\t\t\t\tthis.tip.showTip();\n\t\t\t}\n\t\t});\n\t}\n}\n","import AggregationChart from './AggregationChart';\nimport { getComponent } from '../objects/ChartComponents';\nimport { getOffset } from '../utils/dom';\nimport { getPositionByAngle } from '../utils/helpers';\nimport { makeArcPathStr, makeCircleStr } from '../utils/draw';\nimport { lightenDarkenColor } from '../utils/colors';\nimport { transform } from '../utils/animation';\nimport { FULL_ANGLE } from '../utils/constants';\n\nexport default class PieChart extends AggregationChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t\tthis.type = 'pie';\n\t\tthis.initTimeout = 0;\n\t\tthis.init = 1;\n\n\t\tthis.setup();\n\t}\n\n\tconfigure(args) {\n\t\tsuper.configure(args);\n\t\tthis.mouseMove = this.mouseMove.bind(this);\n\t\tthis.mouseLeave = this.mouseLeave.bind(this);\n\n\t\tthis.hoverRadio = args.hoverRadio || 0.1;\n\t\tthis.config.startAngle = args.startAngle || 0;\n\n\t\tthis.clockWise = args.clockWise || false;\n\t}\n\n\tcalc() {\n\t\tsuper.calc();\n\t\tlet s = this.state;\n\t\tthis.radius = (this.height > this.width ? this.center.x : this.center.y);\n\n\t\tconst { radius, clockWise } = this;\n\n\t\tconst prevSlicesProperties = s.slicesProperties || [];\n\t\ts.sliceStrings = [];\n\t\ts.slicesProperties = [];\n\t\tlet curAngle = 180 - this.config.startAngle;\n\t\ts.sliceTotals.map((total, i) => {\n\t\t\tconst startAngle = curAngle;\n\t\t\tconst originDiffAngle = (total / s.grandTotal) * FULL_ANGLE;\n\t\t\tconst largeArc = originDiffAngle > 180 ? 1: 0;\n\t\t\tconst diffAngle = clockWise ? -originDiffAngle : originDiffAngle;\n\t\t\tconst endAngle = curAngle = curAngle + diffAngle;\n\t\t\tconst startPosition = getPositionByAngle(startAngle, radius);\n\t\t\tconst endPosition = getPositionByAngle(endAngle, radius);\n\n\t\t\tconst prevProperty = this.init && prevSlicesProperties[i];\n\n\t\t\tlet curStart,curEnd;\n\t\t\tif(this.init) {\n\t\t\t\tcurStart = prevProperty ? prevProperty.startPosition : startPosition;\n\t\t\t\tcurEnd = prevProperty ? prevProperty.endPosition : startPosition;\n\t\t\t} else {\n\t\t\t\tcurStart = startPosition;\n\t\t\t\tcurEnd = endPosition;\n\t\t\t}\n\t\t\tconst curPath =\n\t\t\t\toriginDiffAngle === 360\n\t\t\t\t\t? makeCircleStr(curStart, curEnd, this.center, this.radius, clockWise, largeArc)\n\t\t\t\t\t: makeArcPathStr(curStart, curEnd, this.center, this.radius, clockWise, largeArc);\n\n\t\t\ts.sliceStrings.push(curPath);\n\t\t\ts.slicesProperties.push({\n\t\t\t\tstartPosition,\n\t\t\t\tendPosition,\n\t\t\t\tvalue: total,\n\t\t\t\ttotal: s.grandTotal,\n\t\t\t\tstartAngle,\n\t\t\t\tendAngle,\n\t\t\t\tangle: diffAngle\n\t\t\t});\n\n\t\t});\n\t\tthis.init = 0;\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'pieSlices',\n\t\t\t\t{ },\n\t\t\t\tfunction() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsliceStrings: s.sliceStrings,\n\t\t\t\t\t\tcolors: this.colors\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tcalTranslateByAngle(property){\n\t\tconst{radius,hoverRadio} = this;\n\t\tconst position = getPositionByAngle(property.startAngle+(property.angle / 2),radius);\n\t\treturn `translate3d(${(position.x) * hoverRadio}px,${(position.y) * hoverRadio}px,0)`;\n\t}\n\n\thoverSlice(path,i,flag,e){\n\t\tif(!path) return;\n\t\tconst color = this.colors[i];\n\t\tif(flag) {\n\t\t\ttransform(path, this.calTranslateByAngle(this.state.slicesProperties[i]));\n\t\t\tpath.style.fill = lightenDarkenColor(color, 50);\n\t\t\tlet g_off = getOffset(this.svg);\n\t\t\tlet x = e.pageX - g_off.left + 10;\n\t\t\tlet y = e.pageY - g_off.top - 10;\n\t\t\tlet title = (this.formatted_labels && this.formatted_labels.length > 0\n\t\t\t\t? this.formatted_labels[i] : this.state.labels[i]) + ': ';\n\t\t\tlet percent = (this.state.sliceTotals[i] * 100 / this.state.grandTotal).toFixed(1);\n\t\t\tthis.tip.setValues(x, y, {name: title, value: percent + \"%\"});\n\t\t\tthis.tip.showTip();\n\t\t} else {\n\t\t\ttransform(path,'translate3d(0,0,0)');\n\t\t\tthis.tip.hideTip();\n\t\t\tpath.style.fill = color;\n\t\t}\n\t}\n\n\tbindTooltip() {\n\t\tthis.container.addEventListener('mousemove', this.mouseMove);\n\t\tthis.container.addEventListener('mouseleave', this.mouseLeave);\n\t}\n\n\tmouseMove(e){\n\t\tconst target = e.target;\n\t\tlet slices = this.components.get('pieSlices').store;\n\t\tlet prevIndex = this.curActiveSliceIndex;\n\t\tlet prevAcitve = this.curActiveSlice;\n\t\tif(slices.includes(target)) {\n\t\t\tlet i = slices.indexOf(target);\n\t\t\tthis.hoverSlice(prevAcitve, prevIndex,false);\n\t\t\tthis.curActiveSlice = target;\n\t\t\tthis.curActiveSliceIndex = i;\n\t\t\tthis.hoverSlice(target, i, true, e);\n\t\t} else {\n\t\t\tthis.mouseLeave();\n\t\t}\n\t}\n\n\tmouseLeave(){\n\t\tthis.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,false);\n\t}\n}\n","import BaseChart from './BaseChart';\nimport { getComponent } from '../objects/ChartComponents';\nimport { makeText, heatSquare } from '../utils/draw';\nimport { DAY_NAMES_SHORT, addDays, areInSameMonth, getLastDateInMonth, setDayToSunday, getYyyyMmDd, getWeeksBetween, getMonthName, clone,\n\tNO_OF_MILLIS, NO_OF_YEAR_MONTHS, NO_OF_DAYS_IN_WEEK } from '../utils/date-utils';\nimport { calcDistribution, getMaxCheckpoint } from '../utils/intervals';\nimport { getExtraHeight, getExtraWidth, HEATMAP_DISTRIBUTION_SIZE, HEATMAP_SQUARE_SIZE,\n\tHEATMAP_GUTTER_SIZE } from '../utils/constants';\n\nconst COL_WIDTH = HEATMAP_SQUARE_SIZE + HEATMAP_GUTTER_SIZE;\nconst ROW_HEIGHT = COL_WIDTH;\n// const DAY_INCR = 1;\n\nexport default class Heatmap extends BaseChart {\n\tconstructor(parent, options) {\n\t\tsuper(parent, options);\n\t\tthis.type = 'heatmap';\n\n\t\tthis.countLabel = options.countLabel || '';\n\n\t\tlet validStarts = ['Sunday', 'Monday'];\n\t\tlet startSubDomain = validStarts.includes(options.startSubDomain)\n\t\t\t? options.startSubDomain : 'Sunday';\n\t\tthis.startSubDomainIndex = validStarts.indexOf(startSubDomain);\n\n\t\tthis.setup();\n\t}\n\n\tsetMeasures(options) {\n\t\tlet m = this.measures;\n\t\tthis.discreteDomains = options.discreteDomains === 0 ? 0 : 1;\n\n\t\tm.paddings.top = ROW_HEIGHT * 3;\n\t\tm.paddings.bottom = 0;\n\t\tm.legendHeight = ROW_HEIGHT * 2;\n\t\tm.baseHeight = ROW_HEIGHT * NO_OF_DAYS_IN_WEEK\n\t\t\t+ getExtraHeight(m);\n\n\t\tlet d = this.data;\n\t\tlet spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;\n\t\tthis.independentWidth = (getWeeksBetween(d.start, d.end)\n\t\t\t+ spacing) * COL_WIDTH + getExtraWidth(m);\n\t}\n\n\tupdateWidth() {\n\t\tlet spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;\n\t\tlet noOfWeeks = this.state.noOfWeeks ? this.state.noOfWeeks : 52;\n\t\tthis.baseWidth = (noOfWeeks + spacing) * COL_WIDTH\n\t\t\t+ getExtraWidth(this.measures);\n\t}\n\n\tprepareData(data=this.data) {\n\t\tif(data.start && data.end && data.start > data.end) {\n\t\t\tthrow new Error('Start date cannot be greater than end date.');\n\t\t}\n\n\t\tif(!data.start) {\n\t\t\tdata.start = new Date();\n\t\t\tdata.start.setFullYear( data.start.getFullYear() - 1 );\n\t\t}\n\t\tif(!data.end) { data.end = new Date(); }\n\t\tdata.dataPoints = data.dataPoints || {};\n\n\t\tif(parseInt(Object.keys(data.dataPoints)[0]) > 100000) {\n\t\t\tlet points = {};\n\t\t\tObject.keys(data.dataPoints).forEach(timestampSec => {\n\t\t\t\tlet date = new Date(timestampSec * NO_OF_MILLIS);\n\t\t\t\tpoints[getYyyyMmDd(date)] = data.dataPoints[timestampSec];\n\t\t\t});\n\t\t\tdata.dataPoints = points;\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tcalc() {\n\t\tlet s = this.state;\n\n\t\ts.start = clone(this.data.start);\n\t\ts.end = clone(this.data.end);\n\n\t\ts.firstWeekStart = clone(s.start);\n\t\ts.noOfWeeks = getWeeksBetween(s.start, s.end);\n\t\ts.distribution = calcDistribution(\n\t\t\tObject.values(this.data.dataPoints), HEATMAP_DISTRIBUTION_SIZE);\n\n\t\ts.domainConfigs = this.getDomains();\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\t\tlet lessCol = this.discreteDomains ? 0 : 1;\n\n\t\tlet componentConfigs = s.domainConfigs.map((config, i) => [\n\t\t\t'heatDomain',\n\t\t\t{\n\t\t\t\tindex: config.index,\n\t\t\t\tcolWidth: COL_WIDTH,\n\t\t\t\trowHeight: ROW_HEIGHT,\n\t\t\t\tsquareSize: HEATMAP_SQUARE_SIZE,\n\t\t\t\tradius: this.rawChartArgs.radius || 0,\n\t\t\t\txTranslate: s.domainConfigs\n\t\t\t\t\t.filter((config, j) => j < i)\n\t\t\t\t\t.map(config => config.cols.length - lessCol)\n\t\t\t\t\t.reduce((a, b) => a + b, 0)\n\t\t\t\t\t* COL_WIDTH\n\t\t\t},\n\t\t\tfunction() {\n\t\t\t\treturn s.domainConfigs[i];\n\t\t\t}.bind(this)\n\n\t\t]);\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map((args, i) => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0] + '-' + i, component];\n\t\t\t})\n\t\t);\n\n\t\tlet y = 0;\n\t\tDAY_NAMES_SHORT.forEach((dayName, i) => {\n\t\t\tif([1, 3, 5].includes(i)) {\n\t\t\t\tlet dayText = makeText('subdomain-name', -COL_WIDTH/2, y, dayName,\n\t\t\t\t\t{\n\t\t\t\t\t\tfontSize: HEATMAP_SQUARE_SIZE,\n\t\t\t\t\t\tdy: 8,\n\t\t\t\t\t\ttextAnchor: 'end'\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tthis.drawArea.appendChild(dayText);\n\t\t\t}\n\t\t\ty += ROW_HEIGHT;\n\t\t});\n\t}\n\n\tupdate(data) {\n\t\tif(!data) {\n\t\t\tconsole.error('No data to update.');\n\t\t}\n\n\t\tthis.data = this.prepareData(data);\n\t\tthis.draw();\n\t\tthis.bindTooltip();\n\t}\n\n\tbindTooltip() {\n\t\tthis.container.addEventListener('mousemove', (e) => {\n\t\t\tthis.components.forEach(comp => {\n\t\t\t\tlet daySquares = comp.store;\n\t\t\t\tlet daySquare = e.target;\n\t\t\t\tif(daySquares.includes(daySquare)) {\n\n\t\t\t\t\tlet count = daySquare.getAttribute('data-value');\n\t\t\t\t\tlet dateParts = daySquare.getAttribute('data-date').split('-');\n\n\t\t\t\t\tlet month = getMonthName(parseInt(dateParts[1])-1, true);\n\n\t\t\t\t\tlet gOff = this.container.getBoundingClientRect(), pOff = daySquare.getBoundingClientRect();\n\n\t\t\t\t\tlet width = parseInt(e.target.getAttribute('width'));\n\t\t\t\t\tlet x = pOff.left - gOff.left + width/2;\n\t\t\t\t\tlet y = pOff.top - gOff.top;\n\t\t\t\t\tlet value = count + ' ' + this.countLabel;\n\t\t\t\t\tlet name = ' on ' + month + ' ' + dateParts[0] + ', ' + dateParts[2];\n\n\t\t\t\t\tthis.tip.setValues(x, y, {name: name, value: value, valueFirst: 1}, []);\n\t\t\t\t\tthis.tip.showTip();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\trenderLegend() {\n\t\tthis.legendArea.textContent = '';\n\t\tlet x = 0;\n\t\tlet y = ROW_HEIGHT;\n\t\tlet radius = this.rawChartArgs.radius || 0;\n\n\t\tlet lessText = makeText('subdomain-name', x, y, 'Less',\n\t\t\t{\n\t\t\t\tfontSize: HEATMAP_SQUARE_SIZE + 1,\n\t\t\t\tdy: 9\n\t\t\t}\n\t\t);\n\t\tx = (COL_WIDTH * 2) + COL_WIDTH/2;\n\t\tthis.legendArea.appendChild(lessText);\n\n\t\tthis.colors.slice(0, HEATMAP_DISTRIBUTION_SIZE).map((color, i) => {\n\t\t\tconst square = heatSquare('heatmap-legend-unit', x + (COL_WIDTH + 3) * i,\n\t\t\t\ty, HEATMAP_SQUARE_SIZE, radius, color);\n\t\t\tthis.legendArea.appendChild(square);\n\t\t});\n\n\t\tlet moreTextX = x + HEATMAP_DISTRIBUTION_SIZE * (COL_WIDTH + 3) + COL_WIDTH/4;\n\t\tlet moreText = makeText('subdomain-name', moreTextX, y, 'More',\n\t\t\t{\n\t\t\t\tfontSize: HEATMAP_SQUARE_SIZE + 1,\n\t\t\t\tdy: 9\n\t\t\t}\n\t\t);\n\t\tthis.legendArea.appendChild(moreText);\n\t}\n\n\tgetDomains() {\n\t\tlet s = this.state;\n\t\tconst [startMonth, startYear] = [s.start.getMonth(), s.start.getFullYear()];\n\t\tconst [endMonth, endYear] = [s.end.getMonth(), s.end.getFullYear()];\n\n\t\tconst noOfMonths = (endMonth - startMonth + 1) + (endYear - startYear) * 12;\n\n\t\tlet domainConfigs = [];\n\n\t\tlet startOfMonth = clone(s.start);\n\t\tfor(var i = 0; i < noOfMonths; i++) {\n\t\t\tlet endDate = s.end;\n\t\t\tif(!areInSameMonth(startOfMonth, s.end)) {\n\t\t\t\tlet [month, year] = [startOfMonth.getMonth(), startOfMonth.getFullYear()];\n\t\t\t\tendDate = getLastDateInMonth(month, year);\n\t\t\t}\n\t\t\tdomainConfigs.push(this.getDomainConfig(startOfMonth, endDate));\n\n\t\t\taddDays(endDate, 1);\n\t\t\tstartOfMonth = endDate;\n\t\t}\n\n\t\treturn domainConfigs;\n\t}\n\n\tgetDomainConfig(startDate, endDate='') {\n\t\tlet [month, year] = [startDate.getMonth(), startDate.getFullYear()];\n\t\tlet startOfWeek = setDayToSunday(startDate); // TODO: Monday as well\n\t\tendDate = clone(endDate) || getLastDateInMonth(month, year);\n\n\t\tlet domainConfig = {\n\t\t\tindex: month,\n\t\t\tcols: []\n\t\t};\n\n\t\taddDays(endDate, 1);\n\t\tlet noOfMonthWeeks = getWeeksBetween(startOfWeek, endDate);\n\n\t\tlet cols = [], col;\n\t\tfor(var i = 0; i < noOfMonthWeeks; i++) {\n\t\t\tcol = this.getCol(startOfWeek, month);\n\t\t\tcols.push(col);\n\n\t\t\tstartOfWeek = new Date(col[NO_OF_DAYS_IN_WEEK - 1].yyyyMmDd);\n\t\t\taddDays(startOfWeek, 1);\n\t\t}\n\n\t\tif(col[NO_OF_DAYS_IN_WEEK - 1].dataValue !== undefined) {\n\t\t\taddDays(startOfWeek, 1);\n\t\t\tcols.push(this.getCol(startOfWeek, month, true));\n\t\t}\n\n\t\tdomainConfig.cols = cols;\n\n\t\treturn domainConfig;\n\t}\n\n\tgetCol(startDate, month, empty = false) {\n\t\tlet s = this.state;\n\n\t\t// startDate is the start of week\n\t\tlet currentDate = clone(startDate);\n\t\tlet col = [];\n\n\t\tfor(var i = 0; i < NO_OF_DAYS_IN_WEEK; i++, addDays(currentDate, 1)) {\n\t\t\tlet config = {};\n\n\t\t\t// Non-generic adjustment for entire heatmap, needs state\n\t\t\tlet currentDateWithinData = currentDate >= s.start && currentDate <= s.end;\n\n\t\t\tif(empty || currentDate.getMonth() !== month || !currentDateWithinData) {\n\t\t\t\tconfig.yyyyMmDd = getYyyyMmDd(currentDate);\n\t\t\t} else {\n\t\t\t\tconfig = this.getSubDomainConfig(currentDate);\n\t\t\t}\n\t\t\tcol.push(config);\n\t\t}\n\n\t\treturn col;\n\t}\n\n\tgetSubDomainConfig(date) {\n\t\tlet yyyyMmDd = getYyyyMmDd(date);\n\t\tlet dataValue = this.data.dataPoints[yyyyMmDd];\n\t\tlet config = {\n\t\t\tyyyyMmDd: yyyyMmDd,\n\t\t\tdataValue: dataValue || 0,\n\t\t\tfill: this.colors[getMaxCheckpoint(dataValue, this.state.distribution)]\n\t\t};\n\t\treturn config;\n\t}\n}\n","import BaseChart from './BaseChart';\nimport { dataPrep, zeroDataPrep, getShortenedLabels } from '../utils/axis-chart-utils';\nimport { AXIS_LEGEND_BAR_SIZE } from '../utils/constants';\nimport { getComponent } from '../objects/ChartComponents';\nimport { getOffset, fire } from '../utils/dom';\nimport { calcChartIntervals, getIntervalSize, getValueRange, getZeroIndex, scale, getClosestInArray } from '../utils/intervals';\nimport { floatTwo } from '../utils/helpers';\nimport { makeOverlay, updateOverlay, legendBar } from '../utils/draw';\nimport { getTopOffset, getLeftOffset, MIN_BAR_PERCENT_HEIGHT, BAR_CHART_SPACE_RATIO,\n\tLINE_CHART_DOT_SIZE } from '../utils/constants';\n\nexport default class AxisChart extends BaseChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\n\t\tthis.barOptions = args.barOptions || {};\n\t\tthis.lineOptions = args.lineOptions || {};\n\n\t\tthis.type = args.type || 'line';\n\t\tthis.init = 1;\n\n\t\tthis.setup();\n\t}\n\n\tsetMeasures() {\n\t\tif(this.data.datasets.length <= 1) {\n\t\t\tthis.config.showLegend = 0;\n\t\t\tthis.measures.paddings.bottom = 30;\n\t\t}\n\t}\n\n\tconfigure(options) {\n\t\tsuper.configure(options);\n\n\t\toptions.axisOptions = options.axisOptions || {};\n\t\toptions.tooltipOptions = options.tooltipOptions || {};\n\n\t\tthis.config.xAxisMode = options.axisOptions.xAxisMode || 'span';\n\t\tthis.config.yAxisMode = options.axisOptions.yAxisMode || 'span';\n\t\tthis.config.xIsSeries = options.axisOptions.xIsSeries || 0;\n\t\tthis.config.shortenYAxisNumbers = options.axisOptions.shortenYAxisNumbers || 0;\n\n\t\tthis.config.formatTooltipX = options.tooltipOptions.formatTooltipX;\n\t\tthis.config.formatTooltipY = options.tooltipOptions.formatTooltipY;\n\n\t\tthis.config.valuesOverPoints = options.valuesOverPoints;\n\t}\n\n\tprepareData(data=this.data) {\n\t\treturn dataPrep(data, this.type);\n\t}\n\n\tprepareFirstData(data=this.data) {\n\t\treturn zeroDataPrep(data);\n\t}\n\n\tcalc(onlyWidthChange = false) {\n\t\tthis.calcXPositions();\n\t\tif(!onlyWidthChange) {\n\t\t\tthis.calcYAxisParameters(this.getAllYValues(), this.type === 'line');\n\t\t}\n\t\tthis.makeDataByIndex();\n\t}\n\n\tcalcXPositions() {\n\t\tlet s = this.state;\n\t\tlet labels = this.data.labels;\n\t\ts.datasetLength = labels.length;\n\n\t\ts.unitWidth = this.width/(s.datasetLength);\n\t\t// Default, as per bar, and mixed. Only line will be a special case\n\t\ts.xOffset = s.unitWidth/2;\n\n\t\t// // For a pure Line Chart\n\t\t// s.unitWidth = this.width/(s.datasetLength - 1);\n\t\t// s.xOffset = 0;\n\n\t\ts.xAxis = {\n\t\t\tlabels: labels,\n\t\t\tpositions: labels.map((d, i) =>\n\t\t\t\tfloatTwo(s.xOffset + i * s.unitWidth)\n\t\t\t)\n\t\t};\n\t}\n\n\tcalcYAxisParameters(dataValues, withMinimum = 'false') {\n\t\tconst yPts = calcChartIntervals(dataValues, withMinimum);\n\t\tconst scaleMultiplier = this.height / getValueRange(yPts);\n\t\tconst intervalHeight = getIntervalSize(yPts) * scaleMultiplier;\n\t\tconst zeroLine = this.height - (getZeroIndex(yPts) * intervalHeight);\n\n\t\tthis.state.yAxis = {\n\t\t\tlabels: yPts,\n\t\t\tpositions: yPts.map(d => zeroLine - d * scaleMultiplier),\n\t\t\tscaleMultiplier: scaleMultiplier,\n\t\t\tzeroLine: zeroLine,\n\t\t};\n\n\t\t// Dependent if above changes\n\t\tthis.calcDatasetPoints();\n\t\tthis.calcYExtremes();\n\t\tthis.calcYRegions();\n\t}\n\n\tcalcDatasetPoints() {\n\t\tlet s = this.state;\n\t\tlet scaleAll = values => values.map(val => scale(val, s.yAxis));\n\n\t\ts.datasets = this.data.datasets.map((d, i) => {\n\t\t\tlet values = d.values;\n\t\t\tlet cumulativeYs = d.cumulativeYs || [];\n\t\t\treturn {\n\t\t\t\tname: d.name && d.name.replace(/<|>|&/g, (char) => char == '&' ? '&' : char == '<' ? '<' : '>'),\n\t\t\t\tindex: i,\n\t\t\t\tchartType: d.chartType,\n\n\t\t\t\tvalues: values,\n\t\t\t\tyPositions: scaleAll(values),\n\n\t\t\t\tcumulativeYs: cumulativeYs,\n\t\t\t\tcumulativeYPos: scaleAll(cumulativeYs),\n\t\t\t};\n\t\t});\n\t}\n\n\tcalcYExtremes() {\n\t\tlet s = this.state;\n\t\tif(this.barOptions.stacked) {\n\t\t\ts.yExtremes = s.datasets[s.datasets.length - 1].cumulativeYPos;\n\t\t\treturn;\n\t\t}\n\t\ts.yExtremes = new Array(s.datasetLength).fill(9999);\n\t\ts.datasets.map(d => {\n\t\t\td.yPositions.map((pos, j) => {\n\t\t\t\tif(pos < s.yExtremes[j]) {\n\t\t\t\t\ts.yExtremes[j] = pos;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tcalcYRegions() {\n\t\tlet s = this.state;\n\t\tif(this.data.yMarkers) {\n\t\t\tthis.state.yMarkers = this.data.yMarkers.map(d => {\n\t\t\t\td.position = scale(d.value, s.yAxis);\n\t\t\t\tif(!d.options) d.options = {};\n\t\t\t\t// if(!d.label.includes(':')) {\n\t\t\t\t// \td.label += ': ' + d.value;\n\t\t\t\t// }\n\t\t\t\treturn d;\n\t\t\t});\n\t\t}\n\t\tif(this.data.yRegions) {\n\t\t\tthis.state.yRegions = this.data.yRegions.map(d => {\n\t\t\t\td.startPos = scale(d.start, s.yAxis);\n\t\t\t\td.endPos = scale(d.end, s.yAxis);\n\t\t\t\tif(!d.options) d.options = {};\n\t\t\t\treturn d;\n\t\t\t});\n\t\t}\n\t}\n\n\tgetAllYValues() {\n\t\tlet key = 'values';\n\n\t\tif(this.barOptions.stacked) {\n\t\t\tkey = 'cumulativeYs';\n\t\t\tlet cumulative = new Array(this.state.datasetLength).fill(0);\n\t\t\tthis.data.datasets.map((d, i) => {\n\t\t\t\tlet values = this.data.datasets[i].values;\n\t\t\t\td[key] = cumulative = cumulative.map((c, i) => c + values[i]);\n\t\t\t});\n\t\t}\n\n\t\tlet allValueLists = this.data.datasets.map(d => d[key]);\n\t\tif(this.data.yMarkers) {\n\t\t\tallValueLists.push(this.data.yMarkers.map(d => d.value));\n\t\t}\n\t\tif(this.data.yRegions) {\n\t\t\tthis.data.yRegions.map(d => {\n\t\t\t\tallValueLists.push([d.end, d.start]);\n\t\t\t});\n\t\t}\n\n\t\treturn [].concat(...allValueLists);\n\t}\n\n\tsetupComponents() {\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'yAxis',\n\t\t\t\t{\n\t\t\t\t\tmode: this.config.yAxisMode,\n\t\t\t\t\twidth: this.width,\n\t\t\t\t\tshortenNumbers: this.config.shortenYAxisNumbers\n\t\t\t\t\t// pos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn this.state.yAxis;\n\t\t\t\t}.bind(this)\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'xAxis',\n\t\t\t\t{\n\t\t\t\t\tmode: this.config.xAxisMode,\n\t\t\t\t\theight: this.height,\n\t\t\t\t\t// pos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\tlet s = this.state;\n\t\t\t\t\ts.xAxis.calcLabels = getShortenedLabels(this.width,\n\t\t\t\t\t\ts.xAxis.labels, this.config.xIsSeries);\n\n\t\t\t\t\treturn s.xAxis;\n\t\t\t\t}.bind(this)\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'yRegions',\n\t\t\t\t{\n\t\t\t\t\twidth: this.width,\n\t\t\t\t\tpos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn this.state.yRegions;\n\t\t\t\t}.bind(this)\n\t\t\t],\n\t\t];\n\n\t\tlet barDatasets = this.state.datasets.filter(d => d.chartType === 'bar');\n\t\tlet lineDatasets = this.state.datasets.filter(d => d.chartType === 'line');\n\n\t\tlet barsConfigs = barDatasets.map(d => {\n\t\t\tlet index = d.index;\n\t\t\treturn [\n\t\t\t\t'barGraph' + '-' + d.index,\n\t\t\t\t{\n\t\t\t\t\tindex: index,\n\t\t\t\t\tcolor: this.colors[index],\n\t\t\t\t\tstacked: this.barOptions.stacked,\n\n\t\t\t\t\t// same for all datasets\n\t\t\t\t\tvaluesOverPoints: this.config.valuesOverPoints,\n\t\t\t\t\tminHeight: this.height * MIN_BAR_PERCENT_HEIGHT,\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\tlet s = this.state;\n\t\t\t\t\tlet d = s.datasets[index];\n\t\t\t\t\tlet stacked = this.barOptions.stacked;\n\n\t\t\t\t\tlet spaceRatio = this.barOptions.spaceRatio || BAR_CHART_SPACE_RATIO;\n\t\t\t\t\tlet barsWidth = s.unitWidth * (1 - spaceRatio);\n\t\t\t\t\tlet barWidth = barsWidth/(stacked ? 1 : barDatasets.length);\n\n\t\t\t\t\tlet xPositions = s.xAxis.positions.map(x => x - barsWidth/2);\n\t\t\t\t\tif(!stacked) {\n\t\t\t\t\t\txPositions = xPositions.map(p => p + barWidth * index);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet labels = new Array(s.datasetLength).fill('');\n\t\t\t\t\tif(this.config.valuesOverPoints) {\n\t\t\t\t\t\tif(stacked && d.index === s.datasets.length - 1) {\n\t\t\t\t\t\t\tlabels = d.cumulativeYs;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlabels = d.values;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlet offsets = new Array(s.datasetLength).fill(0);\n\t\t\t\t\tif(stacked) {\n\t\t\t\t\t\toffsets = d.yPositions.map((y, j) => y - d.cumulativeYPos[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\txPositions: xPositions,\n\t\t\t\t\t\tyPositions: d.yPositions,\n\t\t\t\t\t\toffsets: offsets,\n\t\t\t\t\t\t// values: d.values,\n\t\t\t\t\t\tlabels: labels,\n\n\t\t\t\t\t\tzeroLine: s.yAxis.zeroLine,\n\t\t\t\t\t\tbarsWidth: barsWidth,\n\t\t\t\t\t\tbarWidth: barWidth,\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t];\n\t\t});\n\n\t\tlet lineConfigs = lineDatasets.map(d => {\n\t\t\tlet index = d.index;\n\t\t\treturn [\n\t\t\t\t'lineGraph' + '-' + d.index,\n\t\t\t\t{\n\t\t\t\t\tindex: index,\n\t\t\t\t\tcolor: this.colors[index],\n\t\t\t\t\tsvgDefs: this.svgDefs,\n\t\t\t\t\theatline: this.lineOptions.heatline,\n\t\t\t\t\tregionFill: this.lineOptions.regionFill,\n\t\t\t\t\tspline: this.lineOptions.spline,\n\t\t\t\t\thideDots: this.lineOptions.hideDots,\n\t\t\t\t\thideLine: this.lineOptions.hideLine,\n\n\t\t\t\t\t// same for all datasets\n\t\t\t\t\tvaluesOverPoints: this.config.valuesOverPoints,\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\tlet s = this.state;\n\t\t\t\t\tlet d = s.datasets[index];\n\t\t\t\t\tlet minLine = s.yAxis.positions[0] < s.yAxis.zeroLine\n\t\t\t\t\t\t? s.yAxis.positions[0] : s.yAxis.zeroLine;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\txPositions: s.xAxis.positions,\n\t\t\t\t\t\tyPositions: d.yPositions,\n\n\t\t\t\t\t\tvalues: d.values,\n\n\t\t\t\t\t\tzeroLine: minLine,\n\t\t\t\t\t\tradius: this.lineOptions.dotSize || LINE_CHART_DOT_SIZE,\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t];\n\t\t});\n\n\t\tlet markerConfigs = [\n\t\t\t[\n\t\t\t\t'yMarkers',\n\t\t\t\t{\n\t\t\t\t\twidth: this.width,\n\t\t\t\t\tpos: 'right'\n\t\t\t\t},\n\t\t\t\tfunction() {\n\t\t\t\t\treturn this.state.yMarkers;\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tcomponentConfigs = componentConfigs.concat(barsConfigs, lineConfigs, markerConfigs);\n\n\t\tlet optionals = ['yMarkers', 'yRegions'];\n\t\tthis.dataUnitComponents = [];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.filter(args => !optionals.includes(args[0]) || this.state[args[0]])\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\tif(args[0].includes('lineGraph') || args[0].includes('barGraph')) {\n\t\t\t\t\tthis.dataUnitComponents.push(component);\n\t\t\t\t}\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tmakeDataByIndex() {\n\t\tthis.dataByIndex = {};\n\n\t\tlet s = this.state;\n\t\tlet formatX = this.config.formatTooltipX;\n\t\tlet formatY = this.config.formatTooltipY;\n\t\tlet titles = s.xAxis.labels;\n\n\t\ttitles.map((label, index) => {\n\t\t\tlet values = this.state.datasets.map((set, i) => {\n\t\t\t\tlet value = set.values[index];\n\t\t\t\treturn {\n\t\t\t\t\ttitle: set.name,\n\t\t\t\t\tvalue: value,\n\t\t\t\t\tyPos: set.yPositions[index],\n\t\t\t\t\tcolor: this.colors[i],\n\t\t\t\t\tformatted: formatY ? formatY(value) : value,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tthis.dataByIndex[index] = {\n\t\t\t\tlabel: label,\n\t\t\t\tformattedLabel: formatX ? formatX(label) : label,\n\t\t\t\txPos: s.xAxis.positions[index],\n\t\t\t\tvalues: values,\n\t\t\t\tyExtreme: s.yExtremes[index],\n\t\t\t};\n\t\t});\n\t}\n\n\tbindTooltip() {\n\t\t// NOTE: could be in tooltip itself, as it is a given functionality for its parent\n\t\tthis.container.addEventListener('mousemove', (e) => {\n\t\t\tlet m = this.measures;\n\t\t\tlet o = getOffset(this.container);\n\t\t\tlet relX = e.pageX - o.left - getLeftOffset(m);\n\t\t\tlet relY = e.pageY - o.top;\n\n\t\t\tif(relY < this.height + getTopOffset(m)\n\t\t\t\t&& relY > getTopOffset(m)) {\n\t\t\t\tthis.mapTooltipXPosition(relX);\n\t\t\t} else {\n\t\t\t\tthis.tip.hideTip();\n\t\t\t}\n\t\t});\n\t}\n\n\tmapTooltipXPosition(relX) {\n\t\tlet s = this.state;\n\t\tif(!s.yExtremes) return;\n\n\t\tlet index = getClosestInArray(relX, s.xAxis.positions, true);\n\t\tif (index >= 0) {\n\t\t\tlet dbi = this.dataByIndex[index];\n\n\t\t\tthis.tip.setValues(\n\t\t\t\tdbi.xPos + this.tip.offset.x,\n\t\t\t\tdbi.yExtreme + this.tip.offset.y,\n\t\t\t\t{name: dbi.formattedLabel, value: ''},\n\t\t\t\tdbi.values,\n\t\t\t\tindex\n\t\t\t);\n\n\t\t\tthis.tip.showTip();\n\t\t}\n\t}\n\n\trenderLegend() {\n\t\tlet s = this.data;\n\t\tif(s.datasets.length > 1) {\n\t\t\tthis.legendArea.textContent = '';\n\t\t\ts.datasets.map((d, i) => {\n\t\t\t\tlet barWidth = AXIS_LEGEND_BAR_SIZE;\n\t\t\t\t// let rightEndPoint = this.baseWidth - this.measures.margins.left - this.measures.margins.right;\n\t\t\t\t// let multiplier = s.datasets.length - i;\n\t\t\t\tlet rect = legendBar(\n\t\t\t\t\t// rightEndPoint - multiplier * barWidth,\t// To right align\n\t\t\t\t\tbarWidth * i,\n\t\t\t\t\t'0',\n\t\t\t\t\tbarWidth,\n\t\t\t\t\tthis.colors[i],\n\t\t\t\t\td.name,\n\t\t\t\t\tthis.config.truncateLegends);\n\t\t\t\tthis.legendArea.appendChild(rect);\n\t\t\t});\n\t\t}\n\t}\n\n\n\n\t// Overlay\n\tmakeOverlay() {\n\t\tif(this.init) {\n\t\t\tthis.init = 0;\n\t\t\treturn;\n\t\t}\n\t\tif(this.overlayGuides) {\n\t\t\tthis.overlayGuides.forEach(g => {\n\t\t\t\tlet o = g.overlay;\n\t\t\t\to.parentNode.removeChild(o);\n\t\t\t});\n\t\t}\n\n\t\tthis.overlayGuides = this.dataUnitComponents.map(c => {\n\t\t\treturn {\n\t\t\t\ttype: c.unitType,\n\t\t\t\toverlay: undefined,\n\t\t\t\tunits: c.units,\n\t\t\t};\n\t\t});\n\n\t\tif(this.state.currentIndex === undefined) {\n\t\t\tthis.state.currentIndex = this.state.datasetLength - 1;\n\t\t}\n\n\t\t// Render overlays\n\t\tthis.overlayGuides.map(d => {\n\t\t\tlet currentUnit = d.units[this.state.currentIndex];\n\n\t\t\td.overlay = makeOverlay[d.type](currentUnit);\n\t\t\tthis.drawArea.appendChild(d.overlay);\n\t\t});\n\t}\n\n\tupdateOverlayGuides() {\n\t\tif(this.overlayGuides) {\n\t\t\tthis.overlayGuides.forEach(g => {\n\t\t\t\tlet o = g.overlay;\n\t\t\t\to.parentNode.removeChild(o);\n\t\t\t});\n\t\t}\n\t}\n\n\tbindOverlay() {\n\t\tthis.parent.addEventListener('data-select', () => {\n\t\t\tthis.updateOverlay();\n\t\t});\n\t}\n\n\tbindUnits() {\n\t\tthis.dataUnitComponents.map(c => {\n\t\t\tc.units.map(unit => {\n\t\t\t\tunit.addEventListener('click', () => {\n\t\t\t\t\tlet index = unit.getAttribute('data-point-index');\n\t\t\t\t\tthis.setCurrentDataPoint(index);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// Note: Doesn't work as tooltip is absolutely positioned\n\t\tthis.tip.container.addEventListener('click', () => {\n\t\t\tlet index = this.tip.container.getAttribute('data-point-index');\n\t\t\tthis.setCurrentDataPoint(index);\n\t\t});\n\t}\n\n\tupdateOverlay() {\n\t\tthis.overlayGuides.map(d => {\n\t\t\tlet currentUnit = d.units[this.state.currentIndex];\n\t\t\tupdateOverlay[d.type](currentUnit, d.overlay);\n\t\t});\n\t}\n\n\tonLeftArrow() {\n\t\tthis.setCurrentDataPoint(this.state.currentIndex - 1);\n\t}\n\n\tonRightArrow() {\n\t\tthis.setCurrentDataPoint(this.state.currentIndex + 1);\n\t}\n\n\tgetDataPoint(index=this.state.currentIndex) {\n\t\tlet s = this.state;\n\t\tlet data_point = {\n\t\t\tindex: index,\n\t\t\tlabel: s.xAxis.labels[index],\n\t\t\tvalues: s.datasets.map(d => d.values[index])\n\t\t};\n\t\treturn data_point;\n\t}\n\n\tsetCurrentDataPoint(index) {\n\t\tlet s = this.state;\n\t\tindex = parseInt(index);\n\t\tif(index < 0) index = 0;\n\t\tif(index >= s.xAxis.labels.length) index = s.xAxis.labels.length - 1;\n\t\tif(index === s.currentIndex) return;\n\t\ts.currentIndex = index;\n\t\tfire(this.parent, \"data-select\", this.getDataPoint());\n\t}\n\n\n\n\t// API\n\taddDataPoint(label, datasetValues, index=this.state.datasetLength) {\n\t\tsuper.addDataPoint(label, datasetValues, index);\n\t\tthis.data.labels.splice(index, 0, label);\n\t\tthis.data.datasets.map((d, i) => {\n\t\t\td.values.splice(index, 0, datasetValues[i]);\n\t\t});\n\t\tthis.update(this.data);\n\t}\n\n\tremoveDataPoint(index = this.state.datasetLength-1) {\n\t\tif (this.data.labels.length <= 1) {\n\t\t\treturn;\n\t\t}\n\t\tsuper.removeDataPoint(index);\n\t\tthis.data.labels.splice(index, 1);\n\t\tthis.data.datasets.map(d => {\n\t\t\td.values.splice(index, 1);\n\t\t});\n\t\tthis.update(this.data);\n\t}\n\n\tupdateDataset(datasetValues, index=0) {\n\t\tthis.data.datasets[index].values = datasetValues;\n\t\tthis.update(this.data);\n\t}\n\t// addDataset(dataset, index) {}\n\t// removeDataset(index = 0) {}\n\n\tupdateDatasets(datasets) {\n\t\tthis.data.datasets.map((d, i) => {\n\t\t\tif(datasets[i]) {\n\t\t\t\td.values = datasets[i];\n\t\t\t}\n\t\t});\n\t\tthis.update(this.data);\n\t}\n\n\t// updateDataPoint(dataPoint, index = 0) {}\n\t// addDataPoint(dataPoint, index = 0) {}\n\t// removeDataPoint(index = 0) {}\n}\n","import { fillArray } from '../utils/helpers';\nimport { DEFAULT_AXIS_CHART_TYPE, AXIS_DATASET_CHART_TYPES, DEFAULT_CHAR_WIDTH } from '../utils/constants';\n\nexport function dataPrep(data, type) {\n\tdata.labels = data.labels || [];\n\n\tlet datasetLength = data.labels.length;\n\n\t// Datasets\n\tlet datasets = data.datasets;\n\tlet zeroArray = new Array(datasetLength).fill(0);\n\tif(!datasets) {\n\t\t// default\n\t\tdatasets = [{\n\t\t\tvalues: zeroArray\n\t\t}];\n\t}\n\n\tdatasets.map(d=> {\n\t\t// Set values\n\t\tif(!d.values) {\n\t\t\td.values = zeroArray;\n\t\t} else {\n\t\t\t// Check for non values\n\t\t\tlet vals = d.values;\n\t\t\tvals = vals.map(val => (!isNaN(val) ? val : 0));\n\n\t\t\t// Trim or extend\n\t\t\tif(vals.length > datasetLength) {\n\t\t\t\tvals = vals.slice(0, datasetLength);\n\t\t\t} else {\n\t\t\t\tvals = fillArray(vals, datasetLength - vals.length, 0);\n\t\t\t}\n\t\t\td.values = vals;\n\t\t}\n\n\t\t// Set type\n\t\tif(!d.chartType ) {\n\t\t\tif(!AXIS_DATASET_CHART_TYPES.includes(type)) type === DEFAULT_AXIS_CHART_TYPE;\n\t\t\td.chartType = type;\n\t\t}\n\n\t});\n\n\t// Markers\n\n\t// Regions\n\t// data.yRegions = data.yRegions || [];\n\tif(data.yRegions) {\n\t\tdata.yRegions.map(d => {\n\t\t\tif(d.end < d.start) {\n\t\t\t\t[d.start, d.end] = [d.end, d.start];\n\t\t\t}\n\t\t});\n\t}\n\n\treturn data;\n}\n\nexport function zeroDataPrep(realData) {\n\tlet datasetLength = realData.labels.length;\n\tlet zeroArray = new Array(datasetLength).fill(0);\n\n\tlet zeroData = {\n\t\tlabels: realData.labels.slice(0, -1),\n\t\tdatasets: realData.datasets.map(d => {\n\t\t\treturn {\n\t\t\t\tname: '',\n\t\t\t\tvalues: zeroArray.slice(0, -1),\n\t\t\t\tchartType: d.chartType\n\t\t\t};\n\t\t}),\n\t};\n\n\tif(realData.yMarkers) {\n\t\tzeroData.yMarkers = [\n\t\t\t{\n\t\t\t\tvalue: 0,\n\t\t\t\tlabel: ''\n\t\t\t}\n\t\t];\n\t}\n\n\tif(realData.yRegions) {\n\t\tzeroData.yRegions = [\n\t\t\t{\n\t\t\t\tstart: 0,\n\t\t\t\tend: 0,\n\t\t\t\tlabel: ''\n\t\t\t}\n\t\t];\n\t}\n\n\treturn zeroData;\n}\n\nexport function getShortenedLabels(chartWidth, labels=[], isSeries=true) {\n\tlet allowedSpace = chartWidth / labels.length;\n\tif(allowedSpace <= 0) allowedSpace = 1;\n\tlet allowedLetters = allowedSpace / DEFAULT_CHAR_WIDTH;\n\n\tlet seriesMultiple;\n\tif(isSeries) {\n\t\t// Find the maximum label length for spacing calculations\n\t\tlet maxLabelLength = Math.max(...labels.map(label => label.length));\n\t\tseriesMultiple = Math.ceil(maxLabelLength/allowedLetters);\n\t}\n\n\tlet calcLabels = labels.map((label, i) => {\n\t\tlabel += \"\";\n\t\tif(label.length > allowedLetters) {\n\n\t\t\tif(!isSeries) {\n\t\t\t\tif(allowedLetters-3 > 0) {\n\t\t\t\t\tlabel = label.slice(0, allowedLetters-3) + \" ...\";\n\t\t\t\t} else {\n\t\t\t\t\tlabel = label.slice(0, allowedLetters) + '..';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(i % seriesMultiple !== 0) {\n\t\t\t\t\tlabel = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn label;\n\t});\n\n\treturn calcLabels;\n}\n","import AggregationChart from './AggregationChart';\nimport { getComponent } from '../objects/ChartComponents';\nimport { getOffset } from '../utils/dom';\nimport { getPositionByAngle } from '../utils/helpers';\nimport { makeArcStrokePathStr, makeStrokeCircleStr } from '../utils/draw';\nimport { lightenDarkenColor } from '../utils/colors';\nimport { transform } from '../utils/animation';\nimport { FULL_ANGLE } from '../utils/constants';\n\nexport default class DonutChart extends AggregationChart {\n\tconstructor(parent, args) {\n\t\tsuper(parent, args);\n\t\tthis.type = 'donut';\n\t\tthis.initTimeout = 0;\n\t\tthis.init = 1;\n\n\t\tthis.setup();\n\t}\n\n\tconfigure(args) {\n\t\tsuper.configure(args);\n\t\tthis.mouseMove = this.mouseMove.bind(this);\n\t\tthis.mouseLeave = this.mouseLeave.bind(this);\n\n\t\tthis.hoverRadio = args.hoverRadio || 0.1;\n\t\tthis.config.startAngle = args.startAngle || 0;\n\n\t\tthis.clockWise = args.clockWise || false;\n\t\tthis.strokeWidth = args.strokeWidth || 30;\n\t}\n\n\tcalc() {\n\t\tsuper.calc();\n\t\tlet s = this.state;\n\t\tthis.radius =\n\t\t\tthis.height > this.width\n\t\t\t\t? this.center.x - this.strokeWidth / 2\n\t\t\t\t: this.center.y - this.strokeWidth / 2;\n\n\t\tconst { radius, clockWise } = this;\n\n\t\tconst prevSlicesProperties = s.slicesProperties || [];\n\t\ts.sliceStrings = [];\n\t\ts.slicesProperties = [];\n\t\tlet curAngle = 180 - this.config.startAngle;\n\n\t\ts.sliceTotals.map((total, i) => {\n\t\t\tconst startAngle = curAngle;\n\t\t\tconst originDiffAngle = (total / s.grandTotal) * FULL_ANGLE;\n\t\t\tconst largeArc = originDiffAngle > 180 ? 1: 0;\n\t\t\tconst diffAngle = clockWise ? -originDiffAngle : originDiffAngle;\n\t\t\tconst endAngle = curAngle = curAngle + diffAngle;\n\t\t\tconst startPosition = getPositionByAngle(startAngle, radius);\n\t\t\tconst endPosition = getPositionByAngle(endAngle, radius);\n\n\t\t\tconst prevProperty = this.init && prevSlicesProperties[i];\n\n\t\t\tlet curStart,curEnd;\n\t\t\tif(this.init) {\n\t\t\t\tcurStart = prevProperty ? prevProperty.startPosition : startPosition;\n\t\t\t\tcurEnd = prevProperty ? prevProperty.endPosition : startPosition;\n\t\t\t} else {\n\t\t\t\tcurStart = startPosition;\n\t\t\t\tcurEnd = endPosition;\n\t\t\t}\n\t\t\tconst curPath =\n\t\t\t\toriginDiffAngle === 360\n\t\t\t\t\t? makeStrokeCircleStr(curStart, curEnd, this.center, this.radius, this.clockWise, largeArc)\n\t\t\t\t\t: makeArcStrokePathStr(curStart, curEnd, this.center, this.radius, this.clockWise, largeArc);\n\n\t\t\ts.sliceStrings.push(curPath);\n\t\t\ts.slicesProperties.push({\n\t\t\t\tstartPosition,\n\t\t\t\tendPosition,\n\t\t\t\tvalue: total,\n\t\t\t\ttotal: s.grandTotal,\n\t\t\t\tstartAngle,\n\t\t\t\tendAngle,\n\t\t\t\tangle: diffAngle\n\t\t\t});\n\n\t\t});\n\t\tthis.init = 0;\n\t}\n\n\tsetupComponents() {\n\t\tlet s = this.state;\n\n\t\tlet componentConfigs = [\n\t\t\t[\n\t\t\t\t'donutSlices',\n\t\t\t\t{ },\n\t\t\t\tfunction() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsliceStrings: s.sliceStrings,\n\t\t\t\t\t\tcolors: this.colors,\n\t\t\t\t\t\tstrokeWidth: this.strokeWidth,\n\t\t\t\t\t};\n\t\t\t\t}.bind(this)\n\t\t\t]\n\t\t];\n\n\t\tthis.components = new Map(componentConfigs\n\t\t\t.map(args => {\n\t\t\t\tlet component = getComponent(...args);\n\t\t\t\treturn [args[0], component];\n\t\t\t}));\n\t}\n\n\tcalTranslateByAngle(property){\n\t\tconst{ radius, hoverRadio } = this;\n\t\tconst position = getPositionByAngle(property.startAngle+(property.angle / 2),radius);\n\t\treturn `translate3d(${(position.x) * hoverRadio}px,${(position.y) * hoverRadio}px,0)`;\n\t}\n\n\thoverSlice(path,i,flag,e){\n\t\tif(!path) return;\n\t\tconst color = this.colors[i];\n\t\tif(flag) {\n\t\t\ttransform(path, this.calTranslateByAngle(this.state.slicesProperties[i]));\n\t\t\tpath.style.stroke = lightenDarkenColor(color, 50);\n\t\t\tlet g_off = getOffset(this.svg);\n\t\t\tlet x = e.pageX - g_off.left + 10;\n\t\t\tlet y = e.pageY - g_off.top - 10;\n\t\t\tlet title = (this.formatted_labels && this.formatted_labels.length > 0\n\t\t\t\t? this.formatted_labels[i] : this.state.labels[i]) + ': ';\n\t\t\tlet percent = (this.state.sliceTotals[i] * 100 / this.state.grandTotal).toFixed(1);\n\t\t\tthis.tip.setValues(x, y, {name: title, value: percent + \"%\"});\n\t\t\tthis.tip.showTip();\n\t\t} else {\n\t\t\ttransform(path,'translate3d(0,0,0)');\n\t\t\tthis.tip.hideTip();\n\t\t\tpath.style.stroke = color;\n\t\t}\n\t}\n\n\tbindTooltip() {\n\t\tthis.container.addEventListener('mousemove', this.mouseMove);\n\t\tthis.container.addEventListener('mouseleave', this.mouseLeave);\n\t}\n\n\tmouseMove(e){\n\t\tconst target = e.target;\n\t\tlet slices = this.components.get('donutSlices').store;\n\t\tlet prevIndex = this.curActiveSliceIndex;\n\t\tlet prevAcitve = this.curActiveSlice;\n\t\tif(slices.includes(target)) {\n\t\t\tlet i = slices.indexOf(target);\n\t\t\tthis.hoverSlice(prevAcitve, prevIndex,false);\n\t\t\tthis.curActiveSlice = target;\n\t\t\tthis.curActiveSliceIndex = i;\n\t\t\tthis.hoverSlice(target, i, true, e);\n\t\t} else {\n\t\t\tthis.mouseLeave();\n\t\t}\n\t}\n\n\tmouseLeave(){\n\t\tthis.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,false);\n\t}\n}\n","import '../css/charts.scss';\n\n// import MultiAxisChart from './charts/MultiAxisChart';\nimport PercentageChart from './charts/PercentageChart';\nimport PieChart from './charts/PieChart';\nimport Heatmap from './charts/Heatmap';\nimport AxisChart from './charts/AxisChart';\nimport DonutChart from './charts/DonutChart';\n\nconst chartTypes = {\n\tbar: AxisChart,\n\tline: AxisChart,\n\t// multiaxis: MultiAxisChart,\n\tpercentage: PercentageChart,\n\theatmap: Heatmap,\n\tpie: PieChart,\n\tdonut: DonutChart,\n};\n\nfunction getChartByType(chartType = 'line', parent, options) {\n\tif (chartType === 'axis-mixed') {\n\t\toptions.type = 'line';\n\t\treturn new AxisChart(parent, options);\n\t}\n\n\tif (!chartTypes[chartType]) {\n\t\tconsole.error(\"Undefined chart type: \" + chartType);\n\t\treturn;\n\t}\n\n\treturn new chartTypes[chartType](parent, options);\n}\n\nclass Chart {\n\tconstructor(parent, options) {\n\t\treturn getChartByType(options.type, parent, options);\n\t}\n}\n\nexport { Chart, PercentageChart, PieChart, Heatmap, AxisChart };","import * as Charts from './chart';\n\nlet frappe = { };\n\nfrappe.NAME = 'Frappe Charts';\nfrappe.VERSION = '1.6.2';\n\nfrappe = Object.assign({ }, frappe, Charts);\n\nexport default frappe;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\tflarum.reg._webpack_runtimes[\"flarum-statistics\"] ||= __webpack_require__;// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/DashboardPage');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/DashboardWidget');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/abbreviateNumber');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport DashboardWidget from 'flarum/admin/components/DashboardWidget';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Link from 'flarum/common/components/Link';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nexport default class MiniStatisticsWidget extends DashboardWidget {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"entities\", ['users', 'discussions', 'posts']);\n _defineProperty(this, \"lifetimeData\", void 0);\n _defineProperty(this, \"loadingLifetime\", true);\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.loadLifetimeData();\n }\n async loadLifetimeData() {\n this.loadingLifetime = true;\n m.redraw();\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'lifetime'\n }\n });\n this.lifetimeData = data;\n this.loadingLifetime = false;\n m.redraw();\n }\n className() {\n return 'StatisticsWidget StatisticsWidget--mini';\n }\n content() {\n return m(\"div\", {\n className: \"StatisticsWidget-table\"\n }, m(\"h4\", {\n className: \"StatisticsWidget-title\"\n }, app.translator.trans('flarum-statistics.admin.statistics.mini_heading')), m(\"div\", {\n className: \"StatisticsWidget-entities\"\n }, m(\"div\", {\n className: \"StatisticsWidget-labels\"\n }, m(\"div\", {\n className: \"StatisticsWidget-label\"\n }, app.translator.trans('flarum-statistics.admin.statistics.total_label'))), this.entities.map(entity => {\n const totalCount = this.loadingLifetime ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getTotalCount(entity);\n return m(\"div\", {\n className: \"StatisticsWidget-entity\"\n }, m(\"h3\", {\n className: \"StatisticsWidget-heading\"\n }, app.translator.trans('flarum-statistics.admin.statistics.' + entity + '_heading')), m(\"div\", {\n className: \"StatisticsWidget-total\",\n title: totalCount\n }, this.loadingLifetime ? m(LoadingIndicator, {\n display: \"inline\"\n }) : abbreviateNumber(totalCount)));\n })), m(\"div\", {\n className: \"StatisticsWidget-viewFull\"\n }, m(Link, {\n href: app.route('extension', {\n id: 'flarum-statistics'\n })\n }, app.translator.trans('flarum-statistics.admin.statistics.view_full'))));\n }\n getTotalCount(entity) {\n return this.lifetimeData[entity];\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/MiniStatisticsWidget', MiniStatisticsWidget);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/SelectDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Placeholder');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/generateElementId');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport generateElementId from 'flarum/common/utils/generateElementId';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport dayjs from 'dayjs';\nimport dayjsUtc from 'dayjs/plugin/utc';\ndayjs.extend(dayjsUtc);\nexport default class StatisticsWidgetDateSelectionModal extends FormModal {\n constructor() {\n super(...arguments);\n /* @ts-expect-error core typings don't allow us to set the type of the state attr :( */\n _defineProperty(this, \"state\", {\n inputs: {\n startDateVal: dayjs().format('YYYY-MM-DD'),\n endDateVal: dayjs().format('YYYY-MM-DD')\n },\n ids: {\n startDate: generateElementId(),\n endDate: generateElementId()\n }\n });\n }\n oninit(vnode) {\n super.oninit(vnode);\n if (this.attrs.value) {\n this.state.inputs = {\n startDateVal: dayjs.utc(this.attrs.value.start * 1000).format('YYYY-MM-DD'),\n endDateVal: dayjs.utc(this.attrs.value.end * 1000).format('YYYY-MM-DD')\n };\n }\n }\n className() {\n return 'StatisticsWidgetDateSelectionModal Modal--small';\n }\n title() {\n return app.translator.trans('flarum-statistics.admin.date_selection_modal.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, this.items().toArray());\n }\n items() {\n const items = new ItemList();\n items.add('intro', m(\"p\", null, app.translator.trans('flarum-statistics.admin.date_selection_modal.description')), 100);\n items.add('date_start', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", {\n htmlFor: this.state.ids.startDate\n }, app.translator.trans('flarum-statistics.admin.date_selection_modal.start_date')), m(\"input\", {\n type: \"date\",\n id: this.state.ids.startDate,\n value: this.state.inputs.startDateVal,\n onchange: this.updateState('startDateVal'),\n className: \"FormControl\"\n })), 90);\n items.add('date_end', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", {\n htmlFor: this.state.ids.endDate\n }, app.translator.trans('flarum-statistics.admin.date_selection_modal.end_date')), m(\"input\", {\n type: \"date\",\n id: this.state.ids.endDate,\n value: this.state.inputs.endDateVal,\n onchange: this.updateState('endDateVal'),\n className: \"FormControl\"\n })), 80);\n items.add('submit', m(Button, {\n className: \"Button Button--primary\",\n type: \"submit\"\n }, app.translator.trans('flarum-statistics.admin.date_selection_modal.submit_button')), 0);\n return items;\n }\n updateState(field) {\n return e => {\n this.state.inputs[field] = e.currentTarget.value;\n };\n }\n submitData() {\n // We force 'zulu' time (UTC)\n return {\n start: Math.floor(+dayjs.utc(this.state.inputs.startDateVal + 'Z') / 1000),\n // Ensures that the end date is the end of the day\n end: Math.floor(+dayjs.utc(this.state.inputs.endDateVal + 'Z').hour(23).minute(59).second(59).millisecond(999) / 1000)\n };\n }\n onsubmit(e) {\n e.preventDefault();\n const data = this.submitData();\n if (data.end < data.start) {\n this.alertAttrs = {\n type: 'error',\n controls: app.translator.trans('flarum-statistics.admin.date_selection_modal.errors.end_before_start')\n };\n return;\n }\n this.attrs.onModalSubmit(data);\n this.hide();\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/StatisticsWidgetDateSelectionModal', StatisticsWidgetDateSelectionModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport Button from 'flarum/common/components/Button';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport extractText from 'flarum/common/utils/extractText';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport Icon from 'flarum/common/components/Icon';\nimport classList from 'flarum/common/utils/classList';\nimport DashboardWidget from 'flarum/admin/components/DashboardWidget';\nimport StatisticsWidgetDateSelectionModal from './StatisticsWidgetDateSelectionModal';\nimport dayjs from 'dayjs';\nimport dayjsUtc from 'dayjs/plugin/utc';\nimport dayjsLocalizedFormat from 'dayjs/plugin/localizedFormat';\n// @ts-expect-error No typings available\nimport { Chart } from 'frappe-charts';\ndayjs.extend(dayjsUtc);\ndayjs.extend(dayjsLocalizedFormat);\nexport default class StatisticsWidget extends DashboardWidget {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"entities\", ['users', 'discussions', 'posts']);\n _defineProperty(this, \"periods\", void 0);\n _defineProperty(this, \"chart\", void 0);\n _defineProperty(this, \"customPeriod\", null);\n _defineProperty(this, \"timedData\", {});\n _defineProperty(this, \"lifetimeData\", void 0);\n _defineProperty(this, \"customPeriodData\", {});\n _defineProperty(this, \"noData\", false);\n _defineProperty(this, \"loadingLifetime\", true);\n _defineProperty(this, \"loadingTimed\", this.entities.reduce((acc, curr) => {\n acc[curr] = 'unloaded';\n return acc;\n }, {}));\n _defineProperty(this, \"loadingCustom\", this.entities.reduce((acc, curr) => {\n acc[curr] = 'unloaded';\n return acc;\n }, {}));\n _defineProperty(this, \"selectedEntity\", 'users');\n _defineProperty(this, \"selectedPeriod\", void 0);\n _defineProperty(this, \"chartEntity\", void 0);\n _defineProperty(this, \"chartPeriod\", void 0);\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.loadLifetimeData();\n }\n async loadLifetimeData() {\n this.loadingLifetime = true;\n m.redraw();\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'lifetime'\n }\n });\n this.lifetimeData = data;\n this.loadingLifetime = false;\n m.redraw();\n }\n async loadTimedData(model) {\n this.loadingTimed[model] = 'loading';\n m.redraw();\n try {\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'timed',\n model\n }\n });\n this.timedData[model] = data;\n this.loadingTimed[model] = 'loaded';\n\n // Create a Date object which represents the start of the day.\n let todayDate = new Date();\n todayDate.setUTCHours(0, 0, 0, 0);\n const today = todayDate.getTime() / 1000;\n this.periods = {\n today: {\n start: today,\n end: today + 86400,\n step: 3600\n },\n last_7_days: {\n start: today - 86400 * 7,\n end: today,\n step: 86400\n },\n previous_7_days: {\n start: today - 86400 * 14,\n end: today - 86400 * 7,\n step: 86400\n },\n last_28_days: {\n start: today - 86400 * 28,\n end: today,\n step: 86400\n },\n previous_28_days: {\n start: today - 86400 * 28 * 2,\n end: today - 86400 * 28,\n step: 86400\n },\n last_12_months: {\n start: today - 86400 * 364,\n end: today,\n step: 86400 * 7\n }\n };\n this.selectedPeriod = 'last_7_days';\n } catch (e) {\n console.error(e);\n this.loadingTimed[model] = 'fail';\n }\n m.redraw();\n }\n async loadCustomRangeData(model) {\n this.loadingCustom[model] = 'loading';\n m.redraw();\n\n // We clone so we can check that the same period is still selected\n // once the HTTP request is complete and the data is to be displayed\n const range = {\n ...this.customPeriod\n };\n try {\n const data = await app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/statistics',\n params: {\n period: 'custom',\n model,\n dateRange: {\n start: range.start,\n end: range.end\n }\n }\n });\n if (JSON.stringify(range) !== JSON.stringify(this.customPeriod)) {\n // The range this method was called with is no longer the selected.\n // Bail out here.\n return;\n }\n this.customPeriodData[model] = data;\n this.loadingCustom[model] = 'loaded';\n m.redraw();\n } catch (e) {\n if (JSON.stringify(range) !== JSON.stringify(this.customPeriod)) {\n // The range this method was called with is no longer the selected.\n // Bail out here.\n return;\n }\n console.error(e);\n this.loadingCustom[model] = 'fail';\n }\n }\n className() {\n return 'StatisticsWidget';\n }\n content() {\n const loadingSelectedEntity = (this.selectedPeriod === 'custom' ? this.loadingCustom : this.loadingTimed)[this.selectedEntity] !== 'loaded';\n const thisPeriod = loadingSelectedEntity ? null : this.selectedPeriod === 'custom' ? {\n start: this.customPeriod?.end,\n end: this.customPeriod?.end,\n step: 86400\n } : this.periods[this.selectedPeriod];\n if (this.selectedPeriod === 'custom') {\n if (!this.customPeriodData[this.selectedEntity] && this.loadingCustom[this.selectedEntity] === 'unloaded') {\n this.loadCustomRangeData(this.selectedEntity);\n }\n } else {\n if (!this.timedData[this.selectedEntity] && this.loadingTimed[this.selectedEntity] === 'unloaded') {\n this.loadTimedData(this.selectedEntity);\n }\n }\n return m(\"div\", {\n className: \"StatisticsWidget-table\"\n }, m(\"div\", {\n className: \"StatisticsWidget-entities\"\n }, m(\"div\", {\n className: \"StatisticsWidget-labels\"\n }, m(\"div\", {\n className: \"StatisticsWidget-label\"\n }, app.translator.trans('flarum-statistics.admin.statistics.total_label')), m(\"div\", {\n className: \"StatisticsWidget-label\"\n }, loadingSelectedEntity ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(SelectDropdown, {\n disabled: loadingSelectedEntity,\n buttonClassName: \"Button Button--text\",\n caretIcon: \"fas fa-caret-down\"\n }, Object.keys(this.periods).map(period => m(Button, {\n key: period,\n active: period === this.selectedPeriod,\n onclick: this.changePeriod.bind(this, period),\n icon: period === this.selectedPeriod ? 'fas fa-check' : true\n }, app.translator.trans(`flarum-statistics.admin.statistics.${period}_label`))).concat([m(Button, {\n key: \"custom\",\n active: this.selectedPeriod === 'custom',\n onclick: () => {\n const attrs = {\n onModalSubmit: dates => {\n if (JSON.stringify(dates) === JSON.stringify(this.customPeriod)) {\n // If same period is selected, don't reload data\n return;\n }\n this.customPeriodData = {};\n Object.keys(this.loadingCustom).forEach(k => this.loadingCustom[k] = 'unloaded');\n this.customPeriod = dates;\n this.changePeriod('custom');\n }\n };\n\n // If we have a custom period set already,\n // let's prefill the modal with it\n if (this.customPeriod) {\n attrs.value = this.customPeriod;\n }\n app.modal.show(StatisticsWidgetDateSelectionModal, attrs);\n },\n icon: this.selectedPeriod === 'custom' ? 'fas fa-check' : true\n }, this.selectedPeriod === 'custom' ? extractText(app.translator.trans(`flarum-statistics.admin.statistics.custom_label_specified`, {\n fromDate: dayjs.utc(this.customPeriod.start * 1000).format('ll'),\n toDate: dayjs.utc(this.customPeriod.end * 1000).format('ll')\n })) : app.translator.trans(`flarum-statistics.admin.statistics.custom_label`))])))), this.entities.map(entity => {\n const totalCount = this.loadingLifetime ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getTotalCount(entity);\n const thisPeriodCount = loadingSelectedEntity ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getPeriodCount(entity, thisPeriod);\n const lastPeriodCount = this.selectedPeriod === 'custom' ? null : loadingSelectedEntity ? app.translator.trans('flarum-statistics.admin.statistics.loading') : this.getPeriodCount(entity, this.getLastPeriod(thisPeriod));\n const periodChange = loadingSelectedEntity || lastPeriodCount === 0 || lastPeriodCount === null ? 0 : (thisPeriodCount - lastPeriodCount) / lastPeriodCount * 100;\n return m(\"button\", {\n className: classList('Button--ua-reset StatisticsWidget-entity', {\n active: this.selectedEntity === entity\n }),\n onclick: this.changeEntity.bind(this, entity)\n }, m(\"h3\", {\n className: \"StatisticsWidget-heading\"\n }, app.translator.trans('flarum-statistics.admin.statistics.' + entity + '_heading')), m(\"div\", {\n className: \"StatisticsWidget-total\",\n title: totalCount\n }, this.loadingLifetime ? m(LoadingIndicator, {\n display: \"inline\"\n }) : abbreviateNumber(totalCount)), m(\"div\", {\n className: \"StatisticsWidget-period\",\n title: thisPeriodCount\n }, loadingSelectedEntity ? m(LoadingIndicator, {\n display: \"inline\"\n }) : abbreviateNumber(thisPeriodCount), periodChange !== 0 && m('[', null, ' ', m(\"span\", {\n className: 'StatisticsWidget-change StatisticsWidget-change--' + (periodChange > 0 ? 'up' : 'down')\n }, m(Icon, {\n name: 'fas fa-arrow-' + (periodChange > 0 ? 'up' : 'down')\n }), Math.abs(periodChange).toFixed(1), \"%\"))));\n })), m('[', null, loadingSelectedEntity ? m(\"div\", {\n key: \"loading\",\n className: \"StatisticsWidget-chart\",\n \"data-loading\": \"true\"\n }, m(LoadingIndicator, {\n size: \"large\"\n })) : m(\"div\", {\n key: \"loaded\",\n className: \"StatisticsWidget-chart\",\n \"data-loading\": \"false\",\n oncreate: this.drawChart.bind(this),\n onupdate: this.drawChart.bind(this)\n })), this.noData && m(Placeholder, {\n text: app.translator.trans(`flarum-statistics.admin.statistics.no_data`)\n }), !this.noData && !!this.chart && m(Button, {\n className: \"StatisticsWidget-chartExport Button\",\n icon: \"fas fa-file-export\",\n onclick: () => {\n this.chart.export();\n }\n }, app.translator.trans('flarum-statistics.admin.statistics.export_chart_button')));\n }\n drawChart(vnode) {\n if (this.chart && this.chartEntity === this.selectedEntity && this.chartPeriod === this.selectedPeriod) {\n return;\n }\n const period = this.selectedPeriod === 'custom' ? {\n start: this.customPeriod?.start,\n end: this.customPeriod?.end,\n step: 86400\n } : this.periods[this.selectedPeriod];\n const periodLength = period.end - period.start;\n const labels = [];\n const thisPeriod = [];\n const lastPeriod = [];\n for (let i = period.start; i < period.end; i += period.step) {\n let label;\n if (period.step < 86400) {\n label = dayjs.unix(i).utc().format('h A');\n } else {\n label = dayjs.unix(i).utc().format('D MMM');\n if (period.step > 86400) {\n label += ' - ' + dayjs.unix(i + period.step - 1).utc().format('D MMM');\n }\n }\n labels.push(label);\n thisPeriod.push(this.getPeriodCount(this.selectedEntity, {\n start: i,\n end: i + period.step\n }));\n lastPeriod.push(this.getPeriodCount(this.selectedEntity, {\n start: i - periodLength,\n end: i - periodLength\n }));\n }\n if (thisPeriod.length === 0) {\n this.noData = true;\n m.redraw();\n return;\n } else {\n this.noData = false;\n m.redraw();\n }\n const datasets = [{\n name: extractText(app.translator.trans('flarum-statistics.admin.statistics.current_period')),\n values: thisPeriod\n }, {\n name: extractText(app.translator.trans('flarum-statistics.admin.statistics.previous_period')),\n values: lastPeriod\n }];\n const data = {\n labels,\n datasets\n };\n\n // If the dom element no longer exists, recreate the chart\n // https://stackoverflow.com/a/2620373/11091039\n if (!this.chart || !(document.compareDocumentPosition(this.chart.parent) & 16)) {\n this.chart = new Chart(vnode.dom, {\n data,\n type: 'line',\n height: 280,\n axisOptions: {\n xAxisMode: 'tick',\n yAxisMode: 'span',\n xIsSeries: true\n },\n lineOptions: {\n hideDots: 1,\n regionFill: 1\n },\n colors: [app.forum.attribute('themePrimaryColor'), 'black']\n });\n } else {\n this.chart.update(data);\n }\n this.chartEntity = this.selectedEntity;\n this.chartPeriod = this.selectedPeriod;\n }\n changeEntity(entity) {\n this.selectedEntity = entity;\n }\n changePeriod(period) {\n this.selectedPeriod = period;\n }\n getTotalCount(entity) {\n return this.lifetimeData[entity];\n }\n getPeriodCount(entity, period) {\n const timed = (this.selectedPeriod === 'custom' ? this.customPeriodData : this.timedData)[entity];\n let count = 0;\n for (const t in timed) {\n const time = parseInt(t);\n if (time >= period.start && time < period.end) {\n count += timed[time];\n }\n }\n return count;\n }\n getLastPeriod(thisPeriod) {\n return {\n start: thisPeriod.start - (thisPeriod.end - thisPeriod.start),\n end: thisPeriod.start\n };\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/StatisticsWidget', StatisticsWidget);","import ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport StatisticsWidget from './StatisticsWidget';\nexport default class StatisticsPage extends ExtensionPage {\n content() {\n return m(\"div\", {\n className: \"StatisticsPage\"\n }, m(\"div\", {\n className: \"container\"\n }, m(StatisticsWidget, null)));\n }\n}\nflarum.reg.add('flarum-statistics', 'admin/components/StatisticsPage', StatisticsPage);","import Extend from 'flarum/common/extenders';\nimport StatisticsPage from './components/StatisticsPage';\nexport default [new Extend.Admin().page(StatisticsPage)];","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport DashboardPage from 'flarum/admin/components/DashboardPage';\nimport MiniStatisticsWidget from './components/MiniStatisticsWidget';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-statistics', () => {\n extend(DashboardPage.prototype, 'availableWidgets', function (widgets) {\n widgets.add('statistics', m(MiniStatisticsWidget, null), 20);\n });\n});"],"names":["module","exports","e","n","r","i","s","u","a","o","c","f","h","d","l","$","y","M","name","weekdays","split","months","ordinal","t","m","String","length","Array","join","v","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","g","S","_","O","args","arguments","b","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","meridiem","monthsShort","weekdaysMin","weekdaysShort","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","k","forEach","extend","$i","isDayjs","en","Ls","LTS","LT","L","LL","LLL","LLLL","formats","toUpperCase","call","local","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","document","querySelector","getBoundingClientRect","top","documentElement","scrollTop","body","left","scrollLeft","titleHeight","margins","paddings","bottom","legendHeight","right","parseFloat","toFixed","fill","concat","sin","Zt","cos","isNaN","isFinite","Ft","isArray","push","sqrt","pow","angle","atan2","PI","reduce","A","ie","parseInt","T","createElementNS","appendChild","parentNode","insertBefore","Object","keys","map","style","textContent","setAttribute","inside","offset","N","className","transform","styles","stroke","j","id","x1","x2","y1","y2","H","width","height","rx","Y","fontSize","re","dy","le","textAnchor","innerHTML","V","oe","lineType","shortenNumbers","log10","ae","G","pos","mode","ne","B","ve","tt","pe","it","zeroLine","Vt","nodeName","childNodes","ce","getAttribute","st","rt","cloneNode","attributeName","from","to","begin","dur","values","keySplines","ge","keyTimes","calcMode","type","ot","webkitTransform","msTransform","mozTransform","oTransform","lt","Ut","replaceChild","ct","classList","create","me","firstChild","dt","setMinutes","pt","ft","vt","xt","we","ke","gt","xe","mt","yt","Ae","bt","kt","setDate","wt","Le","filter","includes","assign","constants","getData","Te","At","mantissa","exponent","Tt","Pt","Mt","Dt","scaleMultiplier","Et","insertAt","head","getElementsByTagName","createElement","styleSheet","cssText","createTextNode","Symbol","iterator","constructor","Ht","value","Promise","resolve","then","done","reject","next","key","arg","_invoke","return","asyncIterator","throw","TypeError","It","enumerable","configurable","writable","defineProperty","Rt","Function","getOwnPropertyDescriptor","getPrototypeOf","Yt","setPrototypeOf","__proto__","Bt","ReferenceError","Gt","baseHeight","titleFontSize","Xt","Jt","Kt","$t","Qt","bar","line","pie","percentage","heatmap","donut","te","parent","colors","titleName","titleValue","listValues","titleValueFirst","setup","makeTooltip","calcPosition","container","hideTip","title","dataPointList","addEventListener","index","formatted","offsetWidth","offsetHeight","valueFirst","refresh","opacity","ee","blue","violet","red","orange","yellow","green","purple","magenta","black","grey","exec","se","ue","dot","heat_square","he","attributes","specified","nodeValue","de","fe","ease","linear","easein","easeout","easeinout","ye","HTMLElement","Error","rawChartArgs","realData","prepareData","data","prepareFirstData","validateColors","config","showTooltip","showLegend","isNavigable","animate","truncateLegends","measures","JSON","stringify","setMeasures","argHeight","state","options","initTimeout","overlays","configure","P","console","warn","boundDrawFn","draw","ResizeObserver","resizeObserver","observe","window","disconnect","removeEventListener","makeContainer","updateWidth","independentWidth","tip","bindTooltip","offsetParent","calc","makeChartArea","setupComponents","components","drawArea","render","setTimeout","update","renderLegend","setupNavigation","baseWidth","getComputedStyle","paddingLeft","paddingRight","clientWidth","svg","removeChild","C","svgDefs","titleEL","legendArea","updateTipOffset","Map","error","ut","make","updateNav","makeOverlay","bindUnits","bindOverlay","keyActions","onEnterKey","bind","onLeftArrow","onUpArrow","onRightArrow","onDownArrow","innerHeight","clientHeight","innerWidth","event","keyCode","Blob","URL","createObjectURL","href","download","click","revokeObjectURL","ht","be","formatTooltipY","tooltipOptions","maxSlices","maxLegendPoints","sliceTotals","labels","datasets","sort","grandTotal","center","legendTotals","cx","cy","dx","R","Pe","layerClass","layerTransform","makeElements","animateElements","store","layer","oldData","donutSlices","sliceStrings","strokeWidth","transition","pieSlices","percentageBars","xPositions","F","widths","barHeight","barDepth","yAxis","positions","U","xAxis","calcLabels","Z","yMarkers","labelPos","q","position","label","yRegions","X","startPos","endPos","et","heatDomain","colWidth","rowHeight","squareSize","radius","xTranslate","serializedSubDomains","cols","yyyyMmDd","dataValue","barGraph","unitType","units","yPositions","minHeight","J","barWidth","color","offsets","barsWidth","lineGraph","paths","hideLine","spline","heatline","path","regionFill","region","hideDots","K","valuesOverPoints","at","nt","Oe","barOptions","depth","target","indexOf","formattedLabels","setValues","showTip","Me","mouseMove","mouseLeave","hoverRadio","startAngle","clockWise","slicesProperties","startPosition","endPosition","E","total","endAngle","calTranslateByAngle","pageX","pageY","formatted_labels","curActiveSliceIndex","curActiveSlice","hoverSlice","Ce","countLabel","startSubDomain","startSubDomainIndex","discreteDomains","start","end","noOfWeeks","setFullYear","dataPoints","firstWeekStart","distribution","max","St","domainConfigs","getDomains","getDomainConfig","getCol","getSubDomainConfig","De","lineOptions","axisOptions","xAxisMode","yAxisMode","xIsSeries","shortenYAxisNumbers","formatTooltipX","chartType","_t","zt","calcXPositions","calcYAxisParameters","getAllYValues","makeDataByIndex","datasetLength","unitWidth","xOffset","unshift","reverse","Lt","Ct","Ot","calcDatasetPoints","calcYExtremes","calcYRegions","cumulativeYs","cumulativeYPos","stacked","yExtremes","Wt","spaceRatio","dotSize","dataUnitComponents","dataByIndex","yPos","formattedLabel","xPos","yExtreme","mapTooltipXPosition","Nt","I","overlayGuides","overlay","currentIndex","updateOverlay","setCurrentDataPoint","createEvent","initEvent","dispatchEvent","getDataPoint","splice","Ne","W","Se","_e","freeze","Chart","jt","PercentageChart","PieChart","Heatmap","AxisChart","ze","__webpack_module_cache__","__webpack_require__","moduleId","flarum","reg","_webpack_runtimes","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","obj","prop","hasOwnProperty","toStringTag","_typeof","_defineProperty","toPrimitive","toPropertyKey","MiniStatisticsWidget","super","oncreate","vnode","loadLifetimeData","loadingLifetime","redraw","method","url","attribute","params","period","lifetimeData","content","trans","entities","entity","totalCount","getTotalCount","display","StatisticsWidgetDateSelectionModal","inputs","startDateVal","endDateVal","ids","startDate","endDate","oninit","attrs","items","toArray","htmlFor","onchange","updateState","field","currentTarget","submitData","hour","minute","second","millisecond","onsubmit","preventDefault","alertAttrs","controls","onModalSubmit","hide","StatisticsWidget","acc","curr","loadTimedData","model","loadingTimed","timedData","todayDate","setUTCHours","today","periods","step","last_7_days","previous_7_days","last_28_days","previous_28_days","last_12_months","selectedPeriod","loadCustomRangeData","loadingCustom","range","customPeriod","dateRange","customPeriodData","loadingSelectedEntity","selectedEntity","thisPeriod","size","disabled","buttonClassName","caretIcon","active","onclick","changePeriod","icon","dates","show","fromDate","thisPeriodCount","getPeriodCount","lastPeriodCount","getLastPeriod","periodChange","changeEntity","drawChart","onupdate","noData","text","chart","export","chartEntity","chartPeriod","periodLength","lastPeriod","compareDocumentPosition","dom","timed","count","time","StatisticsPage","page","widgets"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/suspend/js/dist/forum.js b/extensions/suspend/js/dist/forum.js index ae11f9d191..a17f7f4b5b 100644 --- a/extensions/suspend/js/dist/forum.js +++ b/extensions/suspend/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,s="millisecond",n="second",r="minute",a="hour",u="day",i="week",o="month",l="quarter",c="year",d="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],s=t%100;return"["+t+(e[(s-20)%10]||e[s]||e[0])+"]"}},g=function(t,e,s){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(s)+t},$={s:g,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),n=Math.floor(s/60),r=s%60;return(e<=0?"+":"-")+g(n,2,"0")+":"+g(r,2,"0")},m:function t(e,s){if(e.date()1)return t(u[0])}else{var i=e.name;y[i]=e,r=i}return!n&&r&&(v=r),r||!n&&v},D=function(t,e){if(M(t))return t.clone();var s="object"==typeof e?e:{};return s.date=t,s.args=arguments,new w(s)},_=$;_.l=S,_.i=M,_.w=function(t,e){return D(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var w=function(){function p(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var g=p.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,s=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(m);if(n){var r=n[2]-1||0,a=(n[7]||"0").substring(0,3);return s?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return _},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(t,e){var s=D(t);return this.startOf(e)<=s&&s<=this.endOf(e)},g.isAfter=function(t,e){return D(t){var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{extend:()=>E});const t=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","forum/app");var r=s.n(e);const a=flarum.reg.get("core","forum/utils/UserControls");var u=s.n(a);const i=flarum.reg.get("core","common/components/Button");var o=s.n(i);const l=flarum.reg.get("core","common/components/Badge");var c=s.n(l);const d=flarum.reg.get("core","common/models/User");var f=s.n(d);const h=flarum.reg.get("core","common/components/FormModal");var p=s.n(h);const g=flarum.reg.get("core","common/utils/Stream");var $=s.n(g);const v=flarum.reg.get("core","common/utils/withAttr");var y=s.n(v);const b=flarum.reg.get("core","common/utils/ItemList");var M=s.n(b);const S=flarum.reg.get("core","common/components/Form");var D=s.n(S);const _=flarum.reg.get("core","common/components/FieldSet");var w=s.n(_),x=s(720),O=s.n(x),k=s(153),T=s.n(k);function U(){return new Date("2038-01-01")}function N(t){return O().utc(t).isSame(O().utc("2038-01-01"))}O().extend(T()),flarum.reg.add("flarum-suspend","forum/helpers/suspensionHelper",{getPermanentSuspensionDate:U,isPermanentSuspensionDate:N,localStorageKey:function(){return"flarum-suspend.acknowledge-suspension"}});class C extends(p()){oninit(t){super.oninit(t);let e=this.attrs.user.suspendedUntil();const s=this.attrs.user.suspendReason(),n=this.attrs.user.suspendMessage();let r=null;new Date>e&&(e=null),e&&(r=9999===e.getFullYear()?"indefinitely":"limited"),this.status=$()(r),this.reason=$()(s),this.message=$()(n),this.daysRemaining=$()("limited"===r&&1-dayjs().diff(e,"days"))}className(){return"SuspendUserModal Modal--medium"}title(){return r().translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.attrs.user})}content(){return m("div",{className:"Modal-body"},m(D(),null,this.formItems().toArray(),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary",loading:this.loading,type:"submit"},r().translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))}radioItems(){const t=new(M());return t.add("not-suspended",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:y()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),100),t.add("indefinitely",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:y()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),90),t.add("time-suspension",m("label",{className:"checkbox SuspendUserModal-days"},m("input",{type:"radio",name:"status",checked:"limited"===this.status(),value:"limited",onclick:t=>{this.status(t.target.value),m.redraw.sync(),this.$(".SuspendUserModal-days-input input").select(),t.redraw=!1}}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_label"),"limited"===this.status()&&m("div",{className:"SuspendUserModal-days-input"},m("input",{type:"number",min:"0",value:this.daysRemaining(),oninput:y()("value",this.daysRemaining),className:"FormControl"}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text"))),80),t}formItems(){const t=new(M());return t.add("radioItems",m(w(),{label:r().translator.trans("flarum-suspend.forum.suspend_user.status_heading")},this.radioItems().toArray()),100),t.add("reason",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.reason")),m("textarea",{className:"FormControl",bidi:this.reason,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),90),t.add("message",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.display_message")),m("textarea",{className:"FormControl",bidi:this.message,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),80),t}onsubmit(t){t.preventDefault(),this.loading=!0;let e=null;switch(this.status()){case"indefinitely":e=U();break;case"limited":e=dayjs().add(this.daysRemaining(),"days").toDate()}this.attrs.user.save({suspendedUntil:e,suspendReason:this.reason(),suspendMessage:this.message()}).then((()=>this.hide()),this.loaded.bind(this))}}flarum.reg.add("flarum-suspend","forum/components/SuspendUserModal",C);const Y=flarum.reg.get("core","common/components/Modal");var I=s.n(Y);const F=flarum.reg.get("core","common/helpers/fullTime");var H=s.n(F);class j extends(I()){oninit(t){super.oninit(t),this.message=this.attrs.message,this.until=this.attrs.until}className(){return"SuspensionInfoModal Modal"}title(){return r().translator.trans("flarum-suspend.forum.suspension_info.title")}content(){const t=N(new Date(this.until))?r().translator.trans("flarum-suspend.forum.suspension_info.indefinite"):r().translator.trans("flarum-suspend.forum.suspension_info.limited",{date:H()(this.until)});return m("div",{className:"Modal-body"},m(D(),{className:"Form--centered"},m("p",{className:"helpText"},this.message),m("p",{className:"helpText"},t),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r().translator.trans("flarum-suspend.forum.suspension_info.dismiss_button")))))}hide(){localStorage.setItem("flarum-suspend.acknowledge-suspension",this.attrs.until.getTime()),this.attrs.state.close()}}flarum.reg.add("flarum-suspend","forum/components/SuspensionInfoModal",j);const L=flarum.reg.get("core","common/extenders");var A=s.n(L);const W=flarum.reg.get("core","common/Model");var B=s.n(W);const R=flarum.reg.get("core","common/app");var P=s.n(R);const z=flarum.reg.get("core","common/query/IGambit");class Z extends z.BooleanGambit{key(){return P().translator.trans("flarum-suspend.lib.gambits.users.suspended.key",{},!0)}filterKey(){return"suspended"}enabled(){return!!P().session.user&&P().forum.attribute("canSuspendUsers")}}flarum.reg.add("flarum-suspend","common/query/users/SuspendedGambit",Z);const J=[(new(A().Search)).gambit("users",Z),new(A().Model)(f()).attribute("canSuspend")],q=flarum.reg.get("core","forum/components/Notification");var G=s.n(q);class V extends(G()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){const t=this.attrs.notification,e=t.content(),s=dayjs(e).from(t.createdAt(),!0);return N(e)?r().translator.trans("flarum-suspend.forum.notifications.user_suspended_indefinite_text"):r().translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{timeReadable:s})}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserSuspendedNotification",V);class K extends(G()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){return this.attrs.notification,r().translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text")}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserUnsuspendedNotification",K);const E=[...J,(new(A().Notification)).add("userSuspended",V).add("userUnsuspended",K),new(A().Model)(f()).attribute("suspendedUntil",B().transformDate).attribute("suspendReason").attribute("suspendMessage")];r().initializers.add("flarum-suspend",(()=>{(0,t.extend)(u(),"moderationControls",((t,e)=>{e.canSuspend()&&t.add("suspend",m(o(),{icon:"fas fa-ban",onclick:()=>r().modal.show(C,{user:e})},r().translator.trans("flarum-suspend.forum.user_controls.suspend_button")))})),(0,t.extend)(f().prototype,"badges",(function(t){const e=this.suspendedUntil();new Date{if(r().session.user){const t=r().session.user.suspendMessage(),e=r().session.user.suspendedUntil(),s=t&&e&&new Date{var t={720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,s="millisecond",n="second",r="minute",a="hour",u="day",i="week",o="month",l="quarter",c="year",d="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],s=t%100;return"["+t+(e[(s-20)%10]||e[s]||e[0])+"]"}},g=function(t,e,s){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(s)+t},$={s:g,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),n=Math.floor(s/60),r=s%60;return(e<=0?"+":"-")+g(n,2,"0")+":"+g(r,2,"0")},m:function t(e,s){if(e.date()1)return t(u[0])}else{var i=e.name;y[i]=e,r=i}return!n&&r&&(v=r),r||!n&&v},_=function(t,e){if(M(t))return t.clone();var s="object"==typeof e?e:{};return s.date=t,s.args=arguments,new w(s)},D=$;D.l=S,D.i=M,D.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var w=function(){function p(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var g=p.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,s=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(m);if(n){var r=n[2]-1||0,a=(n[7]||"0").substring(0,3);return s?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return D},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(t,e){var s=_(t);return this.startOf(e)<=s&&s<=this.endOf(e)},g.isAfter=function(t,e){return _(t){var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{extend:()=>E});const t=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","forum/app");var r=s.n(e);const a=flarum.reg.get("core","forum/utils/UserControls");var u=s.n(a);const i=flarum.reg.get("core","common/components/Button");var o=s.n(i);const l=flarum.reg.get("core","common/components/Badge");var c=s.n(l);const d=flarum.reg.get("core","common/models/User");var f=s.n(d);const h=flarum.reg.get("core","common/components/FormModal");var p=s.n(h);const g=flarum.reg.get("core","common/utils/Stream");var $=s.n(g);const v=flarum.reg.get("core","common/utils/withAttr");var y=s.n(v);const b=flarum.reg.get("core","common/utils/ItemList");var M=s.n(b);const S=flarum.reg.get("core","common/components/Form");var _=s.n(S);const D=flarum.reg.get("core","common/components/FieldSet");var w=s.n(D),x=s(720),O=s.n(x),k=s(153),T=s.n(k);function U(){return new Date("2038-01-01")}function N(t){return O().utc(t).isSame(O().utc("2038-01-01"))}O().extend(T()),flarum.reg.add("flarum-suspend","forum/helpers/suspensionHelper",{getPermanentSuspensionDate:U,isPermanentSuspensionDate:N,localStorageKey:function(){return"flarum-suspend.acknowledge-suspension"}});class C extends(p()){oninit(t){super.oninit(t);let e=this.attrs.user.suspendedUntil();const s=this.attrs.user.suspendReason(),n=this.attrs.user.suspendMessage();let r=null;new Date>e&&(e=null),e&&(r=9999===e.getFullYear()?"indefinitely":"limited"),this.status=$()(r),this.reason=$()(s),this.message=$()(n),this.daysRemaining=$()("limited"===r&&1-dayjs().diff(e,"days"))}className(){return"SuspendUserModal Modal--medium"}title(){return r().translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.attrs.user})}content(){return m("div",{className:"Modal-body"},m(_(),null,this.formItems().toArray(),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary",loading:this.loading,type:"submit"},r().translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))}radioItems(){const t=new(M());return t.add("not-suspended",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:y()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),100),t.add("indefinitely",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:y()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),90),t.add("time-suspension",m("label",{className:"checkbox SuspendUserModal-days"},m("input",{type:"radio",name:"status",checked:"limited"===this.status(),value:"limited",onclick:t=>{this.status(t.target.value),m.redraw.sync(),this.$(".SuspendUserModal-days-input input").select(),t.redraw=!1}}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_label"),"limited"===this.status()&&m("div",{className:"SuspendUserModal-days-input"},m("input",{type:"number",min:"0",value:this.daysRemaining(),oninput:y()("value",this.daysRemaining),className:"FormControl"}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text"))),80),t}formItems(){const t=new(M());return t.add("radioItems",m(w(),{label:r().translator.trans("flarum-suspend.forum.suspend_user.status_heading")},this.radioItems().toArray()),100),t.add("reason",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.reason")),m("textarea",{className:"FormControl",bidi:this.reason,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),90),t.add("message",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.display_message")),m("textarea",{className:"FormControl",bidi:this.message,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),80),t}onsubmit(t){t.preventDefault(),this.loading=!0;let e=null;switch(this.status()){case"indefinitely":e=U();break;case"limited":e=dayjs().add(this.daysRemaining(),"days").toDate()}this.attrs.user.save({suspendedUntil:e,suspendReason:this.reason(),suspendMessage:this.message()}).then((()=>this.hide()),this.loaded.bind(this))}}flarum.reg.add("flarum-suspend","forum/components/SuspendUserModal",C);const Y=flarum.reg.get("core","common/components/Modal");var I=s.n(Y);const F=flarum.reg.get("core","common/helpers/fullTime");var H=s.n(F);class j extends(I()){oninit(t){super.oninit(t),this.message=this.attrs.message,this.until=this.attrs.until}className(){return"SuspensionInfoModal Modal"}title(){return r().translator.trans("flarum-suspend.forum.suspension_info.title")}content(){const t=N(new Date(this.until))?r().translator.trans("flarum-suspend.forum.suspension_info.indefinite"):r().translator.trans("flarum-suspend.forum.suspension_info.limited",{date:H()(this.until)});return m("div",{className:"Modal-body"},m(_(),{className:"Form--centered"},m("p",{className:"helpText"},this.message),m("p",{className:"helpText"},t),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r().translator.trans("flarum-suspend.forum.suspension_info.dismiss_button")))))}hide(){localStorage.setItem("flarum-suspend.acknowledge-suspension",this.attrs.until.getTime()),this.attrs.state.close()}}flarum.reg.add("flarum-suspend","forum/components/SuspensionInfoModal",j);const L=flarum.reg.get("core","common/extenders");var A=s.n(L);const W=flarum.reg.get("core","common/Model");var B=s.n(W);const R=flarum.reg.get("core","common/app");var P=s.n(R);const z=flarum.reg.get("core","common/query/IGambit");class Z extends z.BooleanGambit{key(){return P().translator.trans("flarum-suspend.lib.gambits.users.suspended.key",{},!0)}filterKey(){return"suspended"}enabled(){return!!P().session.user&&P().forum.attribute("canSuspendUsers")}}flarum.reg.add("flarum-suspend","common/query/users/SuspendedGambit",Z);const J=[(new(A().Search)).gambit("users",Z),new(A().Model)(f()).attribute("canSuspend")],q=flarum.reg.get("core","forum/components/Notification");var G=s.n(q);class V extends(G()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){const t=this.attrs.notification,e=t.content(),s=dayjs(e).from(t.createdAt(),!0);return N(e)?r().translator.trans("flarum-suspend.forum.notifications.user_suspended_indefinite_text"):r().translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{timeReadable:s})}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserSuspendedNotification",V);class K extends(G()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){return this.attrs.notification,r().translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text")}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserUnsuspendedNotification",K);const E=[...J,(new(A().Notification)).add("userSuspended",V).add("userUnsuspended",K),new(A().Model)(f()).attribute("suspendedUntil",B().transformDate).attribute("suspendReason").attribute("suspendMessage")];r().initializers.add("flarum-suspend",(()=>{(0,t.extend)(u(),"moderationControls",((t,e)=>{e.canSuspend()&&t.add("suspend",m(o(),{icon:"fas fa-ban",onclick:()=>r().modal.show(C,{user:e})},r().translator.trans("flarum-suspend.forum.user_controls.suspend_button")))})),(0,t.extend)(f().prototype,"badges",(function(t){const e=this.suspendedUntil();new Date{if(r().session.user){const t=r().session.user.suspendMessage(),e=r().session.user.suspendedUntil(),s=t&&e&&new Date=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/UserControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FieldSet');","import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\ndayjs.extend(utc);\nexport function getPermanentSuspensionDate() {\n return new Date('2038-01-01');\n}\nexport function isPermanentSuspensionDate(date) {\n return dayjs.utc(date).isSame(dayjs.utc('2038-01-01'));\n}\nexport function localStorageKey() {\n return 'flarum-suspend.acknowledge-suspension';\n}\nflarum.reg.add('flarum-suspend', 'forum/helpers/suspensionHelper', { getPermanentSuspensionDate: getPermanentSuspensionDate,isPermanentSuspensionDate: isPermanentSuspensionDate,localStorageKey: localStorageKey, });","import app from 'flarum/forum/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Form from 'flarum/common/components/Form';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport { getPermanentSuspensionDate } from '../helpers/suspensionHelper';\nexport default class SuspendUserModal extends FormModal {\n oninit(vnode) {\n super.oninit(vnode);\n let until = this.attrs.user.suspendedUntil();\n const reason = this.attrs.user.suspendReason();\n const message = this.attrs.user.suspendMessage();\n let status = null;\n if (new Date() > until) until = null;\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';else status = 'limited';\n }\n this.status = Stream(status);\n this.reason = Stream(reason);\n this.message = Stream(message);\n this.daysRemaining = Stream(status === 'limited' && -dayjs().diff(until, 'days') + 1);\n }\n className() {\n return 'SuspendUserModal Modal--medium';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', {\n user: this.attrs.user\n });\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.formItems().toArray(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n type: \"submit\"\n }, app.translator.trans('flarum-suspend.forum.suspend_user.submit_button')))));\n }\n radioItems() {\n const items = new ItemList();\n items.add('not-suspended', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: !this.status(),\n value: \"\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.not_suspended_label')), 100);\n items.add('indefinitely', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'indefinitely',\n value: \"indefinitely\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.indefinitely_label')), 90);\n items.add('time-suspension', m(\"label\", {\n className: \"checkbox SuspendUserModal-days\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'limited',\n value: \"limited\",\n onclick: e => {\n this.status(e.target.value);\n m.redraw.sync();\n this.$('.SuspendUserModal-days-input input').select();\n e.redraw = false;\n }\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_label'), this.status() === 'limited' && m(\"div\", {\n className: \"SuspendUserModal-days-input\"\n }, m(\"input\", {\n type: \"number\",\n min: \"0\",\n value: this.daysRemaining(),\n oninput: withAttr('value', this.daysRemaining),\n className: \"FormControl\"\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_days_text'))), 80);\n return items;\n }\n formItems() {\n const items = new ItemList();\n items.add('radioItems', m(FieldSet, {\n label: app.translator.trans('flarum-suspend.forum.suspend_user.status_heading')\n }, this.radioItems().toArray()), 100);\n items.add('reason', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.reason')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.reason,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 90);\n items.add('message', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.display_message')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.message,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 80);\n return items;\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = getPermanentSuspensionDate();\n break;\n case 'limited':\n suspendedUntil = dayjs().add(this.daysRemaining(), 'days').toDate();\n break;\n default:\n // no default\n }\n this.attrs.user.save({\n suspendedUntil,\n suspendReason: this.reason(),\n suspendMessage: this.message()\n }).then(() => this.hide(), this.loaded.bind(this));\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspendUserModal', SuspendUserModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/fullTime');","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport fullTime from 'flarum/common/helpers/fullTime';\nimport Form from 'flarum/common/components/Form';\nimport { isPermanentSuspensionDate, localStorageKey } from '../helpers/suspensionHelper';\nexport default class SuspensionInfoModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.message = this.attrs.message;\n this.until = this.attrs.until;\n }\n className() {\n return 'SuspensionInfoModal Modal';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspension_info.title');\n }\n content() {\n const timespan = isPermanentSuspensionDate(new Date(this.until)) ? app.translator.trans('flarum-suspend.forum.suspension_info.indefinite') : app.translator.trans('flarum-suspend.forum.suspension_info.limited', {\n date: fullTime(this.until)\n });\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"p\", {\n className: \"helpText\"\n }, this.message), m(\"p\", {\n className: \"helpText\"\n }, timespan), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n onclick: this.hide.bind(this)\n }, app.translator.trans('flarum-suspend.forum.suspension_info.dismiss_button')))));\n }\n hide() {\n localStorage.setItem(localStorageKey(), this.attrs.until.getTime());\n this.attrs.state.close();\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspensionInfoModal', SuspensionInfoModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SuspendedGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-suspend.lib.gambits.users.suspended.key', {}, true);\n }\n filterKey() {\n return 'suspended';\n }\n enabled() {\n return !!app.session.user && app.forum.attribute('canSuspendUsers');\n }\n}\nflarum.reg.add('flarum-suspend', 'common/query/users/SuspendedGambit', SuspendedGambit);","import Extend from 'flarum/common/extenders';\nimport SuspendedGambit from './query/users/SuspendedGambit';\nimport User from 'flarum/common/models/User';\n\n// prettier-ignore\nexport default [new Extend.Search().gambit('users', SuspendedGambit), new Extend.Model(User).attribute('canSuspend')];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { isPermanentSuspensionDate } from '../helpers/suspensionHelper';\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n const suspendedUntil = notification.content();\n const timeReadable = dayjs(suspendedUntil).from(notification.createdAt(), true);\n return isPermanentSuspensionDate(suspendedUntil) ? app.translator.trans('flarum-suspend.forum.notifications.user_suspended_indefinite_text') : app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n timeReadable\n });\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserSuspendedNotification', UserSuspendedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text');\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserUnsuspendedNotification', UserUnsuspendedNotification);","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nimport Model from 'flarum/common/Model';\nimport commonExtend from '../common/extend';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nexport default [...commonExtend, new Extend.Notification() //\n.add('userSuspended', UserSuspendedNotification).add('userUnsuspended', UserUnsuspendedNotification), new Extend.Model(User).attribute('suspendedUntil', Model.transformDate).attribute('suspendReason').attribute('suspendMessage')];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\nimport Badge from 'flarum/common/components/Badge';\nimport User from 'flarum/common/models/User';\nimport SuspendUserModal from './components/SuspendUserModal';\nimport checkForSuspension from './checkForSuspension';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-suspend', () => {\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add('suspend', m(Button, {\n icon: \"fas fa-ban\",\n onclick: () => app.modal.show(SuspendUserModal, {\n user\n })\n }, app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')));\n }\n });\n extend(User.prototype, 'badges', function (items) {\n const until = this.suspendedUntil();\n if (new Date() < until) {\n items.add('suspended', m(Badge, {\n icon: \"fas fa-ban\",\n type: \"suspended\",\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')\n }), 100);\n }\n });\n checkForSuspension();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport { localStorageKey } from './helpers/suspensionHelper';\nexport default function () {\n return setTimeout(() => {\n if (app.session.user) {\n const message = app.session.user.suspendMessage();\n const until = app.session.user.suspendedUntil();\n const isSuspended = message && until && new Date() < until;\n const alreadyDisplayed = localStorage.getItem(localStorageKey()) === until?.getTime().toString();\n if (isSuspended && !alreadyDisplayed) {\n app.modal.show(SuspensionInfoModal, {\n message,\n until\n });\n } else if (localStorage.getItem(localStorageKey())) {\n localStorage.removeItem(localStorageKey());\n }\n }\n }, 0);\n}"],"names":["module","exports","e","n","r","i","s","u","a","o","c","f","h","d","l","$","y","M","name","weekdays","split","months","ordinal","t","m","String","length","Array","join","v","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","g","S","_","O","args","arguments","b","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","meridiem","monthsShort","weekdaysMin","weekdaysShort","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","k","forEach","extend","$i","isDayjs","en","Ls","local","call","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","key","Object","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","reg","getPermanentSuspensionDate","isPermanentSuspensionDate","localStorageKey","SuspendUserModal","oninit","vnode","super","until","attrs","user","suspendedUntil","reason","suspendReason","message","suspendMessage","status","daysRemaining","dayjs","className","title","trans","content","formItems","toArray","loading","type","radioItems","items","checked","onclick","target","redraw","sync","select","oninput","label","bidi","placeholder","rows","onsubmit","preventDefault","save","then","hide","loaded","bind","SuspensionInfoModal","timespan","localStorage","setItem","state","close","SuspendedGambit","BooleanGambit","filterKey","enabled","attribute","gambit","UserSuspendedNotification","icon","href","notification","subject","timeReadable","from","createdAt","excerpt","UserUnsuspendedNotification","canSuspend","show","setTimeout","isSuspended","alreadyDisplayed","getItem","removeItem"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"6BAAoEA,EAAOC,QAAmI,WAAW,aAAa,IAAUC,EAAE,IAAIC,EAAE,KAAKC,EAAE,cAAcC,EAAE,SAASC,EAAE,S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U,iBAAiBA,UAAU,mBCEnN,iBAAiBvL,IAAI,kBAAkB,MACrC,IAAAwF,QAAO,IAAc,sBAAsB,CAACkE,EAAOlB,KAC7CA,EAAK2D,cACPzC,EAAM1J,IAAI,UAAWf,EAAE,IAAQ,CAC7ByM,KAAM,aACN9B,QAAS,IAAM,UAAUwC,KAAKlE,EAAkB,CAC9CM,UAED,eAAeW,MAAM,sDAC1B,KAEF,IAAA3D,QAAO,cAAgB,UAAU,SAAUkE,GACzC,MAAMpB,EAAQ/G,KAAKkH,iBACf,IAAI9G,KAAS2G,GACfoB,EAAM1J,IAAI,YAAaf,EAAE,IAAO,CAC9ByM,KAAM,aACNlC,KAAM,YACNU,MAAO,eAAef,MAAM,uDAC1B,IAER,ICzBOkD,YAAW,KAChB,GAAI,YAAY7D,KAAM,CACpB,MAAMI,EAAU,YAAYJ,KAAKK,iBAC3BP,EAAQ,YAAYE,KAAKC,iBACzB6D,EAAc1D,GAAWN,GAAS,IAAI3G,KAAS2G,EAC/CiE,EAAmBxB,aAAayB,QhBCnC,2CgBDkElE,GAAOxE,UAAUV,WAClFkJ,IAAgBC,EAClB,UAAUH,KAAKvB,EAAqB,CAClCjC,UACAN,UAEOyC,aAAayB,QhBLrB,0CgBMDzB,aAAa0B,WhBNZ,wCgBQL,IACC,EDWiB,G","sources":["webpack://@flarum/suspend/../../../node_modules/dayjs/dayjs.min.js","webpack://@flarum/suspend/../../../node_modules/dayjs/plugin/utc.js","webpack://@flarum/suspend/webpack/bootstrap","webpack://@flarum/suspend/webpack/runtime/compat get default export","webpack://@flarum/suspend/webpack/runtime/define property getters","webpack://@flarum/suspend/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/suspend/webpack/runtime/make namespace object","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'forum/utils/UserControls')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/FieldSet')\"","webpack://@flarum/suspend/./src/forum/helpers/suspensionHelper.ts","webpack://@flarum/suspend/./src/forum/components/SuspendUserModal.js","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/helpers/fullTime')\"","webpack://@flarum/suspend/./src/forum/components/SuspensionInfoModal.js","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/suspend/./src/common/query/users/SuspendedGambit.ts","webpack://@flarum/suspend/./src/common/extend.ts","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/suspend/./src/forum/components/UserSuspendedNotification.js","webpack://@flarum/suspend/./src/forum/components/UserUnsuspendedNotification.js","webpack://@flarum/suspend/./src/forum/extend.ts","webpack://@flarum/suspend/./src/forum/index.js","webpack://@flarum/suspend/./src/forum/checkForSuspension.js"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/UserControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FieldSet');","import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\ndayjs.extend(utc);\nexport function getPermanentSuspensionDate() {\n return new Date('2038-01-01');\n}\nexport function isPermanentSuspensionDate(date) {\n return dayjs.utc(date).isSame(dayjs.utc('2038-01-01'));\n}\nexport function localStorageKey() {\n return 'flarum-suspend.acknowledge-suspension';\n}\nflarum.reg.add('flarum-suspend', 'forum/helpers/suspensionHelper', { getPermanentSuspensionDate: getPermanentSuspensionDate,isPermanentSuspensionDate: isPermanentSuspensionDate,localStorageKey: localStorageKey, });","import app from 'flarum/forum/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Form from 'flarum/common/components/Form';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport { getPermanentSuspensionDate } from '../helpers/suspensionHelper';\nexport default class SuspendUserModal extends FormModal {\n oninit(vnode) {\n super.oninit(vnode);\n let until = this.attrs.user.suspendedUntil();\n const reason = this.attrs.user.suspendReason();\n const message = this.attrs.user.suspendMessage();\n let status = null;\n if (new Date() > until) until = null;\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';else status = 'limited';\n }\n this.status = Stream(status);\n this.reason = Stream(reason);\n this.message = Stream(message);\n this.daysRemaining = Stream(status === 'limited' && -dayjs().diff(until, 'days') + 1);\n }\n className() {\n return 'SuspendUserModal Modal--medium';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', {\n user: this.attrs.user\n });\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.formItems().toArray(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n type: \"submit\"\n }, app.translator.trans('flarum-suspend.forum.suspend_user.submit_button')))));\n }\n radioItems() {\n const items = new ItemList();\n items.add('not-suspended', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: !this.status(),\n value: \"\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.not_suspended_label')), 100);\n items.add('indefinitely', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'indefinitely',\n value: \"indefinitely\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.indefinitely_label')), 90);\n items.add('time-suspension', m(\"label\", {\n className: \"checkbox SuspendUserModal-days\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'limited',\n value: \"limited\",\n onclick: e => {\n this.status(e.target.value);\n m.redraw.sync();\n this.$('.SuspendUserModal-days-input input').select();\n e.redraw = false;\n }\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_label'), this.status() === 'limited' && m(\"div\", {\n className: \"SuspendUserModal-days-input\"\n }, m(\"input\", {\n type: \"number\",\n min: \"0\",\n value: this.daysRemaining(),\n oninput: withAttr('value', this.daysRemaining),\n className: \"FormControl\"\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_days_text'))), 80);\n return items;\n }\n formItems() {\n const items = new ItemList();\n items.add('radioItems', m(FieldSet, {\n label: app.translator.trans('flarum-suspend.forum.suspend_user.status_heading')\n }, this.radioItems().toArray()), 100);\n items.add('reason', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.reason')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.reason,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 90);\n items.add('message', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.display_message')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.message,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 80);\n return items;\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = getPermanentSuspensionDate();\n break;\n case 'limited':\n suspendedUntil = dayjs().add(this.daysRemaining(), 'days').toDate();\n break;\n default:\n // no default\n }\n this.attrs.user.save({\n suspendedUntil,\n suspendReason: this.reason(),\n suspendMessage: this.message()\n }).then(() => this.hide(), this.loaded.bind(this));\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspendUserModal', SuspendUserModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/fullTime');","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport fullTime from 'flarum/common/helpers/fullTime';\nimport Form from 'flarum/common/components/Form';\nimport { isPermanentSuspensionDate, localStorageKey } from '../helpers/suspensionHelper';\nexport default class SuspensionInfoModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.message = this.attrs.message;\n this.until = this.attrs.until;\n }\n className() {\n return 'SuspensionInfoModal Modal';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspension_info.title');\n }\n content() {\n const timespan = isPermanentSuspensionDate(new Date(this.until)) ? app.translator.trans('flarum-suspend.forum.suspension_info.indefinite') : app.translator.trans('flarum-suspend.forum.suspension_info.limited', {\n date: fullTime(this.until)\n });\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"p\", {\n className: \"helpText\"\n }, this.message), m(\"p\", {\n className: \"helpText\"\n }, timespan), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n onclick: this.hide.bind(this)\n }, app.translator.trans('flarum-suspend.forum.suspension_info.dismiss_button')))));\n }\n hide() {\n localStorage.setItem(localStorageKey(), this.attrs.until.getTime());\n this.attrs.state.close();\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspensionInfoModal', SuspensionInfoModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SuspendedGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-suspend.lib.gambits.users.suspended.key', {}, true);\n }\n filterKey() {\n return 'suspended';\n }\n enabled() {\n return !!app.session.user && app.forum.attribute('canSuspendUsers');\n }\n}\nflarum.reg.add('flarum-suspend', 'common/query/users/SuspendedGambit', SuspendedGambit);","import Extend from 'flarum/common/extenders';\nimport SuspendedGambit from './query/users/SuspendedGambit';\nimport User from 'flarum/common/models/User';\n\n// prettier-ignore\nexport default [new Extend.Search().gambit('users', SuspendedGambit), new Extend.Model(User).attribute('canSuspend')];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { isPermanentSuspensionDate } from '../helpers/suspensionHelper';\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n const suspendedUntil = notification.content();\n const timeReadable = dayjs(suspendedUntil).from(notification.createdAt(), true);\n return isPermanentSuspensionDate(suspendedUntil) ? app.translator.trans('flarum-suspend.forum.notifications.user_suspended_indefinite_text') : app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n timeReadable\n });\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserSuspendedNotification', UserSuspendedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text');\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserUnsuspendedNotification', UserUnsuspendedNotification);","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nimport Model from 'flarum/common/Model';\nimport commonExtend from '../common/extend';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nexport default [...commonExtend, new Extend.Notification() //\n.add('userSuspended', UserSuspendedNotification).add('userUnsuspended', UserUnsuspendedNotification), new Extend.Model(User).attribute('suspendedUntil', Model.transformDate).attribute('suspendReason').attribute('suspendMessage')];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\nimport Badge from 'flarum/common/components/Badge';\nimport User from 'flarum/common/models/User';\nimport SuspendUserModal from './components/SuspendUserModal';\nimport checkForSuspension from './checkForSuspension';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-suspend', () => {\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add('suspend', m(Button, {\n icon: \"fas fa-ban\",\n onclick: () => app.modal.show(SuspendUserModal, {\n user\n })\n }, app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')));\n }\n });\n extend(User.prototype, 'badges', function (items) {\n const until = this.suspendedUntil();\n if (new Date() < until) {\n items.add('suspended', m(Badge, {\n icon: \"fas fa-ban\",\n type: \"suspended\",\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')\n }), 100);\n }\n });\n checkForSuspension();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport { localStorageKey } from './helpers/suspensionHelper';\nexport default function () {\n return setTimeout(() => {\n if (app.session.user) {\n const message = app.session.user.suspendMessage();\n const until = app.session.user.suspendedUntil();\n const isSuspended = message && until && new Date() < until;\n const alreadyDisplayed = localStorage.getItem(localStorageKey()) === until?.getTime().toString();\n if (isSuspended && !alreadyDisplayed) {\n app.modal.show(SuspensionInfoModal, {\n message,\n until\n });\n } else if (localStorage.getItem(localStorageKey())) {\n localStorage.removeItem(localStorageKey());\n }\n }\n }, 0);\n}"],"names":["module","exports","e","n","r","i","s","u","a","o","c","f","h","d","l","$","y","M","name","weekdays","split","months","ordinal","t","m","String","length","Array","join","v","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","g","S","_","O","args","arguments","b","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","meridiem","monthsShort","weekdaysMin","weekdaysShort","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","k","forEach","extend","$i","isDayjs","en","Ls","local","call","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","__webpack_module_cache__","__webpack_require__","moduleId","flarum","reg","_webpack_runtimes","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","key","Object","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","getPermanentSuspensionDate","isPermanentSuspensionDate","localStorageKey","SuspendUserModal","oninit","vnode","super","until","attrs","user","suspendedUntil","reason","suspendReason","message","suspendMessage","status","daysRemaining","dayjs","className","title","trans","content","formItems","toArray","loading","type","radioItems","items","checked","onclick","target","redraw","sync","select","oninput","label","bidi","placeholder","rows","onsubmit","preventDefault","save","then","hide","loaded","bind","SuspensionInfoModal","timespan","localStorage","setItem","state","close","SuspendedGambit","BooleanGambit","filterKey","enabled","attribute","gambit","UserSuspendedNotification","icon","href","notification","subject","timeReadable","from","createdAt","excerpt","UserUnsuspendedNotification","canSuspend","show","setTimeout","isSuspended","alreadyDisplayed","getItem","removeItem"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/tags/js/dist/admin.js b/extensions/tags/js/dist/admin.js index 80b0d3534f..3d3e1c49ea 100644 --- a/extensions/tags/js/dist/admin.js +++ b/extensions/tags/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={400:(t,e,n)=>{"use strict";n.d(e,{X:()=>_n});const o=flarum.reg.get("core","admin/app");var a=n.n(o);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),h=n(336),g=n.n(h),p=n(661),f=n.n(p),v=n(339),b=n(968),y=n(618);const w=flarum.reg.get("core","admin/components/BasicsPage");var _=n.n(w);function T(){(0,r.extend)(_(),"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const S=flarum.reg.get("core","admin/components/SettingDropdown");var E=n.n(S),C=n(805),D=n(950),x=n.n(D),N=(n(414),n(443)),A=n.n(N);function P(t,e){void 0===e&&(e={});const n=[],{link:o,...a}=e;return a.className=A()("TagsLabel",a.className),t?(0,y.A)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.A)(e,{link:o}))})):n.push((0,v.A)()),m("span",a,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",P);class O extends(x()){constructor(){super(...arguments),(0,C.A)(this,"tags",[]),(0,C.A)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||a().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(g(),{className:"Button Button--text",onclick:()=>a().modal.show((()=>n.e(955).then(n.bind(n,671))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?P(this.tags):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",O),flarum.reg.addChunkModule("955","671","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("955","671","flarum-tags","forum/components/ToggleButton");const M=flarum.reg.get("core","common/components/FormGroup");var I=n.n(M),k=n(954),F=n.n(k);class L{constructor(){(0,C.A)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(F().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),this.loadedIncludes??=new Set,F().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",L);const B=flarum.reg.get("core","common/extenders");var R=n.n(B);const X=flarum.reg.get("core","common/utils/computed");var Y=n.n(X);const j=flarum.reg.get("core","common/Model");var H=n.n(j);class G extends(H()){name(){return H().attribute("name").call(this)}slug(){return H().attribute("slug").call(this)}description(){return H().attribute("description").call(this)}color(){return H().attribute("color").call(this)}backgroundUrl(){return H().attribute("backgroundUrl").call(this)}backgroundMode(){return H().attribute("backgroundMode").call(this)}icon(){return H().attribute("icon").call(this)}position(){return H().attribute("position").call(this)}parent(){return H().hasOne("parent").call(this)}children(){return H().hasMany("children").call(this)}defaultSort(){return H().attribute("defaultSort").call(this)}isChild(){return H().attribute("isChild").call(this)}isHidden(){return H().attribute("isHidden").call(this)}isPrimary(){return H().attribute("isPrimary").call(this)}discussionCount(){return H().attribute("discussionCount").call(this)}lastPostedAt(){return H().attribute("lastPostedAt",H().transformDate).call(this)}lastPostedDiscussion(){return H().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return H().attribute("isRestricted").call(this)}canStartDiscussion(){return H().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return H().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return Y()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",G);const W=flarum.reg.get("core","common/query/IGambit");class q extends W.KeyValueGambit{constructor(){super(...arguments),(0,C.A)(this,"predicates",!0)}key(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):`${e?"-":""}${this.key()}:${this.filterValueToGambitValue(t)}`}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",q);const z=[(new(R().Store)).add("tags",G),(new(R().Search)).gambit("discussions",q)];function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function U(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function ut(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function dt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ct(t,e):ct(t,e))||o&&t===n)return t;if(t===n)break}while(t=ut(t))}return null}var mt,ht=/\s+/g;function gt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(ht," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(ht," ")}}function pt(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function ft(t,e){var n="";if("string"==typeof t)n=t;else do{var o=pt(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function vt(t,e,n){if(t){var o=t.getElementsByTagName(e),a=0,r=o.length;if(n)for(;a=r:a<=r))return o;if(o===bt())break;o=Ct(o,!1)}return!1}function _t(t,e,n,o){for(var a=0,r=0,i=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,a=function(t,e){if(null==t)return{};var n,o,a=function(t,e){if(null==t)return{};var n,o,a={},r=Object.keys(t);for(o=0;o=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(n,Ft);kt.pluginEvent.bind(Ne)(t,e,U({dragEl:Rt,parentEl:Xt,ghostEl:Yt,rootEl:jt,nextEl:Ht,lastDownEl:Gt,cloneEl:Wt,cloneHidden:qt,dragStarted:ae,putSortable:Jt,activeSortable:Ne.active,originalEvent:o,oldIndex:zt,oldDraggableIndex:$t,newIndex:Vt,newDraggableIndex:Ut,hideGhostForTarget:Ee,unhideGhostForTarget:Ce,cloneNowHidden:function(){qt=!0},cloneNowShown:function(){qt=!1},dispatchSortableEvent:function(t){Bt({sortable:e,name:t,originalEvent:o})}},a))};function Bt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,r=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,h=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[Ot]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||tt||et?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=a||n,p.clone=r,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=h?h.lastPutMode:void 0;var b=U(U({},g),kt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(U({putSortable:Jt,cloneEl:Wt,targetEl:Rt,rootEl:jt,oldIndex:zt,oldDraggableIndex:$t,newIndex:Vt,newDraggableIndex:Ut},t))}var Rt,Xt,Yt,jt,Ht,Gt,Wt,qt,zt,Vt,$t,Ut,Kt,Jt,Zt,Qt,te,ee,ne,oe,ae,re,ie,se,le,ce=!1,ue=!1,de=[],me=!1,he=!1,ge=[],pe=!1,fe=[],ve="undefined"!=typeof document,be=at,ye=et||tt?"cssFloat":"float",we=ve&&!rt&&!at&&"draggable"in document.createElement("div"),_e=function(){if(ve){if(tt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Te=function(t,e){var n=pt(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=_t(t,0,e),r=_t(t,1,e),i=a&&pt(a),s=r&&pt(r),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+yt(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+yt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[ye]||r&&"none"===n[ye]&&l+c>o)?"vertical":"horizontal"},Se=function(t){function e(t,n){return function(o,a,r,i){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,a,r,i),n)(o,a,r,i);var l=(n?o:a).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==K(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Ee=function(){!_e&&Yt&&pt(Yt,"display","none")},Ce=function(){!_e&&Yt&&pt(Yt,"display","")};ve&&!rt&&document.addEventListener("click",(function(t){if(ue)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ue=!1,!1}),!0);var De=function(t){if(Rt){t=t.touches?t.touches[0]:t;var e=(a=t.clientX,r=t.clientY,de.some((function(t){var e=t[Ot].options.emptyInsertThreshold;if(e&&!Tt(t)){var n=yt(t),o=a>=n.left-e&&a<=n.right+e,s=r>=n.top-e&&r<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Ot]._onDragOver(n)}}var a,r,i},xe=function(t){Rt&&Rt.parentNode[Ot]._isOutsideThisEl(t.target)};function Ne(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Z({},e),t[Ot]=this;var n,o,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Te(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ne.supportPointer&&"PointerEvent"in window&&!ot,emptyInsertThreshold:5};for(var r in kt.initializePlugins(this,t,a),a)!(r in e)&&(e[r]=a[r]);for(var i in Se(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&we,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?st(t,"pointerdown",this._onTapStart):(st(t,"mousedown",this._onTapStart),st(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(st(t,"dragover",this),st(t,"dragenter",this)),de.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Z(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==pt(t,"display")&&t!==Ne.ghost){o.push({target:t,rect:yt(t)});var e=U({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=ft(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var a=!1,r=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=yt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=ft(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&Dt(l,s)&&!Dt(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),Dt(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(a=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),a?n=setTimeout((function(){"function"==typeof t&&t()}),r):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){pt(t,"transition",""),pt(t,"transform","");var a=ft(this.el),r=a&&a.a,i=a&&a.d,s=(e.left-n.left)/(r||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,pt(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),pt(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),pt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){pt(t,"transition",""),pt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function Ae(t,e,n,o,a,r,i,s){var l,c,u=t[Ot],d=u.options.onMove;return!window.CustomEvent||tt||et?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=a||e,l.relatedRect=r||yt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function Pe(t){t.draggable=!1}function Oe(){pe=!1}function Me(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ie(t){return setTimeout(t,0)}function ke(t){return clearTimeout(t)}Ne.prototype={constructor:Ne,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(re=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Rt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,a=o.preventOnFilter,r=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){fe.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&fe.push(o)}}(n),!Rt&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!ot||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=dt(s,o.draggable,n,!1))&&s.animated||Gt===s)){if(zt=St(s),$t=St(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Bt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Lt("filter",e,{evt:t}),void(a&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=dt(l,o.trim(),n,!1))return Bt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Lt("filter",e,{evt:t}),!0}))))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!dt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,a=this,r=a.el,i=a.options,s=r.ownerDocument;if(n&&!Rt&&n.parentNode===r){var l=yt(n);if(jt=r,Xt=(Rt=n).parentNode,Ht=Rt.nextSibling,Gt=n,Kt=i.group,Ne.dragged=Rt,Zt={target:Rt,clientX:(e||t).clientX,clientY:(e||t).clientY},ne=Zt.clientX-l.left,oe=Zt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Rt.style["will-change"]="all",o=function(){Lt("delayEnded",a,{evt:t}),Ne.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!nt&&a.nativeDraggable&&(Rt.draggable=!0),a._triggerDragStart(t,e),Bt({sortable:a,name:"choose",originalEvent:t}),gt(Rt,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){vt(Rt,t.trim(),Pe)})),st(s,"dragover",De),st(s,"mousemove",De),st(s,"touchmove",De),st(s,"mouseup",a._onDrop),st(s,"touchend",a._onDrop),st(s,"touchcancel",a._onDrop),nt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Rt.draggable=!0),Lt("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(et||tt))o();else{if(Ne.eventCanceled)return void this._onDrop();st(s,"mouseup",a._disableDelayedDrag),st(s,"touchend",a._disableDelayedDrag),st(s,"touchcancel",a._disableDelayedDrag),st(s,"mousemove",a._delayedDragTouchMoveHandler),st(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&st(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Rt&&Pe(Rt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._disableDelayedDrag),lt(t,"touchend",this._disableDelayedDrag),lt(t,"touchcancel",this._disableDelayedDrag),lt(t,"mousemove",this._delayedDragTouchMoveHandler),lt(t,"touchmove",this._delayedDragTouchMoveHandler),lt(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?st(document,"pointermove",this._onTouchMove):st(document,e?"touchmove":"mousemove",this._onTouchMove):(st(Rt,"dragend",this),st(jt,"dragstart",this._onDragStart));try{document.selection?Ie((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ce=!1,jt&&Rt){Lt("dragStarted",this,{evt:e}),this.nativeDraggable&&st(document,"dragover",xe);var n=this.options;!t&>(Rt,n.dragClass,!1),gt(Rt,n.ghostClass,!0),Ne.active=this,t&&this._appendGhost(),Bt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Qt){this._lastX=Qt.clientX,this._lastY=Qt.clientY,Ee();for(var t=document.elementFromPoint(Qt.clientX,Qt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Qt.clientX,Qt.clientY))!==e;)e=t;if(Rt.parentNode[Ot]._isOutsideThisEl(t),e)do{if(e[Ot]&&e[Ot]._onDragOver({clientX:Qt.clientX,clientY:Qt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=ut(e));Ce()}},_onTouchMove:function(t){if(Zt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,a=t.touches?t.touches[0]:t,r=Yt&&ft(Yt,!0),i=Yt&&r&&r.a,s=Yt&&r&&r.d,l=be&&le&&Et(le),c=(a.clientX-Zt.clientX+o.x)/(i||1)+(l?l[0]-ge[0]:0)/(i||1),u=(a.clientY-Zt.clientY+o.y)/(s||1)+(l?l[1]-ge[1]:0)/(s||1);if(!Ne.active&&!ce){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))a.right+10||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>a.bottom+10||t.clientX>o.right&&t.clientY>o.top}(t,a,this)&&!p.animated){if(p===Rt)return O(!1);if(p&&r===t.target&&(i=p),i&&(n=yt(i)),!1!==Ae(jt,r,Rt,e,i,n,t,!!i))return P(),p&&p.nextSibling?r.insertBefore(Rt,p.nextSibling):r.appendChild(Rt),Xt=r,M(),O(!0)}else if(p&&function(t,e,n){var o=yt(_t(n.el,0,n.options,!0)),a=Pt(n.el,n.options,Yt);return e?t.clientXu+c*r/2:ld-se)return-ie}else if(l>u+c*(1-a)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}(t,i,n,a,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,he,re===i),0!==v){var C=St(Rt);do{C-=v,y=Xt.children[C]}while(y&&("none"===pt(y,"display")||y===Yt))}if(0===v||y===i)return O(!1);re=i,ie=v;var D=i.nextElementSibling,x=!1,N=Ae(jt,r,Rt,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),pe=!0,setTimeout(Oe,30),P(),x&&!D?r.appendChild(Rt):i.parentNode.insertBefore(Rt,x?D:i),S&&Nt(S,0,E-S.scrollTop),Xt=Rt.parentNode,void 0===b||he||(se=Math.abs(b-yt(i)[T])),M(),O(!0)}if(r.contains(Rt))return O(!1)}return!1}function A(s,l){Lt(s,h,U({evt:t,isOwner:u,axis:a?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:O,onMove:function(n,o){return Ae(jt,r,Rt,e,n,yt(n),t,o)},changed:M},l))}function P(){A("dragOverAnimationCapture"),h.captureAnimationState(),h!==m&&m.captureAnimationState()}function O(e){return A("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==m&&(gt(Rt,Jt?Jt.options.ghostClass:c.options.ghostClass,!1),gt(Rt,s.ghostClass,!0)),Jt!==h&&h!==Ne.active?Jt=h:h===Ne.active&&Jt&&(Jt=null),m===h&&(h._ignoreWhileAnimating=i),h.animateAll((function(){A("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Rt&&!Rt.animated||i===r&&!i.animated)&&(re=null),s.dragoverBubble||t.rootEl||i===document||(Rt.parentNode[Ot]._isOutsideThisEl(t.target),!e&&De(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function M(){Vt=St(Rt),Ut=St(Rt,s.draggable),Bt({sortable:h,name:"change",toEl:r,newIndex:Vt,newDraggableIndex:Ut,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){lt(document,"mousemove",this._onTouchMove),lt(document,"touchmove",this._onTouchMove),lt(document,"pointermove",this._onTouchMove),lt(document,"dragover",De),lt(document,"mousemove",De),lt(document,"touchmove",De)},_offUpEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._onDrop),lt(t,"touchend",this._onDrop),lt(t,"pointerup",this._onDrop),lt(t,"touchcancel",this._onDrop),lt(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Vt=St(Rt),Ut=St(Rt,n.draggable),Lt("drop",this,{evt:t}),Xt=Rt&&Rt.parentNode,Vt=St(Rt),Ut=St(Rt,n.draggable),Ne.eventCanceled||(ce=!1,he=!1,me=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ke(this.cloneId),ke(this._dragStartId),this.nativeDraggable&&(lt(document,"drop",this),lt(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ot&&pt(document.body,"user-select",""),pt(Rt,"transform",""),t&&(ae&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Yt&&Yt.parentNode&&Yt.parentNode.removeChild(Yt),(jt===Xt||Jt&&"clone"!==Jt.lastPutMode)&&Wt&&Wt.parentNode&&Wt.parentNode.removeChild(Wt),Rt&&(this.nativeDraggable&<(Rt,"dragend",this),Pe(Rt),Rt.style["will-change"]="",ae&&!ce&>(Rt,Jt?Jt.options.ghostClass:this.options.ghostClass,!1),gt(Rt,this.options.chosenClass,!1),Bt({sortable:this,name:"unchoose",toEl:Xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),jt!==Xt?(Vt>=0&&(Bt({rootEl:Xt,name:"add",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"remove",toEl:Xt,originalEvent:t}),Bt({rootEl:Xt,name:"sort",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Jt&&Jt.save()):Vt!==zt&&Vt>=0&&(Bt({sortable:this,name:"update",toEl:Xt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Ne.active&&(null!=Vt&&-1!==Vt||(Vt=zt,Ut=$t),Bt({sortable:this,name:"end",toEl:Xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Lt("nulling",this),jt=Rt=Xt=Yt=Ht=Wt=Gt=qt=Zt=Qt=ae=Vt=Ut=zt=$t=re=ie=Jt=Kt=Ne.dragged=Ne.ghost=Ne.clone=Ne.active=null,fe.forEach((function(t){t.checked=!0})),fe.length=te=ee=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Rt&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,a=n.length,r=this.options;o{const e=t.target;this.name(e.value),this.slug((0,hn.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(un(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:a().refs.fontawesome,tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),a().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(g(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},a().translator.trans("flarum-tags.admin.edit_tag.submit_button")),this.tag.exists&&m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(vn()(a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=a().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}function yn(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},(0,b.A)(t),m("span",{className:"TagListItem-name"},t.name()),m(g(),{className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:()=>a().modal.show(bn,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.A)(a().store.all("tags")).filter((e=>e.parent()===t)).map(yn)))}flarum.reg.add("flarum-tags","admin/components/EditTagModal",bn);class wn extends(Je()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,a().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),o=this.setting("flarum-tags.max_secondary_tags",0),r=(0,y.A)(a().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(on(),null,m(rn(),{className:"TagGroup",label:a().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},r.filter((t=>null!==t.position()&&!t.isChild())).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!0})},a().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(rn(),{className:"TagGroup TagGroup--secondary",label:a().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},r.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!1})},a().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(rn(),{label:a().translator.trans("flarum-tags.admin.tags.settings_heading")},m(en(),null,m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:Qe()("value",this.setMinTags.bind(this,t,e))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:Qe()("value",this.setMinTags.bind(this,n,o))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,a().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{Ue.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&a().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=a().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{a().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),a().request({url:a().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",wn);const _n=[...z,(new(R().Admin)).page(wn).permission((()=>({icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"})),"moderate",95).permission((()=>({icon:"fas fa-tags",label:a().translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"})),"start",89)];a().initializers.add("flarum-tags",(t=>{t.tagList=new L,(0,r.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,r.extend)(s().prototype,"oncreate",(function(){a().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,r.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,r.override)(a(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,r.extend)(s().prototype,"scopeItems",(t=>{(0,y.A)(a().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.A)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||t.permission?.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:`tag${e.id()}.${t.permission}`,allowGuest:t.allowGuest}):null})))})),(0,r.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.A)(a().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:a().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(g(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.A)(t,{className:"Button-icon"})," ",t.name()])))))})),T(),(0,r.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(a().data.settings.allow_tag_change,10);return m(E(),{defaultLabel:t?a().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:a().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:a().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,r.extend)(I().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(O,Object.assign({},t,{settingValue:t.bidi}))))}))}))},968:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var o=n(443),a=n.n(o);function r(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:r=!0}=n;return e.className=a()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&r?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",r)},339:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var o=n(414),a=n.n(o),r=n(88),i=n.n(r),s=n(443),l=n.n(s),c=n(296),u=n.n(c),d=n(968);function h(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=a()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.A)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",h)},85:()=>{},618:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const a=t.parent(),r=e.parent();return a===r?n-o:a&&r?a.position()-r.position():a?a===e?1:a.position()-o:r?r===t?-1:n-r.position():0}))}n.d(e,{A:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},950:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},954:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},336:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},15:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},88:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},661:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},607:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},296:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},280:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},821:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},443:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},414:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},233:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},805:(t,e,n)=>{"use strict";function o(t){return o="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},o(t)}function a(t,e,n){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{A:()=>a})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>"common/components/TagSelectionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(n,o,r,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(h);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((t=>t(o))),e)return e(o)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const n=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={884:0};a.f.j=(e,n)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,a)=>o=t[e]=[n,a]));n.push(o[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(n=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,r,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);l&&l(a)}for(e&&e(n);c{"use strict";a.r(r),a.d(r,{extend:()=>n.X});var t=a(85),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);a.d(r,e);var n=a(400)})(),module.exports=r})(); +(()=>{var t,e,n={400:(t,e,n)=>{"use strict";n.d(e,{X:()=>_n});const o=flarum.reg.get("core","admin/app");var a=n.n(o);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),h=n(336),g=n.n(h),p=n(661),f=n.n(p),v=n(339),b=n(968),y=n(618);const w=flarum.reg.get("core","admin/components/BasicsPage");var _=n.n(w);function T(){(0,r.extend)(_(),"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const S=flarum.reg.get("core","admin/components/SettingDropdown");var E=n.n(S),C=n(805),D=n(950),x=n.n(D),N=(n(414),n(443)),A=n.n(N);function P(t,e){void 0===e&&(e={});const n=[],{link:o,...a}=e;return a.className=A()("TagsLabel",a.className),t?(0,y.A)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.A)(e,{link:o}))})):n.push((0,v.A)()),m("span",a,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",P);class O extends(x()){constructor(){super(...arguments),(0,C.A)(this,"tags",[]),(0,C.A)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||a().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(g(),{className:"Button Button--text",onclick:()=>a().modal.show((()=>n.e(955).then(n.bind(n,671))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?P(this.tags):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",O),flarum.reg.addChunkModule("955","671","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("955","671","flarum-tags","forum/components/ToggleButton");const M=flarum.reg.get("core","common/components/FormGroup");var I=n.n(M),k=n(954),F=n.n(k);class L{constructor(){(0,C.A)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(F().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),this.loadedIncludes??=new Set,F().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",L);const B=flarum.reg.get("core","common/extenders");var R=n.n(B);const X=flarum.reg.get("core","common/utils/computed");var Y=n.n(X);const j=flarum.reg.get("core","common/Model");var H=n.n(j);class G extends(H()){name(){return H().attribute("name").call(this)}slug(){return H().attribute("slug").call(this)}description(){return H().attribute("description").call(this)}color(){return H().attribute("color").call(this)}backgroundUrl(){return H().attribute("backgroundUrl").call(this)}backgroundMode(){return H().attribute("backgroundMode").call(this)}icon(){return H().attribute("icon").call(this)}position(){return H().attribute("position").call(this)}parent(){return H().hasOne("parent").call(this)}children(){return H().hasMany("children").call(this)}defaultSort(){return H().attribute("defaultSort").call(this)}isChild(){return H().attribute("isChild").call(this)}isHidden(){return H().attribute("isHidden").call(this)}isPrimary(){return H().attribute("isPrimary").call(this)}discussionCount(){return H().attribute("discussionCount").call(this)}lastPostedAt(){return H().attribute("lastPostedAt",H().transformDate).call(this)}lastPostedDiscussion(){return H().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return H().attribute("isRestricted").call(this)}canStartDiscussion(){return H().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return H().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return Y()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",G);const W=flarum.reg.get("core","common/query/IGambit");class q extends W.KeyValueGambit{constructor(){super(...arguments),(0,C.A)(this,"predicates",!0)}key(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):`${e?"-":""}${this.key()}:${this.filterValueToGambitValue(t)}`}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",q);const z=[(new(R().Store)).add("tags",G),(new(R().Search)).gambit("discussions",q)];function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function U(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function ut(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function dt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ct(t,e):ct(t,e))||o&&t===n)return t;if(t===n)break}while(t=ut(t))}return null}var mt,ht=/\s+/g;function gt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(ht," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(ht," ")}}function pt(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function ft(t,e){var n="";if("string"==typeof t)n=t;else do{var o=pt(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function vt(t,e,n){if(t){var o=t.getElementsByTagName(e),a=0,r=o.length;if(n)for(;a=r:a<=r))return o;if(o===bt())break;o=Ct(o,!1)}return!1}function _t(t,e,n,o){for(var a=0,r=0,i=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,a=function(t,e){if(null==t)return{};var n,o,a=function(t,e){if(null==t)return{};var n,o,a={},r=Object.keys(t);for(o=0;o=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(n,Ft);kt.pluginEvent.bind(Ne)(t,e,U({dragEl:Rt,parentEl:Xt,ghostEl:Yt,rootEl:jt,nextEl:Ht,lastDownEl:Gt,cloneEl:Wt,cloneHidden:qt,dragStarted:ae,putSortable:Jt,activeSortable:Ne.active,originalEvent:o,oldIndex:zt,oldDraggableIndex:$t,newIndex:Vt,newDraggableIndex:Ut,hideGhostForTarget:Ee,unhideGhostForTarget:Ce,cloneNowHidden:function(){qt=!0},cloneNowShown:function(){qt=!1},dispatchSortableEvent:function(t){Bt({sortable:e,name:t,originalEvent:o})}},a))};function Bt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,r=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,h=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[Ot]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||tt||et?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=a||n,p.clone=r,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=h?h.lastPutMode:void 0;var b=U(U({},g),kt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(U({putSortable:Jt,cloneEl:Wt,targetEl:Rt,rootEl:jt,oldIndex:zt,oldDraggableIndex:$t,newIndex:Vt,newDraggableIndex:Ut},t))}var Rt,Xt,Yt,jt,Ht,Gt,Wt,qt,zt,Vt,$t,Ut,Kt,Jt,Zt,Qt,te,ee,ne,oe,ae,re,ie,se,le,ce=!1,ue=!1,de=[],me=!1,he=!1,ge=[],pe=!1,fe=[],ve="undefined"!=typeof document,be=at,ye=et||tt?"cssFloat":"float",we=ve&&!rt&&!at&&"draggable"in document.createElement("div"),_e=function(){if(ve){if(tt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Te=function(t,e){var n=pt(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=_t(t,0,e),r=_t(t,1,e),i=a&&pt(a),s=r&&pt(r),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+yt(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+yt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[ye]||r&&"none"===n[ye]&&l+c>o)?"vertical":"horizontal"},Se=function(t){function e(t,n){return function(o,a,r,i){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,a,r,i),n)(o,a,r,i);var l=(n?o:a).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==K(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Ee=function(){!_e&&Yt&&pt(Yt,"display","none")},Ce=function(){!_e&&Yt&&pt(Yt,"display","")};ve&&!rt&&document.addEventListener("click",(function(t){if(ue)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ue=!1,!1}),!0);var De=function(t){if(Rt){t=t.touches?t.touches[0]:t;var e=(a=t.clientX,r=t.clientY,de.some((function(t){var e=t[Ot].options.emptyInsertThreshold;if(e&&!Tt(t)){var n=yt(t),o=a>=n.left-e&&a<=n.right+e,s=r>=n.top-e&&r<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Ot]._onDragOver(n)}}var a,r,i},xe=function(t){Rt&&Rt.parentNode[Ot]._isOutsideThisEl(t.target)};function Ne(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Z({},e),t[Ot]=this;var n,o,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Te(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ne.supportPointer&&"PointerEvent"in window&&!ot,emptyInsertThreshold:5};for(var r in kt.initializePlugins(this,t,a),a)!(r in e)&&(e[r]=a[r]);for(var i in Se(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&we,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?st(t,"pointerdown",this._onTapStart):(st(t,"mousedown",this._onTapStart),st(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(st(t,"dragover",this),st(t,"dragenter",this)),de.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Z(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==pt(t,"display")&&t!==Ne.ghost){o.push({target:t,rect:yt(t)});var e=U({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=ft(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var a=!1,r=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=yt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=ft(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&Dt(l,s)&&!Dt(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),Dt(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(a=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),a?n=setTimeout((function(){"function"==typeof t&&t()}),r):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){pt(t,"transition",""),pt(t,"transform","");var a=ft(this.el),r=a&&a.a,i=a&&a.d,s=(e.left-n.left)/(r||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,pt(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),pt(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),pt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){pt(t,"transition",""),pt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function Ae(t,e,n,o,a,r,i,s){var l,c,u=t[Ot],d=u.options.onMove;return!window.CustomEvent||tt||et?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=a||e,l.relatedRect=r||yt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function Pe(t){t.draggable=!1}function Oe(){pe=!1}function Me(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ie(t){return setTimeout(t,0)}function ke(t){return clearTimeout(t)}Ne.prototype={constructor:Ne,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(re=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Rt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,a=o.preventOnFilter,r=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){fe.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&fe.push(o)}}(n),!Rt&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!ot||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=dt(s,o.draggable,n,!1))&&s.animated||Gt===s)){if(zt=St(s),$t=St(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Bt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Lt("filter",e,{evt:t}),void(a&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=dt(l,o.trim(),n,!1))return Bt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Lt("filter",e,{evt:t}),!0}))))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!dt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,a=this,r=a.el,i=a.options,s=r.ownerDocument;if(n&&!Rt&&n.parentNode===r){var l=yt(n);if(jt=r,Xt=(Rt=n).parentNode,Ht=Rt.nextSibling,Gt=n,Kt=i.group,Ne.dragged=Rt,Zt={target:Rt,clientX:(e||t).clientX,clientY:(e||t).clientY},ne=Zt.clientX-l.left,oe=Zt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Rt.style["will-change"]="all",o=function(){Lt("delayEnded",a,{evt:t}),Ne.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!nt&&a.nativeDraggable&&(Rt.draggable=!0),a._triggerDragStart(t,e),Bt({sortable:a,name:"choose",originalEvent:t}),gt(Rt,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){vt(Rt,t.trim(),Pe)})),st(s,"dragover",De),st(s,"mousemove",De),st(s,"touchmove",De),st(s,"mouseup",a._onDrop),st(s,"touchend",a._onDrop),st(s,"touchcancel",a._onDrop),nt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Rt.draggable=!0),Lt("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(et||tt))o();else{if(Ne.eventCanceled)return void this._onDrop();st(s,"mouseup",a._disableDelayedDrag),st(s,"touchend",a._disableDelayedDrag),st(s,"touchcancel",a._disableDelayedDrag),st(s,"mousemove",a._delayedDragTouchMoveHandler),st(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&st(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Rt&&Pe(Rt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._disableDelayedDrag),lt(t,"touchend",this._disableDelayedDrag),lt(t,"touchcancel",this._disableDelayedDrag),lt(t,"mousemove",this._delayedDragTouchMoveHandler),lt(t,"touchmove",this._delayedDragTouchMoveHandler),lt(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?st(document,"pointermove",this._onTouchMove):st(document,e?"touchmove":"mousemove",this._onTouchMove):(st(Rt,"dragend",this),st(jt,"dragstart",this._onDragStart));try{document.selection?Ie((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ce=!1,jt&&Rt){Lt("dragStarted",this,{evt:e}),this.nativeDraggable&&st(document,"dragover",xe);var n=this.options;!t&>(Rt,n.dragClass,!1),gt(Rt,n.ghostClass,!0),Ne.active=this,t&&this._appendGhost(),Bt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Qt){this._lastX=Qt.clientX,this._lastY=Qt.clientY,Ee();for(var t=document.elementFromPoint(Qt.clientX,Qt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Qt.clientX,Qt.clientY))!==e;)e=t;if(Rt.parentNode[Ot]._isOutsideThisEl(t),e)do{if(e[Ot]&&e[Ot]._onDragOver({clientX:Qt.clientX,clientY:Qt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=ut(e));Ce()}},_onTouchMove:function(t){if(Zt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,a=t.touches?t.touches[0]:t,r=Yt&&ft(Yt,!0),i=Yt&&r&&r.a,s=Yt&&r&&r.d,l=be&&le&&Et(le),c=(a.clientX-Zt.clientX+o.x)/(i||1)+(l?l[0]-ge[0]:0)/(i||1),u=(a.clientY-Zt.clientY+o.y)/(s||1)+(l?l[1]-ge[1]:0)/(s||1);if(!Ne.active&&!ce){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))a.right+10||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>a.bottom+10||t.clientX>o.right&&t.clientY>o.top}(t,a,this)&&!p.animated){if(p===Rt)return O(!1);if(p&&r===t.target&&(i=p),i&&(n=yt(i)),!1!==Ae(jt,r,Rt,e,i,n,t,!!i))return P(),p&&p.nextSibling?r.insertBefore(Rt,p.nextSibling):r.appendChild(Rt),Xt=r,M(),O(!0)}else if(p&&function(t,e,n){var o=yt(_t(n.el,0,n.options,!0)),a=Pt(n.el,n.options,Yt);return e?t.clientXu+c*r/2:ld-se)return-ie}else if(l>u+c*(1-a)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}(t,i,n,a,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,he,re===i),0!==v){var C=St(Rt);do{C-=v,y=Xt.children[C]}while(y&&("none"===pt(y,"display")||y===Yt))}if(0===v||y===i)return O(!1);re=i,ie=v;var D=i.nextElementSibling,x=!1,N=Ae(jt,r,Rt,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),pe=!0,setTimeout(Oe,30),P(),x&&!D?r.appendChild(Rt):i.parentNode.insertBefore(Rt,x?D:i),S&&Nt(S,0,E-S.scrollTop),Xt=Rt.parentNode,void 0===b||he||(se=Math.abs(b-yt(i)[T])),M(),O(!0)}if(r.contains(Rt))return O(!1)}return!1}function A(s,l){Lt(s,h,U({evt:t,isOwner:u,axis:a?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:O,onMove:function(n,o){return Ae(jt,r,Rt,e,n,yt(n),t,o)},changed:M},l))}function P(){A("dragOverAnimationCapture"),h.captureAnimationState(),h!==m&&m.captureAnimationState()}function O(e){return A("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==m&&(gt(Rt,Jt?Jt.options.ghostClass:c.options.ghostClass,!1),gt(Rt,s.ghostClass,!0)),Jt!==h&&h!==Ne.active?Jt=h:h===Ne.active&&Jt&&(Jt=null),m===h&&(h._ignoreWhileAnimating=i),h.animateAll((function(){A("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Rt&&!Rt.animated||i===r&&!i.animated)&&(re=null),s.dragoverBubble||t.rootEl||i===document||(Rt.parentNode[Ot]._isOutsideThisEl(t.target),!e&&De(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function M(){Vt=St(Rt),Ut=St(Rt,s.draggable),Bt({sortable:h,name:"change",toEl:r,newIndex:Vt,newDraggableIndex:Ut,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){lt(document,"mousemove",this._onTouchMove),lt(document,"touchmove",this._onTouchMove),lt(document,"pointermove",this._onTouchMove),lt(document,"dragover",De),lt(document,"mousemove",De),lt(document,"touchmove",De)},_offUpEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._onDrop),lt(t,"touchend",this._onDrop),lt(t,"pointerup",this._onDrop),lt(t,"touchcancel",this._onDrop),lt(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Vt=St(Rt),Ut=St(Rt,n.draggable),Lt("drop",this,{evt:t}),Xt=Rt&&Rt.parentNode,Vt=St(Rt),Ut=St(Rt,n.draggable),Ne.eventCanceled||(ce=!1,he=!1,me=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ke(this.cloneId),ke(this._dragStartId),this.nativeDraggable&&(lt(document,"drop",this),lt(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ot&&pt(document.body,"user-select",""),pt(Rt,"transform",""),t&&(ae&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Yt&&Yt.parentNode&&Yt.parentNode.removeChild(Yt),(jt===Xt||Jt&&"clone"!==Jt.lastPutMode)&&Wt&&Wt.parentNode&&Wt.parentNode.removeChild(Wt),Rt&&(this.nativeDraggable&<(Rt,"dragend",this),Pe(Rt),Rt.style["will-change"]="",ae&&!ce&>(Rt,Jt?Jt.options.ghostClass:this.options.ghostClass,!1),gt(Rt,this.options.chosenClass,!1),Bt({sortable:this,name:"unchoose",toEl:Xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),jt!==Xt?(Vt>=0&&(Bt({rootEl:Xt,name:"add",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"remove",toEl:Xt,originalEvent:t}),Bt({rootEl:Xt,name:"sort",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Jt&&Jt.save()):Vt!==zt&&Vt>=0&&(Bt({sortable:this,name:"update",toEl:Xt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Ne.active&&(null!=Vt&&-1!==Vt||(Vt=zt,Ut=$t),Bt({sortable:this,name:"end",toEl:Xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Lt("nulling",this),jt=Rt=Xt=Yt=Ht=Wt=Gt=qt=Zt=Qt=ae=Vt=Ut=zt=$t=re=ie=Jt=Kt=Ne.dragged=Ne.ghost=Ne.clone=Ne.active=null,fe.forEach((function(t){t.checked=!0})),fe.length=te=ee=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Rt&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,a=n.length,r=this.options;o{const e=t.target;this.name(e.value),this.slug((0,hn.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(un(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:a().refs.fontawesome,tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),a().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(g(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},a().translator.trans("flarum-tags.admin.edit_tag.submit_button")),this.tag.exists&&m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(vn()(a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=a().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}function yn(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},(0,b.A)(t),m("span",{className:"TagListItem-name"},t.name()),m(g(),{className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:()=>a().modal.show(bn,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.A)(a().store.all("tags")).filter((e=>e.parent()===t)).map(yn)))}flarum.reg.add("flarum-tags","admin/components/EditTagModal",bn);class wn extends(Je()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,a().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),o=this.setting("flarum-tags.max_secondary_tags",0),r=(0,y.A)(a().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(on(),null,m(rn(),{className:"TagGroup",label:a().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},r.filter((t=>null!==t.position()&&!t.isChild())).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!0})},a().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(rn(),{className:"TagGroup TagGroup--secondary",label:a().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},r.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!1})},a().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(rn(),{label:a().translator.trans("flarum-tags.admin.tags.settings_heading")},m(en(),null,m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:Qe()("value",this.setMinTags.bind(this,t,e))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:Qe()("value",this.setMinTags.bind(this,n,o))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,a().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{Ue.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&a().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=a().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{a().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),a().request({url:a().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",wn);const _n=[...z,(new(R().Admin)).page(wn).permission((()=>({icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"})),"moderate",95).permission((()=>({icon:"fas fa-tags",label:a().translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"})),"start",89)];a().initializers.add("flarum-tags",(t=>{t.tagList=new L,(0,r.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,r.extend)(s().prototype,"oncreate",(function(){a().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,r.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,r.override)(a(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,r.extend)(s().prototype,"scopeItems",(t=>{(0,y.A)(a().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.A)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||t.permission?.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:`tag${e.id()}.${t.permission}`,allowGuest:t.allowGuest}):null})))})),(0,r.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.A)(a().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:a().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(g(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.A)(t,{className:"Button-icon"})," ",t.name()])))))})),T(),(0,r.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(a().data.settings.allow_tag_change,10);return m(E(),{defaultLabel:t?a().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:a().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:a().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,r.extend)(I().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(O,Object.assign({},t,{settingValue:t.bidi}))))}))}))},968:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var o=n(443),a=n.n(o);function r(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:r=!0}=n;return e.className=a()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&r?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",r)},339:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var o=n(414),a=n.n(o),r=n(88),i=n.n(r),s=n(443),l=n.n(s),c=n(296),u=n.n(c),d=n(968);function h(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=a()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.A)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",h)},85:()=>{},618:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const a=t.parent(),r=e.parent();return a===r?n-o:a&&r?a.position()-r.position():a?a===e?1:a.position()-o:r?r===t?-1:n-r.position():0}))}n.d(e,{A:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},950:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},954:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},336:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},15:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},88:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},661:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},607:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},296:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},280:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},821:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},443:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},414:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},233:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},805:(t,e,n)=>{"use strict";function o(t){return o="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},o(t)}function a(t,e,n){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{A:()=>a})}},o={};function a(t){flarum.reg._webpack_runtimes["flarum-tags"]||=a;var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>"common/components/TagSelectionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(n,o,r,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(h);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((t=>t(o))),e)return e(o)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const n=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={884:0};a.f.j=(e,n)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,a)=>o=t[e]=[n,a]));n.push(o[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(n=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,r,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);l&&l(a)}for(e&&e(n);c{"use strict";a.r(r),a.d(r,{extend:()=>n.X});var t=a(85),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);a.d(r,e);var n=a(400)})(),module.exports=r})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/tags/js/dist/admin.js.map b/extensions/tags/js/dist/admin.js.map index ad8c5bfe03..e6e05ee087 100644 --- a/extensions/tags/js/dist/admin.js.map +++ b/extensions/tags/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":";UAAIA,EACAC,kDCDJ,MAAM,EAA+BC,OAAOC,IAAIC,IAAI,OAAQ,0BCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,iBCAtD,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,gDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,oDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,0GCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,4CCE7C,SAAS,KACtB,IAAAC,QAAO,IAAY,iBAAiBC,IAClCA,EAAMC,IAAI,OAAQ,CAChBC,KAAM,QACNC,MAAOC,IAAIC,WAAWC,MAAM,wCAC5B,GAEN,CCTA,MAAM,EAA+BV,OAAOC,IAAIC,IAAI,OAAQ,uGCI7C,SAASS,EAAUC,EAAMC,QACxB,IAAVA,IACFA,EAAQ,CAAC,GAEX,MAAMC,EAAW,IACX,KACJC,KACGC,GACDH,EAaJ,OAZAG,EAAWC,UAAY,IAAU,YAAaD,EAAWC,WACrDL,GACF,EAAAM,EAAA,GAASN,GAAMO,SAAQC,KACjBA,GAAuB,IAAhBR,EAAKS,SACdP,EAASQ,MAAK,EAAAC,EAAA,GAASH,EAAK,CAC1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B,EAAgB9yB,KAAa,CACtD,IAAIwwB,KAAYkD,EACZnD,EAAoBR,EAAE2D,EAAalD,KACrCD,EAAoBvxB,EAAEwxB,GAAYkD,EAAYlD,IAG7CmD,GAAsBA,EAAQpD,EAClC,CAEA,IADGiD,GAA4BA,EAA2B9hB,GACrD/M,EAAI8uB,EAAS50B,OAAQ8F,IACzBmsB,EAAU2C,EAAS9uB,GAChB4rB,EAAoBR,EAAE+C,EAAiBhC,IAAYgC,EAAgBhC,IACrEgC,EAAgBhC,GAAS,KAE1BgC,EAAgBhC,GAAW,CAC5B,EAIG8C,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBj1B,QAAQ40B,EAAqBthB,KAAK,KAAM,IAC3D2hB,EAAmB90B,KAAOy0B,EAAqBthB,KAAK,KAAM2hB,EAAmB90B,KAAKmT,KAAK2hB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSectionGroup')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSection')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/admin/extend.tsx","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('955', '671', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('955', '671', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n if (includes === void 0) {\n includes = [];\n }\n this.loadedIncludes ??= new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return `${negate ? '-' : ''}${this.key()}:${this.filterValueToGambitValue(value)}`;\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","/**!\n * Sortable 1.15.3\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.3\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nfunction getChildContainingRectFromElement(container, options, ghostEl) {\n var rect = {};\n Array.from(container.children).forEach(function (child) {\n var _rect$left, _rect$top, _rect$right, _rect$bottom;\n if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;\n var childRect = getRect(child);\n rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);\n rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);\n rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);\n rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);\n });\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = getParentOrHost(parent));\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild,\n expando: expando\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSectionGroup');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSection');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\n/**\n * The `EditTagModal` component shows a modal dialog which allows the user\n * to create or edit a tag.\n */\nexport default class EditTagModal extends FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: app.refs.fontawesome,\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import sortable from 'sortablejs';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Form from 'flarum/common/components/Form';\nimport FormSectionGroup from 'flarum/admin/components/FormSectionGroup';\nimport FormSection from 'flarum/admin/components/FormSection';\nimport EditTagModal from './EditTagModal';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\nfunction tagItem(tag) {\n return m(\"li\", {\n \"data-id\": tag.id(),\n style: {\n color: tag.color()\n }\n }, m(\"div\", {\n className: \"TagListItem-info\"\n }, tagIcon(tag), m(\"span\", {\n className: \"TagListItem-name\"\n }, tag.name()), m(Button, {\n className: \"Button Button--link\",\n icon: \"fas fa-pencil-alt\",\n onclick: () => app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import Extend from 'flarum/common/extenders';\nimport commonExtend from '../common/extend';\nimport app from 'flarum/admin/app';\nimport TagsPage from './components/TagsPage';\nexport default [...commonExtend, new Extend.Admin().page(TagsPage).permission(() => ({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n}), 'moderate', 95).permission(() => ({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n}), 'start', 89)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n addTagsPermissionScope();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || item.permission?.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: `tag${tag.id()}.${item.permission}`,\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\n className: \"Dropdown--restrictByTag\",\n buttonClassName: \"Button Button--text\",\n label: app.translator.trans('flarum-tags.admin.permissions.restrict_by_tag_heading'),\n icon: \"fas fa-plus\",\n caretIcon: null\n }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t884: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","extend","items","add","path","label","app","translator","trans","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","load","then","filter","includes","id","redraw","help","onclick","show","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","TagListState","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","all","Set","find","join","val","Array","isArray","Tag","name","call","slug","description","color","backgroundUrl","backgroundMode","icon","position","parent","defaultSort","isChild","isHidden","isPrimary","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","toString","filterValueToGambitValue","gambit","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","state","classList","replace","css","prop","style","defaultView","getComputedStyle","currentStyle","indexOf","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","getChildContainingRectFromElement","ghostEl","rect","from","child","_rect$left","_rect$top","_rect$right","_rect$bottom","animated","childRect","min","Infinity","max","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","concat","pluginEvent","eventName","sortable","evt","_this","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","excluded","sourceKeys","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","_objectWithoutProperties","bind","dragEl","parentEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","lastElRect","childContainingRect","_ghostIsLast","changed","firstElRect","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","createRecord","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","fontawesome","tabindex","loading","exists","delete","hide","confirm","pushData","tagItem","tagIcon","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","oncreate","onListOnCreate","localeCompare","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","getById","relationships","j","url","attribute","method","page","permission","tagList","override","original","tagPrefix","required","onremove","render","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagsHomePageOption","minutes","settings","allow_tag_change","defaultLabel","count","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","o","r","t","toPrimitive","TypeError","String","toPropertyKey","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","chunkId","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","toStringTag","scriptUrl","importScripts","location","currentScript","Error","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":";UAAIA,EACAC,kDCDJ,MAAM,EAA+BC,OAAOC,IAAIC,IAAI,OAAQ,0BCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,iBCAtD,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,gDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,oDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,0GCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,4CCE7C,SAAS,KACtB,IAAAC,QAAO,IAAY,iBAAiBC,IAClCA,EAAMC,IAAI,OAAQ,CAChBC,KAAM,QACNC,MAAOC,IAAIC,WAAWC,MAAM,wCAC5B,GAEN,CCTA,MAAM,EAA+BV,OAAOC,IAAIC,IAAI,OAAQ,uGCI7C,SAASS,EAAUC,EAAMC,QACxB,IAAVA,IACFA,EAAQ,CAAC,GAEX,MAAMC,EAAW,IACX,KACJC,KACGC,GACDH,EAaJ,OAZAG,EAAWC,UAAY,IAAU,YAAaD,EAAWC,WACrDL,GACF,EAAAM,EAAA,GAASN,GAAMO,SAAQC,KACjBA,GAAuB,IAAhBR,EAAKS,SACdP,EAASQ,MAAK,EAAAC,EAAA,GAASH,EAAK,CAC1BL,SAEJ,IAGFD,EAASQ,MAAK,EAAAC,EAAA,MAETC,EAAE,OAAQR,EAAYF,EAC/B,CACAd,OAAOC,IAAII,IAAI,cAAe,2BAA4BM,GCrB3C,MAAMc,UAAmC,KACtD,WAAAC,GACEC,SAASC,YACT,OAAgBC,KAAM,OAAQ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BA,EAAQrD,EAClC,CAEA,IADGkD,GAA4BA,EAA2B/hB,GACrD/M,EAAI+uB,EAAS70B,OAAQ8F,IACzBosB,EAAU2C,EAAS/uB,GAChB4rB,EAAoBR,EAAEgD,EAAiBhC,IAAYgC,EAAgBhC,IACrEgC,EAAgBhC,GAAS,KAE1BgC,EAAgBhC,GAAW,CAC5B,EAIG8C,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBl1B,QAAQ60B,EAAqBvhB,KAAK,KAAM,IAC3D4hB,EAAmB/0B,KAAO00B,EAAqBvhB,KAAK,KAAM4hB,EAAmB/0B,KAAKmT,KAAK4hB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSectionGroup')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSection')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/admin/extend.tsx","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('955', '671', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('955', '671', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n if (includes === void 0) {\n includes = [];\n }\n this.loadedIncludes ??= new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return `${negate ? '-' : ''}${this.key()}:${this.filterValueToGambitValue(value)}`;\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","/**!\n * Sortable 1.15.3\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.3\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nfunction getChildContainingRectFromElement(container, options, ghostEl) {\n var rect = {};\n Array.from(container.children).forEach(function (child) {\n var _rect$left, _rect$top, _rect$right, _rect$bottom;\n if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;\n var childRect = getRect(child);\n rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);\n rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);\n rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);\n rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);\n });\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = getParentOrHost(parent));\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild,\n expando: expando\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSectionGroup');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSection');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\n/**\n * The `EditTagModal` component shows a modal dialog which allows the user\n * to create or edit a tag.\n */\nexport default class EditTagModal extends FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: app.refs.fontawesome,\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import sortable from 'sortablejs';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Form from 'flarum/common/components/Form';\nimport FormSectionGroup from 'flarum/admin/components/FormSectionGroup';\nimport FormSection from 'flarum/admin/components/FormSection';\nimport EditTagModal from './EditTagModal';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\nfunction tagItem(tag) {\n return m(\"li\", {\n \"data-id\": tag.id(),\n style: {\n color: tag.color()\n }\n }, m(\"div\", {\n className: \"TagListItem-info\"\n }, tagIcon(tag), m(\"span\", {\n className: \"TagListItem-name\"\n }, tag.name()), m(Button, {\n className: \"Button Button--link\",\n icon: \"fas fa-pencil-alt\",\n onclick: () => app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import Extend from 'flarum/common/extenders';\nimport commonExtend from '../common/extend';\nimport app from 'flarum/admin/app';\nimport TagsPage from './components/TagsPage';\nexport default [...commonExtend, new Extend.Admin().page(TagsPage).permission(() => ({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n}), 'moderate', 95).permission(() => ({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n}), 'start', 89)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n addTagsPermissionScope();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || item.permission?.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: `tag${tag.id()}.${item.permission}`,\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\n className: \"Dropdown--restrictByTag\",\n buttonClassName: \"Button Button--text\",\n label: app.translator.trans('flarum-tags.admin.permissions.restrict_by_tag_heading'),\n icon: \"fas fa-plus\",\n caretIcon: null\n }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\tflarum.reg._webpack_runtimes[\"flarum-tags\"] ||= __webpack_require__;// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t884: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","extend","items","add","path","label","app","translator","trans","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","load","then","filter","includes","id","redraw","help","onclick","show","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","TagListState","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","all","Set","find","join","val","Array","isArray","Tag","name","call","slug","description","color","backgroundUrl","backgroundMode","icon","position","parent","defaultSort","isChild","isHidden","isPrimary","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","toString","filterValueToGambitValue","gambit","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","state","classList","replace","css","prop","style","defaultView","getComputedStyle","currentStyle","indexOf","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","getChildContainingRectFromElement","ghostEl","rect","from","child","_rect$left","_rect$top","_rect$right","_rect$bottom","animated","childRect","min","Infinity","max","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","concat","pluginEvent","eventName","sortable","evt","_this","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","excluded","sourceKeys","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","_objectWithoutProperties","bind","dragEl","parentEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","lastElRect","childContainingRect","_ghostIsLast","changed","firstElRect","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","createRecord","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","fontawesome","tabindex","loading","exists","delete","hide","confirm","pushData","tagItem","tagIcon","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","oncreate","onListOnCreate","localeCompare","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","getById","relationships","j","url","attribute","method","page","permission","tagList","override","original","tagPrefix","required","onremove","render","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagsHomePageOption","minutes","settings","allow_tag_change","defaultLabel","count","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","o","r","t","toPrimitive","TypeError","String","toPropertyKey","__webpack_module_cache__","__webpack_require__","moduleId","_webpack_runtimes","cachedModule","__webpack_modules__","getter","__esModule","definition","chunkId","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","toStringTag","scriptUrl","importScripts","location","currentScript","Error","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/tags/js/dist/forum.js b/extensions/tags/js/dist/forum.js index af135145e6..4700ce7ab0 100644 --- a/extensions/tags/js/dist/forum.js +++ b/extensions/tags/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t,e,s={968:(t,e,s)=>{"use strict";s.d(e,{A:()=>o});var r=s(443),a=s.n(r);function o(t,e,s){void 0===e&&(e={}),void 0===s&&(s={});const r=t&&t.icon(),{useColor:o=!0}=s;return e.className=a()([e.className,"icon text-colored",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",o)},339:(t,e,s)=>{"use strict";s.d(e,{A:()=>g});var r=s(414),a=s.n(r),o=s(88),n=s.n(o),i=s(443),l=s.n(i),c=s(296),u=s.n(c),d=s(968);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const s=a()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const r=t.color();r&&(e.style["--tag-bg"]=r,e.className=l()(e.className,"colored",u()(r))),s&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(s?n():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.A)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},85:()=>{},618:(t,e,s)=>{"use strict";function r(t){return t.slice(0).sort(((t,e)=>{const s=t.position(),r=e.position();if(null===s&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===s)return 1;const a=t.parent(),o=e.parent();return a===o?s-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:s-o.position():0}))}s.d(e,{A:()=>r}),flarum.reg.add("flarum-tags","common/utils/sortTags",r)},319:(t,e,s)=>{"use strict";s.d(e,{X:()=>At});var r=s(488),a=s.n(r),o=s(805),n=s(954),i=s.n(n);class l{constructor(){(0,o.A)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(i().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),this.loadedIncludes??=new Set,i().store.find("tags",{include:t.join(",")}).then((e=>{const s=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),s}))}}flarum.reg.add("flarum-tags","common/states/TagListState",l);const c=flarum.reg.get("core","common/extend"),u=flarum.reg.get("core","forum/components/IndexSidebar");var d=s.n(u);const g=flarum.reg.get("core","common/components/Separator");var f=s.n(g);const p=flarum.reg.get("core","common/components/LinkButton");var h=s.n(p),b=s(88),v=s.n(b),T=s(443),y=s.n(T),x=s(968);class A extends(h()){view(t){const e=this.attrs.model,s=e&&e.description(),r=y()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(v(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:s||void 0},(0,x.A)(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))}static initAttrs(t){super.initAttrs(t);const e=t.model;t.params.tags=e?e.slug():"untagged",t.route=app.route("tag",t.params)}}flarum.reg.add("flarum-tags","forum/components/TagLinkButton",A);const N=flarum.reg.get("core","common/components/Page");var w=s.n(N);const C=flarum.reg.get("core","forum/components/PageStructure");var _=s.n(C);const P=flarum.reg.get("core","forum/components/WelcomeHero");var k=s.n(P),S=s(661),D=s.n(S);const L=flarum.reg.get("core","common/utils/ItemList");var I=s.n(L);const M=flarum.reg.get("core","common/helpers/humanTime");var j=s.n(M),E=s(296),B=s.n(E),V=s(233),H=s.n(V),O=s(339),R=s(618);class q extends(w()){constructor(){super(...arguments),(0,o.A)(this,"tags",void 0),(0,o.A)(this,"loading",void 0)}oninit(t){super.oninit(t),a().history.push("tags",H()(a().translator.trans("flarum-tags.forum.header.back_to_tags_tooltip"))),a().current.set("noTagsList",!0),this.tags=[];const e=a().preloadedApiDocument();e?this.tags=(0,R.A)(e.filter((t=>!t.isChild()))):(this.loading=!0,a().tagList.load(["children","lastPostedDiscussion","parent"]).then((()=>{this.tags=(0,R.A)(a().store.all("tags").filter((t=>!t.isChild()))),this.loading=!1,m.redraw()})))}oncreate(t){super.oncreate(t),a().setTitle(H()(a().translator.trans("flarum-tags.forum.all_tags.meta_title_text"))),a().setTitleCount(0)}view(){return m(_(),{className:"TagsPage Page--vertical",hero:this.hero.bind(this),sidebar:this.sidebar.bind(this)},this.contentItems().toArray())}contentItems(){const t=new(I());if(this.loading)t.add("loading",m(D(),null));else{const e=this.tags.filter((t=>null!==t.position())),s=this.tags.filter((t=>null===t.position()));t.add("tagTiles",this.tagTileListView(e),100),s.length&&t.add("cloud",this.cloudView(s),10)}return t}hero(){return m(k(),null)}sidebar(){return m(d(),null)}tagTileListView(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))}tagTileView(t){const e=t.lastPostedDiscussion(),s=(0,R.A)(t.children()||[]);return m("li",{className:y()("TagTile",{colored:t.color()},B()(t.color())),style:{"--tag-bg":t.color()}},m(v(),{className:"TagTile-info",href:a().route.tag(t)},m("div",{className:"TagTile-heading"},t.icon()&&(0,x.A)(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name())),m("p",{className:"TagTile-description"},t.description()),!!s&&m("div",{className:"TagTile-children"},s.map((t=>[m(v(),{href:a().route.tag(t)},t.name())," "])))),e?m(v(),{className:"TagTile-lastPostedDiscussion",href:a().route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),j()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}cloudView(t){return m("div",{className:"TagCloud"},t.map((t=>[(0,O.A)(t,{link:!0})," "])))}}flarum.reg.add("flarum-tags","forum/components/TagsPage",q);const $=flarum.reg.get("core","forum/components/IndexPage");var G=s.n($);const F=flarum.reg.get("core","forum/states/DiscussionListState");var K=s.n(F);const U=flarum.reg.get("core","forum/states/GlobalSearchState");var X=s.n(U),z=s(950),W=s.n(z);class J extends(W()){view(){const t=this.attrs.model,e=t.color();return m("header",{className:y()("Hero","TagHero",{"TagHero--colored":e,[B()(e)]:e}),style:e?{"--hero-bg":e}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},t.icon()&&(0,x.A)(t,{},{useColor:!1})," ",t.name()),m("div",{className:"Hero-subtitle"},t.description()))))}}flarum.reg.add("flarum-tags","forum/components/TagHero",J);const Q=t=>a().store.all("tags").find((e=>0===e.slug().localeCompare(t,void 0,{sensitivity:"base"}))),Y=flarum.reg.get("core","forum/components/DiscussionListItem");var Z=s.n(Y);const tt=flarum.reg.get("core","forum/components/DiscussionHero");var et=s.n(tt);function st(t,e){void 0===e&&(e={});const s=[],{link:r,...a}=e;return a.className=y()("TagsLabel",a.className),t?(0,R.A)(t).forEach((e=>{(e||1===t.length)&&s.push((0,O.A)(e,{link:r}))})):s.push((0,O.A)()),m("span",a,s)}s(414),flarum.reg.add("flarum-tags","common/helpers/tagsLabel",st);const rt=flarum.reg.get("core","forum/utils/DiscussionControls");var at=s.n(rt),ot=s(336),nt=s.n(ot);flarum.reg.addChunkModule("371","440","flarum-tags","forum/components/TagDiscussionModal"),flarum.reg.addChunkModule("371","440","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("371","440","flarum-tags","forum/components/ToggleButton");var it=s(838);const lt=flarum.reg.get("core","common/extenders");var ct=s.n(lt);const ut=flarum.reg.get("core","common/models/Discussion");var mt=s.n(ut);const dt=flarum.reg.get("core","forum/components/EventPost");var gt=s.n(dt);class ft extends(gt()){static initAttrs(t){super.initAttrs(t);const e=t.post.content()[0],s=t.post.content()[1];function r(t,e){return t.filter((t=>-1===e.indexOf(t))).map((t=>app.store.getById("tags",t)))}t.tagsAdded=r(s,e),t.tagsRemoved=r(e,s)}icon(){return"fas fa-tag"}descriptionKey(){return this.attrs.tagsAdded.length?this.attrs.tagsRemoved.length?"flarum-tags.forum.post_stream.added_and_removed_tags_text":"flarum-tags.forum.post_stream.added_tags_text":"flarum-tags.forum.post_stream.removed_tags_text"}descriptionData(){const t={};return this.attrs.tagsAdded.length&&(t.tagsAdded=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsAdded,{link:!0}),count:this.attrs.tagsAdded.length})),this.attrs.tagsRemoved.length&&(t.tagsRemoved=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsRemoved,{link:!0}),count:this.attrs.tagsRemoved.length})),t}}flarum.reg.add("flarum-tags","forum/components/DiscussionTaggedPost",ft);const pt=flarum.reg.get("core","common/utils/computed");var ht=s.n(pt);const bt=flarum.reg.get("core","common/Model");var vt=s.n(bt);class Tt extends(vt()){name(){return vt().attribute("name").call(this)}slug(){return vt().attribute("slug").call(this)}description(){return vt().attribute("description").call(this)}color(){return vt().attribute("color").call(this)}backgroundUrl(){return vt().attribute("backgroundUrl").call(this)}backgroundMode(){return vt().attribute("backgroundMode").call(this)}icon(){return vt().attribute("icon").call(this)}position(){return vt().attribute("position").call(this)}parent(){return vt().hasOne("parent").call(this)}children(){return vt().hasMany("children").call(this)}defaultSort(){return vt().attribute("defaultSort").call(this)}isChild(){return vt().attribute("isChild").call(this)}isHidden(){return vt().attribute("isHidden").call(this)}isPrimary(){return vt().attribute("isPrimary").call(this)}discussionCount(){return vt().attribute("discussionCount").call(this)}lastPostedAt(){return vt().attribute("lastPostedAt",vt().transformDate).call(this)}lastPostedDiscussion(){return vt().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vt().attribute("isRestricted").call(this)}canStartDiscussion(){return vt().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vt().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return ht()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",Tt);const yt=flarum.reg.get("core","common/query/IGambit");class xt extends yt.KeyValueGambit{constructor(){super(...arguments),(0,o.A)(this,"predicates",!0)}key(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let s=[];return Array.isArray(t)?(s=t.map((t=>this.fromFilter(t.toString(),e))),s.join(" ")):`${e?"-":""}${this.key()}:${this.filterValueToGambitValue(t)}`}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",xt);const At=[(new(ct().Store)).add("tags",Tt),(new(ct().Search)).gambit("discussions",xt),(new(ct().Routes)).add("tags","/tags",q).add("tag","/t/:tags",G()).helper("tag",(t=>a().route("tag",{tags:t.slug()}))),(new(ct().PostTypes)).add("discussionTagged",ft),new(ct().Model)(mt()).hasMany("tags").attribute("canTag")];a().initializers.add("flarum-tags",(()=>{a().tagList=new l,(0,c.extend)(d().prototype,"navItems",(function(t){if(t.add("tags",m(h(),{icon:"fas fa-th-large",href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.tags_link")),-10),a().current.get("noTagsList"))return;t.add("separator",m(f(),null),-12);const e=a().search.state.stickyParams(),s=a().store.all("tags"),r=a().currentTag(),o=s=>{let a=r===s;!a&&r&&(a=r.parent()===s),t.add("tag"+s.id(),m(A,{model:s,params:e,active:a},s?.name()),-14)};(0,R.A)(s).filter((t=>null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent())))).forEach(o);const n=s.filter((t=>null===t.position())).sort(((t,e)=>e.discussionCount()-t.discussionCount()));n.splice(0,3).forEach(o),n.length&&t.add("moreTags",m(h(),{href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.more_link")),-16)})),a().currentTag=function(t){if(this.currentActiveTag&&!t)return this.currentActiveTag;const e=this.search.state.params().tags;let s=null;if(e&&(s=Q(e)),e&&!s||s&&!s.isChild()&&!s.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,this.store.find("tags",e,{include:"children,children.parent,parent"}).then((()=>{this.currentActiveTag=Q(e),m.redraw()})).finally((()=>{this.currentTagLoading=!1}))}if(s)return this.currentActiveTag=s,this.currentActiveTag;this.currentActiveTag=void 0},(0,c.extend)(G().prototype,"view",(function(t){a().currentTag(!0)})),(0,c.override)(G().prototype,"hero",(function(t){const e=a().currentTag();return e?m(J,{model:e}):t()})),(0,c.extend)(G().prototype,"view",(function(t){const e=a().currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,c.extend)(G().prototype,"setTitle",(function(){const t=a().currentTag();t&&a().setTitle(t.name())})),(0,c.extend)(d().prototype,"items",(function(t){const e=a().currentTag();if(e){const s=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");s&&(o.attrs.className=y()([o.attrs.className,"Button--tagColored",B()(s)]),o.attrs.style={"--color":s}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,c.extend)(X().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,c.extend)(K().prototype,"requestParams",(function(t){"string"==typeof t.include?t.include=[t.include]:t.include?.push("tags","tags.parent"),this.params.tags&&(t.filter||={},t.filter.tag=this.params.tags)})),(0,c.extend)(Z().prototype,"infoItems",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e),10)})),(0,c.extend)(et().prototype,"view",(function(t){const e=(0,R.A)(this.attrs.discussion.tags());if(e&&e.length){const s=e[0].color();s&&(t.attrs.style={"--hero-bg":s},t.attrs.className=y()(t.attrs.className,"DiscussionHero--colored",B()(s)))}})),(0,c.extend)(et().prototype,"items",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e,{link:!0}),5)})),(0,c.extend)(at(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(nt(),{icon:"fas fa-tag",onclick:()=>app.modal.show((()=>s.e(371).then(s.bind(s,440))),{discussion:e})},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))})),(0,c.extend)(d().prototype,"newDiscussionAction",(function(t){const e=a().currentTag();if(e){const s=e.parent(),r=s?[s,e]:[e];t.then((t=>t.fields.tags=r))}else a().composer.fields.tags=[]})),(0,c.extend)("flarum/forum/components/DiscussionComposer","oninit",(function(){a().tagList.load(["parent"]).then((()=>m.redraw())),this.constructor.prototype.chooseTags=function(){(0,it.A)().length&&a().modal.show((()=>s.e(371).then(s.bind(s,440))),{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:t=>{this.composer.fields.tags=t,this.$("textarea").focus()}})}})),(0,c.extend)("flarum/forum/components/DiscussionComposer","headerItems",(function(t){const e=this.composer.fields.tags||[],s=(0,it.A)();t.add("tags",m(nt(),{className:y()(["DiscussionComposer-changeTags","Button Button--ua-reset",!s.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?st(e):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,c.override)("flarum/forum/components/DiscussionComposer","onsubmit",(function(t){const e=this.composer.fields.tags||[],r=e.filter((t=>null!==t.position()&&!t.isChild())),o=e.filter((t=>null===t.position())),n=(0,it.A)(),i=parseInt(a().forum.attribute("minPrimaryTags")),l=parseInt(a().forum.attribute("minSecondaryTags")),c=parseInt(a().forum.attribute("maxPrimaryTags")),u=parseInt(a().forum.attribute("maxSecondaryTags"));(!e.length&&0!==c&&0!==u||r.lengths.e(371).then(s.bind(s,440))),{selectedTags:e,onsubmit:e=>{this.composer.fields.tags=e,t()}}):t()})),(0,c.extend)("flarum/forum/components/DiscussionComposer","data",(function(t){t.relationships=t.relationships||{},t.relationships.tags=this.composer.fields.tags}))}))},838:(t,e,s)=>{"use strict";function r(t){let e=app.store.all("tags");if(t){const s=t.tags()||[];e=e.filter((t=>t.canAddToDiscussion()||s.includes(t)))}else e=e.filter((t=>t.canStartDiscussion()));return e}s.d(e,{A:()=>r}),flarum.reg.add("flarum-tags","forum/utils/getSelectableTags",r)},950:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},954:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},336:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},15:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},88:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},661:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},607:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},296:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},280:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},821:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},443:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},414:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},233:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},488:t=>{"use strict";t.exports=flarum.reg.get("core","forum/app")},137:t=>{"use strict";t.exports=flarum.reg.get("core","forum/components/DiscussionPage")},805:(t,e,s)=>{"use strict";function r(t){return r="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},r(t)}function a(t,e,s){return(e=function(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.d(e,{A:()=>a})}},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return s[t](o,o.exports,a),o.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,s)=>(a.f[s](t,e),e)),[])),a.u=t=>"forum/components/TagDiscussionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(s,r,o,n)=>{if(t[s])t[s].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var a=t[s];if(delete t[s],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((t=>t(r))),e)return e(r)},g=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");if(s.length)for(var r=s.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=s[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const s=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,s)},(()=>{var t={170:0};a.f.j=(e,s)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)s.push(r[2]);else{var o=new Promise(((s,a)=>r=t[e]=[s,a]));s.push(r[2]=o);var n=a.p+a.u(e),i=new Error;a.l(n,(s=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,r[1](i)}}),"chunk-"+e,e)}};var e=(e,s)=>{var r,o,[n,i,l]=s,c=0;if(n.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);l&&l(a)}for(e&&e(s);c{"use strict";a.r(o),a.d(o,{extend:()=>s.X});var t=a(85),e={};for(const s in t)"default"!==s&&(e[s]=()=>t[s]);a.d(o,e);var s=a(319)})(),module.exports=o})(); +(()=>{var t,e,s={968:(t,e,s)=>{"use strict";s.d(e,{A:()=>o});var r=s(443),a=s.n(r);function o(t,e,s){void 0===e&&(e={}),void 0===s&&(s={});const r=t&&t.icon(),{useColor:o=!0}=s;return e.className=a()([e.className,"icon text-colored",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",o)},339:(t,e,s)=>{"use strict";s.d(e,{A:()=>g});var r=s(414),a=s.n(r),o=s(88),n=s.n(o),i=s(443),l=s.n(i),c=s(296),u=s.n(c),d=s(968);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const s=a()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const r=t.color();r&&(e.style["--tag-bg"]=r,e.className=l()(e.className,"colored",u()(r))),s&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(s?n():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.A)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},85:()=>{},618:(t,e,s)=>{"use strict";function r(t){return t.slice(0).sort(((t,e)=>{const s=t.position(),r=e.position();if(null===s&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===s)return 1;const a=t.parent(),o=e.parent();return a===o?s-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:s-o.position():0}))}s.d(e,{A:()=>r}),flarum.reg.add("flarum-tags","common/utils/sortTags",r)},319:(t,e,s)=>{"use strict";s.d(e,{X:()=>At});var r=s(488),a=s.n(r),o=s(805),n=s(954),i=s.n(n);class l{constructor(){(0,o.A)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(i().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),this.loadedIncludes??=new Set,i().store.find("tags",{include:t.join(",")}).then((e=>{const s=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),s}))}}flarum.reg.add("flarum-tags","common/states/TagListState",l);const c=flarum.reg.get("core","common/extend"),u=flarum.reg.get("core","forum/components/IndexSidebar");var d=s.n(u);const g=flarum.reg.get("core","common/components/Separator");var f=s.n(g);const p=flarum.reg.get("core","common/components/LinkButton");var h=s.n(p),b=s(88),v=s.n(b),T=s(443),y=s.n(T),x=s(968);class A extends(h()){view(t){const e=this.attrs.model,s=e&&e.description(),r=y()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(v(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:s||void 0},(0,x.A)(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))}static initAttrs(t){super.initAttrs(t);const e=t.model;t.params.tags=e?e.slug():"untagged",t.route=app.route("tag",t.params)}}flarum.reg.add("flarum-tags","forum/components/TagLinkButton",A);const N=flarum.reg.get("core","common/components/Page");var w=s.n(N);const _=flarum.reg.get("core","forum/components/PageStructure");var C=s.n(_);const k=flarum.reg.get("core","forum/components/WelcomeHero");var P=s.n(k),S=s(661),D=s.n(S);const L=flarum.reg.get("core","common/utils/ItemList");var I=s.n(L);const M=flarum.reg.get("core","common/helpers/humanTime");var j=s.n(M),E=s(296),B=s.n(E),V=s(233),H=s.n(V),O=s(339),R=s(618);class q extends(w()){constructor(){super(...arguments),(0,o.A)(this,"tags",void 0),(0,o.A)(this,"loading",void 0)}oninit(t){super.oninit(t),a().history.push("tags",H()(a().translator.trans("flarum-tags.forum.header.back_to_tags_tooltip"))),a().current.set("noTagsList",!0),this.tags=[];const e=a().preloadedApiDocument();e?this.tags=(0,R.A)(e.filter((t=>!t.isChild()))):(this.loading=!0,a().tagList.load(["children","lastPostedDiscussion","parent"]).then((()=>{this.tags=(0,R.A)(a().store.all("tags").filter((t=>!t.isChild()))),this.loading=!1,m.redraw()})))}oncreate(t){super.oncreate(t),a().setTitle(H()(a().translator.trans("flarum-tags.forum.all_tags.meta_title_text"))),a().setTitleCount(0)}view(){return m(C(),{className:"TagsPage Page--vertical",hero:this.hero.bind(this),sidebar:this.sidebar.bind(this)},this.contentItems().toArray())}contentItems(){const t=new(I());if(this.loading)t.add("loading",m(D(),null));else{const e=this.tags.filter((t=>null!==t.position())),s=this.tags.filter((t=>null===t.position()));t.add("tagTiles",this.tagTileListView(e),100),s.length&&t.add("cloud",this.cloudView(s),10)}return t}hero(){return m(P(),null)}sidebar(){return m(d(),null)}tagTileListView(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))}tagTileView(t){const e=t.lastPostedDiscussion(),s=(0,R.A)(t.children()||[]);return m("li",{className:y()("TagTile",{colored:t.color()},B()(t.color())),style:{"--tag-bg":t.color()}},m(v(),{className:"TagTile-info",href:a().route.tag(t)},m("div",{className:"TagTile-heading"},t.icon()&&(0,x.A)(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name())),m("p",{className:"TagTile-description"},t.description()),!!s&&m("div",{className:"TagTile-children"},s.map((t=>[m(v(),{href:a().route.tag(t)},t.name())," "])))),e?m(v(),{className:"TagTile-lastPostedDiscussion",href:a().route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),j()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}cloudView(t){return m("div",{className:"TagCloud"},t.map((t=>[(0,O.A)(t,{link:!0})," "])))}}flarum.reg.add("flarum-tags","forum/components/TagsPage",q);const $=flarum.reg.get("core","forum/components/IndexPage");var G=s.n($);const F=flarum.reg.get("core","forum/states/DiscussionListState");var K=s.n(F);const U=flarum.reg.get("core","forum/states/GlobalSearchState");var X=s.n(U),z=s(950),W=s.n(z);class J extends(W()){view(){const t=this.attrs.model,e=t.color();return m("header",{className:y()("Hero","TagHero",{"TagHero--colored":e,[B()(e)]:e}),style:e?{"--hero-bg":e}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},t.icon()&&(0,x.A)(t,{},{useColor:!1})," ",t.name()),m("div",{className:"Hero-subtitle"},t.description()))))}}flarum.reg.add("flarum-tags","forum/components/TagHero",J);const Q=t=>a().store.all("tags").find((e=>0===e.slug().localeCompare(t,void 0,{sensitivity:"base"}))),Y=flarum.reg.get("core","forum/components/DiscussionListItem");var Z=s.n(Y);const tt=flarum.reg.get("core","forum/components/DiscussionHero");var et=s.n(tt);function st(t,e){void 0===e&&(e={});const s=[],{link:r,...a}=e;return a.className=y()("TagsLabel",a.className),t?(0,R.A)(t).forEach((e=>{(e||1===t.length)&&s.push((0,O.A)(e,{link:r}))})):s.push((0,O.A)()),m("span",a,s)}s(414),flarum.reg.add("flarum-tags","common/helpers/tagsLabel",st);const rt=flarum.reg.get("core","forum/utils/DiscussionControls");var at=s.n(rt),ot=s(336),nt=s.n(ot);flarum.reg.addChunkModule("371","440","flarum-tags","forum/components/TagDiscussionModal"),flarum.reg.addChunkModule("371","440","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("371","440","flarum-tags","forum/components/ToggleButton");var it=s(838);const lt=flarum.reg.get("core","common/extenders");var ct=s.n(lt);const ut=flarum.reg.get("core","common/models/Discussion");var mt=s.n(ut);const dt=flarum.reg.get("core","forum/components/EventPost");var gt=s.n(dt);class ft extends(gt()){static initAttrs(t){super.initAttrs(t);const e=t.post.content()[0],s=t.post.content()[1];function r(t,e){return t.filter((t=>-1===e.indexOf(t))).map((t=>app.store.getById("tags",t)))}t.tagsAdded=r(s,e),t.tagsRemoved=r(e,s)}icon(){return"fas fa-tag"}descriptionKey(){return this.attrs.tagsAdded.length?this.attrs.tagsRemoved.length?"flarum-tags.forum.post_stream.added_and_removed_tags_text":"flarum-tags.forum.post_stream.added_tags_text":"flarum-tags.forum.post_stream.removed_tags_text"}descriptionData(){const t={};return this.attrs.tagsAdded.length&&(t.tagsAdded=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsAdded,{link:!0}),count:this.attrs.tagsAdded.length})),this.attrs.tagsRemoved.length&&(t.tagsRemoved=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsRemoved,{link:!0}),count:this.attrs.tagsRemoved.length})),t}}flarum.reg.add("flarum-tags","forum/components/DiscussionTaggedPost",ft);const pt=flarum.reg.get("core","common/utils/computed");var ht=s.n(pt);const bt=flarum.reg.get("core","common/Model");var vt=s.n(bt);class Tt extends(vt()){name(){return vt().attribute("name").call(this)}slug(){return vt().attribute("slug").call(this)}description(){return vt().attribute("description").call(this)}color(){return vt().attribute("color").call(this)}backgroundUrl(){return vt().attribute("backgroundUrl").call(this)}backgroundMode(){return vt().attribute("backgroundMode").call(this)}icon(){return vt().attribute("icon").call(this)}position(){return vt().attribute("position").call(this)}parent(){return vt().hasOne("parent").call(this)}children(){return vt().hasMany("children").call(this)}defaultSort(){return vt().attribute("defaultSort").call(this)}isChild(){return vt().attribute("isChild").call(this)}isHidden(){return vt().attribute("isHidden").call(this)}isPrimary(){return vt().attribute("isPrimary").call(this)}discussionCount(){return vt().attribute("discussionCount").call(this)}lastPostedAt(){return vt().attribute("lastPostedAt",vt().transformDate).call(this)}lastPostedDiscussion(){return vt().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vt().attribute("isRestricted").call(this)}canStartDiscussion(){return vt().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vt().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return ht()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",Tt);const yt=flarum.reg.get("core","common/query/IGambit");class xt extends yt.KeyValueGambit{constructor(){super(...arguments),(0,o.A)(this,"predicates",!0)}key(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let s=[];return Array.isArray(t)?(s=t.map((t=>this.fromFilter(t.toString(),e))),s.join(" ")):`${e?"-":""}${this.key()}:${this.filterValueToGambitValue(t)}`}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",xt);const At=[(new(ct().Store)).add("tags",Tt),(new(ct().Search)).gambit("discussions",xt),(new(ct().Routes)).add("tags","/tags",q).add("tag","/t/:tags",G()).helper("tag",(t=>a().route("tag",{tags:t.slug()}))),(new(ct().PostTypes)).add("discussionTagged",ft),new(ct().Model)(mt()).hasMany("tags").attribute("canTag")];a().initializers.add("flarum-tags",(()=>{a().tagList=new l,(0,c.extend)(d().prototype,"navItems",(function(t){if(t.add("tags",m(h(),{icon:"fas fa-th-large",href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.tags_link")),-10),a().current.get("noTagsList"))return;t.add("separator",m(f(),null),-12);const e=a().search.state.stickyParams(),s=a().store.all("tags"),r=a().currentTag(),o=s=>{let a=r===s;!a&&r&&(a=r.parent()===s),t.add("tag"+s.id(),m(A,{model:s,params:e,active:a},s?.name()),-14)};(0,R.A)(s).filter((t=>null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent())))).forEach(o);const n=s.filter((t=>null===t.position())).sort(((t,e)=>e.discussionCount()-t.discussionCount()));n.splice(0,3).forEach(o),n.length&&t.add("moreTags",m(h(),{href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.more_link")),-16)})),a().currentTag=function(t){if(this.currentActiveTag&&!t)return this.currentActiveTag;const e=this.search.state.params().tags;let s=null;if(e&&(s=Q(e)),e&&!s||s&&!s.isChild()&&!s.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,this.store.find("tags",e,{include:"children,children.parent,parent"}).then((()=>{this.currentActiveTag=Q(e),m.redraw()})).finally((()=>{this.currentTagLoading=!1}))}if(s)return this.currentActiveTag=s,this.currentActiveTag;this.currentActiveTag=void 0},(0,c.extend)(G().prototype,"view",(function(t){a().currentTag(!0)})),(0,c.override)(G().prototype,"hero",(function(t){const e=a().currentTag();return e?m(J,{model:e}):t()})),(0,c.extend)(G().prototype,"view",(function(t){const e=a().currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,c.extend)(G().prototype,"setTitle",(function(){const t=a().currentTag();t&&a().setTitle(t.name())})),(0,c.extend)(d().prototype,"items",(function(t){const e=a().currentTag();if(e){const s=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");s&&(o.attrs.className=y()([o.attrs.className,"Button--tagColored",B()(s)]),o.attrs.style={"--color":s}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,c.extend)(X().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,c.extend)(K().prototype,"requestParams",(function(t){"string"==typeof t.include?t.include=[t.include]:t.include?.push("tags","tags.parent"),this.params.tags&&(t.filter||={},t.filter.tag=this.params.tags)})),(0,c.extend)(Z().prototype,"infoItems",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e),10)})),(0,c.extend)(et().prototype,"view",(function(t){const e=(0,R.A)(this.attrs.discussion.tags());if(e&&e.length){const s=e[0].color();s&&(t.attrs.style={"--hero-bg":s},t.attrs.className=y()(t.attrs.className,"DiscussionHero--colored",B()(s)))}})),(0,c.extend)(et().prototype,"items",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e,{link:!0}),5)})),(0,c.extend)(at(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(nt(),{icon:"fas fa-tag",onclick:()=>app.modal.show((()=>s.e(371).then(s.bind(s,440))),{discussion:e})},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))})),(0,c.extend)(d().prototype,"newDiscussionAction",(function(t){const e=a().currentTag();if(e){const s=e.parent(),r=s?[s,e]:[e];t.then((t=>t.fields.tags=r))}else a().composer.fields.tags=[]})),(0,c.extend)("flarum/forum/components/DiscussionComposer","oninit",(function(){a().tagList.load(["parent"]).then((()=>m.redraw())),this.constructor.prototype.chooseTags=function(){(0,it.A)().length&&a().modal.show((()=>s.e(371).then(s.bind(s,440))),{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:t=>{this.composer.fields.tags=t,this.$("textarea").focus()}})}})),(0,c.extend)("flarum/forum/components/DiscussionComposer","headerItems",(function(t){const e=this.composer.fields.tags||[],s=(0,it.A)();t.add("tags",m(nt(),{className:y()(["DiscussionComposer-changeTags","Button Button--ua-reset",!s.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?st(e):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,c.override)("flarum/forum/components/DiscussionComposer","onsubmit",(function(t){const e=this.composer.fields.tags||[],r=e.filter((t=>null!==t.position()&&!t.isChild())),o=e.filter((t=>null===t.position())),n=(0,it.A)(),i=parseInt(a().forum.attribute("minPrimaryTags")),l=parseInt(a().forum.attribute("minSecondaryTags")),c=parseInt(a().forum.attribute("maxPrimaryTags")),u=parseInt(a().forum.attribute("maxSecondaryTags"));(!e.length&&0!==c&&0!==u||r.lengths.e(371).then(s.bind(s,440))),{selectedTags:e,onsubmit:e=>{this.composer.fields.tags=e,t()}}):t()})),(0,c.extend)("flarum/forum/components/DiscussionComposer","data",(function(t){t.relationships=t.relationships||{},t.relationships.tags=this.composer.fields.tags}))}))},838:(t,e,s)=>{"use strict";function r(t){let e=app.store.all("tags");if(t){const s=t.tags()||[];e=e.filter((t=>t.canAddToDiscussion()||s.includes(t)))}else e=e.filter((t=>t.canStartDiscussion()));return e}s.d(e,{A:()=>r}),flarum.reg.add("flarum-tags","forum/utils/getSelectableTags",r)},950:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},954:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},336:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},15:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},88:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},661:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},607:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},296:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},280:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},821:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},443:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},414:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},233:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},488:t=>{"use strict";t.exports=flarum.reg.get("core","forum/app")},137:t=>{"use strict";t.exports=flarum.reg.get("core","forum/components/DiscussionPage")},805:(t,e,s)=>{"use strict";function r(t){return r="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},r(t)}function a(t,e,s){return(e=function(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.d(e,{A:()=>a})}},r={};function a(t){flarum.reg._webpack_runtimes["flarum-tags"]||=a;var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return s[t](o,o.exports,a),o.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,s)=>(a.f[s](t,e),e)),[])),a.u=t=>"forum/components/TagDiscussionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(s,r,o,n)=>{if(t[s])t[s].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var a=t[s];if(delete t[s],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((t=>t(r))),e)return e(r)},g=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");if(s.length)for(var r=s.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=s[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const s=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,s)},(()=>{var t={170:0};a.f.j=(e,s)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)s.push(r[2]);else{var o=new Promise(((s,a)=>r=t[e]=[s,a]));s.push(r[2]=o);var n=a.p+a.u(e),i=new Error;a.l(n,(s=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,r[1](i)}}),"chunk-"+e,e)}};var e=(e,s)=>{var r,o,[n,i,l]=s,c=0;if(n.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);l&&l(a)}for(e&&e(s);c{"use strict";a.r(o),a.d(o,{extend:()=>s.X});var t=a(85),e={};for(const s in t)"default"!==s&&(e[s]=()=>t[s]);a.d(o,e);var s=a(319)})(),module.exports=o})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/tags/js/dist/forum.js.map b/extensions/tags/js/dist/forum.js.map index 3da1cbafe6..730277d4f6 100644 --- a/extensions/tags/js/dist/forum.js.map +++ b/extensions/tags/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"UAAIA,EACAC,E,qECAW,SAASC,EAAQC,EAAKC,EAAOC,QAC5B,IAAVD,IACFA,EAAQ,CAAC,QAEM,IAAbC,IACFA,EAAW,CAAC,GAEd,MAAMC,EAAUH,GAAOA,EAAII,QACrB,SACJC,GAAW,GACTH,EAQJ,OAPAD,EAAMK,UAAY,IAAU,CAACL,EAAMK,UAAW,oBAAqBH,EAAUH,EAAII,OAAS,YACtFJ,GAAOK,GACTJ,EAAMM,MAAQN,EAAMM,OAAS,CAAC,EAC9BN,EAAMM,MAAM,WAAaP,EAAIQ,SACnBR,IACVC,EAAMK,WAAa,aAEdH,EAAUM,EAAE,IAAKR,GAASQ,EAAE,OAAQR,EAC7C,CACAS,OAAOC,IAAIC,IAAI,cAAe,yBAA0Bb,E,kIChBzC,SAASc,EAASb,EAAKC,QACtB,IAAVA,IACFA,EAAQ,CAAC,GAEXA,EAAMM,MAAQN,EAAMM,OAAS,CAAC,EAC9BN,EAAMK,UAAY,aAAeL,EAAMK,WAAa,IACpD,MAAMQ,EAAO,IAAQb,EAAO,QACtBc,EAAUf,EAAMA,EAAIgB,OAASC,IAAIC,WAAWC,MAAM,oCACxD,GAAInB,EAAK,CACP,MAAMQ,EAAQR,EAAIQ,QACdA,IACFP,EAAMM,MAAM,YAAcC,EAC1BP,EAAMK,UAAY,IAAUL,EAAMK,UAAW,UAAW,IAAkBE,KAExEM,IACFb,EAAMmB,MAAQpB,EAAIqB,eAAiB,GACnCpB,EAAMqB,KAAOL,IAAIM,MAAM,MAAO,CAC5BC,KAAMxB,EAAIyB,UAGVzB,EAAI0B,YACNzB,EAAMK,WAAa,mBAEvB,MACEL,EAAMK,WAAa,YAErB,OAAOG,EAAEK,EAAO,IAAO,OAAQb,EAAOQ,EAAE,OAAQ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zBqB,EAAUoE,EAASzF,GAChBW,EAAoBlB,EAAEqF,EAAiBzD,IAAYyD,EAAgBzD,IACrEyD,EAAgBzD,GAAS,KAE1ByD,EAAgBzD,GAAW,CAC5B,EAIGwE,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmB9O,QAAQwO,EAAqBnN,KAAK,KAAM,IAC3DyN,EAAmBhO,KAAO0N,EAAqBnN,KAAK,KAAMyN,EAAmBhO,KAAKO,KAAKyN,G","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Separator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/WelcomeHero')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/tags/./src/forum/components/TagsPage.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionHero')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n if (includes === void 0) {\n includes = [];\n }\n this.loadedIncludes ??= new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Separator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', {\n child: tag.isChild()\n }, this.attrs.className);\n return m(Link, {\n className: className,\n href: this.attrs.route,\n style: tag ? {\n '--color': tag.color()\n } : undefined,\n title: description || undefined\n }, tagIcon(tag, {\n className: 'Button-icon'\n }), m(\"span\", {\n className: \"Button-label\"\n }, tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')));\n }\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const tag = attrs.model;\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagLinkButton', TagLinkButton);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Page');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PageStructure');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/WelcomeHero');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport PageStructure from 'flarum/forum/components/PageStructure';\nimport WelcomeHero from 'flarum/forum/components/WelcomeHero';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\nexport default class TagsPage extends Page {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", void 0);\n _defineProperty(this, \"loading\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.history.push('tags', extractText(app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip')));\n app.current.set('noTagsList', true);\n this.tags = [];\n const preloaded = app.preloadedApiDocument();\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n }\n this.loading = true;\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n this.loading = false;\n m.redraw();\n });\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n app.setTitle(extractText(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text')));\n app.setTitleCount(0);\n }\n view() {\n return m(PageStructure, {\n className: \"TagsPage Page--vertical\",\n hero: this.hero.bind(this),\n sidebar: this.sidebar.bind(this)\n }, this.contentItems().toArray());\n }\n contentItems() {\n const items = new ItemList();\n if (this.loading) {\n items.add('loading', m(LoadingIndicator, null));\n } else {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n return items;\n }\n hero() {\n return m(WelcomeHero, null);\n }\n sidebar() {\n return m(IndexSidebar, null);\n }\n tagTileListView(pinned) {\n return m(\"ul\", {\n className: \"TagTiles\"\n }, pinned.map(this.tagTileView.bind(this)));\n }\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n return m(\"li\", {\n className: classList('TagTile', {\n colored: tag.color()\n }, textContrastClass(tag.color())),\n style: {\n '--tag-bg': tag.color()\n }\n }, m(Link, {\n className: \"TagTile-info\",\n href: app.route.tag(tag)\n }, m(\"div\", {\n className: \"TagTile-heading\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), m(\"h3\", {\n className: \"TagTile-name\"\n }, tag.name())), m(\"p\", {\n className: \"TagTile-description\"\n }, tag.description()), !!children && m(\"div\", {\n className: \"TagTile-children\"\n }, children.map(child => [m(Link, {\n href: app.route.tag(child)\n }, child.name()), ' ']))), lastPostedDiscussion ? m(Link, {\n className: \"TagTile-lastPostedDiscussion\",\n href: app.route.discussion(lastPostedDiscussion, lastPostedDiscussion.lastPostNumber())\n }, m(\"span\", {\n className: \"TagTile-lastPostedDiscussion-title\"\n }, lastPostedDiscussion.title()), humanTime(lastPostedDiscussion.lastPostedAt())) : m(\"span\", {\n className: \"TagTile-lastPostedDiscussion\"\n }));\n }\n cloudView(cloud) {\n return m(\"div\", {\n className: \"TagCloud\"\n }, cloud.map(tag => [tagLabel(tag, {\n link: true\n }), ' ']));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagsPage', TagsPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n return m(\"header\", {\n className: classList('Hero', 'TagHero', {\n 'TagHero--colored': color,\n [textContrastClass(color)]: color\n }),\n style: color ? {\n '--hero-bg': color\n } : undefined\n }, m(\"div\", {\n className: \"container\"\n }, m(\"div\", {\n className: \"containerNarrow\"\n }, m(\"h1\", {\n className: \"Hero-title\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), \" \", tag.name()), m(\"div\", {\n className: \"Hero-subtitle\"\n }, tag.description()))));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagHero', TagHero);","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport TagHero from './components/TagHero';\nconst findTag = slug => app.store.all('tags').find(tag => tag.slug().localeCompare(slug, undefined, {\n sensitivity: 'base'\n}) === 0);\nexport default function addTagFilter() {\n app.currentTag = function (reload) {\n if (this.currentActiveTag && !reload) {\n return this.currentActiveTag;\n }\n const slug = this.search.state.params().tags;\n let tag = null;\n if (slug) {\n tag = findTag(slug);\n }\n if (slug && !tag || tag && !tag.isChild() && !tag.children()) {\n if (this.currentTagLoading) {\n return;\n }\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n this.store.find('tags', slug, {\n include: 'children,children.parent,parent'\n }).then(() => {\n this.currentActiveTag = findTag(slug);\n m.redraw();\n }).finally(() => {\n this.currentTagLoading = false;\n });\n }\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n this.currentActiveTag = undefined;\n return;\n };\n extend(IndexPage.prototype, 'view', function (vdom) {\n app.currentTag(true);\n });\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = app.currentTag();\n if (tag) return m(TagHero, {\n model: tag\n });\n return original();\n });\n extend(IndexPage.prototype, 'view', function (vdom) {\n const tag = app.currentTag();\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = app.currentTag();\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexSidebar.prototype, 'items', function (items) {\n const tag = app.currentTag();\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion');\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = {\n '--color': color\n };\n }\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button');\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n params.include?.push('tags', 'tags.parent');\n }\n if (this.params.tags) {\n params.filter ||= {};\n params.filter.tag = this.params.tags;\n }\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionHero');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\nexport default function addTagControl() {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add('tags', m(Button, {\n icon: \"fas fa-tag\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n discussion\n })\n }, app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button')));\n }\n });\n}flarum.reg.addChunkModule('371', '440', 'flarum-tags', 'forum/components/TagDiscussionModal');\nflarum.reg.addChunkModule('371', '440', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('371', '440', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n function diffTags(tags1, tags2) {\n return tags1.filter(tag => tags2.indexOf(tag) === -1).map(id => app.store.getById('tags', id));\n }\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n icon() {\n return 'fas fa-tag';\n }\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n descriptionData() {\n const data = {};\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, {\n link: true\n }),\n count: this.attrs.tagsAdded.length\n });\n }\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, {\n link: true\n }),\n count: this.attrs.tagsRemoved.length\n });\n }\n return data;\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/DiscussionTaggedPost', DiscussionTaggedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return `${negate ? '-' : ''}${this.key()}:${this.filterValueToGambitValue(value)}`;\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('tags', '/tags', TagsPage) //\n.add('tag', '/t/:tags', IndexPage) //\n.helper('tag', tag => app.route('tag', {\n tags: tag.slug()\n})), new Extend.PostTypes() //\n.add('discussionTagged', DiscussionTaggedPost), new Extend.Model(Discussion) //\n.hasMany('tags') //\n.attribute('canTag')];","import app from 'flarum/forum/app';\nimport TagListState from '../common/states/TagListState';\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', () => {\n app.tagList = new TagListState();\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagList() {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n items.add('tags', m(LinkButton, {\n icon: \"fas fa-th-large\",\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.tags_link')), -10);\n if (app.current.get('noTagsList')) return;\n items.add('separator', m(Separator, null), -12);\n const params = app.search.state.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = app.currentTag();\n const addTag = tag => {\n let active = currentTag === tag;\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add('tag' + tag.id(), m(TagLinkButton, {\n model: tag,\n params: params,\n active: active\n }, tag?.name()), -14);\n };\n sortTags(tags).filter(tag => tag.position() !== null && (!tag.isChild() || currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))).forEach(addTag);\n const more = tags.filter(tag => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n more.splice(0, 3).forEach(addTag);\n if (more.length) {\n items.add('moreTags', m(LinkButton, {\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.more_link')), -16);\n }\n });\n}","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagLabels() {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {\n '--hero-bg': color\n };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {\n link: true\n }), 5);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport classList from 'flarum/common/utils/classList';\nimport Button from 'flarum/common/components/Button';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\nexport default function addTagComposer() {\n extend(IndexSidebar.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = app.currentTag();\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then(composer => composer.fields.tags = tags);\n } else {\n app.composer.fields.tags = [];\n }\n });\n extend('flarum/forum/components/DiscussionComposer', 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n\n // Add tag-selection abilities to the discussion composer.\n this.constructor.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n if (!selectableTags.length) return;\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n }\n });\n };\n });\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend('flarum/forum/components/DiscussionComposer', 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n items.add('tags', m(Button, {\n className: classList(['DiscussionComposer-changeTags', 'Button Button--ua-reset', !selectableTags.length && 'disabled']),\n onclick: this.chooseTags.bind(this)\n }, tags.length ? tagsLabel(tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link'))), 10);\n });\n override('flarum/forum/components/DiscussionComposer', 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter(tag => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter(tag => tag.position() === null);\n const selectableTags = getSelectableTags();\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n if ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0 || chosenPrimaryTags.length < minPrimaryTags || chosenSecondaryTags.length < minSecondaryTags) && selectableTags.length) {\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: chosenTags,\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n original();\n }\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend('flarum/forum/components/DiscussionComposer', 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n if (discussion) {\n const discussionTags = discussion.tags() || [];\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussionTags.includes(tag));\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n return tags;\n}\nflarum.reg.add('flarum-tags', 'forum/utils/getSelectableTags', getSelectableTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/DiscussionPage');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/components/TagDiscussionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t170: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","style","color","m","flarum","reg","add","tagLabel","link","tagText","name","app","translator","trans","title","description","href","route","tags","slug","isChild","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagListState","constructor","this","load","includes","loadedIncludes","query","unloadedIncludes","filter","include","has","length","Promise","resolve","all","Set","find","join","then","val","Array","isArray","forEach","get","TagLinkButton","view","vnode","model","child","undefined","initAttrs","super","params","TagsPage","arguments","oninit","push","set","preloaded","loading","redraw","oncreate","hero","bind","sidebar","contentItems","toArray","items","pinned","cloud","tagTileListView","cloudView","map","tagTileView","lastPostedDiscussion","children","colored","discussion","lastPostNumber","lastPostedAt","TagHero","findTag","localeCompare","sensitivity","tagsLabel","otherAttrs","addChunkModule","DiscussionTaggedPost","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","store","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","data","count","Tag","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isPrimary","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","value","fromFilter","negate","gambits","toString","filterValueToGambitValue","gambit","helper","hasMany","attribute","extend","state","stickyParams","currentTag","addTag","active","more","splice","reload","currentActiveTag","search","currentTagLoading","finally","vdom","override","original","user","newDiscussion","disabled","param","canTag","onclick","modal","show","promise","composer","fields","prototype","chooseTags","getSelectableTags","selectedTags","onsubmit","$","focus","selectableTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","parseInt","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","relationships","discussionTags","module","exports","_typeof","o","Symbol","iterator","_defineProperty","e","r","t","i","toPrimitive","TypeError","String","toPropertyKey","Object","defineProperty","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","f","chunkId","keys","reduce","promises","u","g","globalThis","Function","window","obj","prop","hasOwnProperty","l","url","done","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","fn","setTimeout","type","target","head","appendChild","toStringTag","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"UAAIA,EACAC,E,qECAW,SAASC,EAAQC,EAAKC,EAAOC,QAC5B,IAAVD,IACFA,EAAQ,CAAC,QAEM,IAAbC,IACFA,EAAW,CAAC,GAEd,MAAMC,EAAUH,GAAOA,EAAII,QACrB,SACJC,GAAW,GACTH,EAQJ,OAPAD,EAAMK,UAAY,IAAU,CAACL,EAAMK,UAAW,oBAAqBH,EAAUH,EAAII,OAAS,YACtFJ,GAAOK,GACTJ,EAAMM,MAAQN,EAAMM,OAAS,CAAC,EAC9BN,EAAMM,MAAM,WAAaP,EAAIQ,SACnBR,IACVC,EAAMK,WAAa,aAEdH,EAAUM,EAAE,IAAKR,GAASQ,EAAE,OAAQR,EAC7C,CACAS,OAAOC,IAAIC,IAAI,cAAe,yBAA0Bb,E,kIChBzC,SAASc,EAASb,EAAKC,QACtB,IAAVA,IACFA,EAAQ,CAAC,GAEXA,EAAMM,MAAQN,EAAMM,OAAS,CAAC,EAC9BN,EAAMK,UAAY,aAAeL,EAAMK,WAAa,IACpD,MAAMQ,EAAO,IAAQb,EAAO,QACtBc,EAAUf,EAAMA,EAAIgB,OAASC,IAAIC,WAAWC,MAAM,oCACxD,GAAInB,EAAK,CACP,MAAMQ,EAAQR,EAAIQ,QACdA,IACFP,EAAMM,MAAM,YAAcC,EAC1BP,EAAMK,UAAY,IAAUL,EAAMK,UAAW,UAAW,IAAkBE,KAExEM,IACFb,EAAMmB,MAAQpB,EAAIqB,eAAiB,GACnCpB,EAAMqB,KAAOL,IAAIM,MAAM,MAAO,CAC5BC,KAAMxB,EAAIyB,UAGVzB,EAAI0B,YACNzB,EAAMK,WAAa,mBAEvB,MACEL,EAAMK,WAAa,YAErB,OAAOG,EAAEK,EAAO,IAAO,OAAQb,EAAOQ,EAAE,OAAQ,CAC9CH,UAAW,iBACVN,GAAOA,EAAII,SAAU,OAAQJ,E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sB,EAAUoE,EAAS1F,GAChBW,EAAoBlB,EAAEsF,EAAiBzD,IAAYyD,EAAgBzD,IACrEyD,EAAgBzD,GAAS,KAE1ByD,EAAgBzD,GAAW,CAC5B,EAIGwE,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmB/O,QAAQyO,EAAqBpN,KAAK,KAAM,IAC3D0N,EAAmBjO,KAAO2N,EAAqBpN,KAAK,KAAM0N,EAAmBjO,KAAKO,KAAK0N,G","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Separator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/WelcomeHero')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/tags/./src/forum/components/TagsPage.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionHero')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n if (includes === void 0) {\n includes = [];\n }\n this.loadedIncludes ??= new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Separator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', {\n child: tag.isChild()\n }, this.attrs.className);\n return m(Link, {\n className: className,\n href: this.attrs.route,\n style: tag ? {\n '--color': tag.color()\n } : undefined,\n title: description || undefined\n }, tagIcon(tag, {\n className: 'Button-icon'\n }), m(\"span\", {\n className: \"Button-label\"\n }, tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')));\n }\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const tag = attrs.model;\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagLinkButton', TagLinkButton);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Page');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PageStructure');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/WelcomeHero');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport PageStructure from 'flarum/forum/components/PageStructure';\nimport WelcomeHero from 'flarum/forum/components/WelcomeHero';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\nexport default class TagsPage extends Page {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", void 0);\n _defineProperty(this, \"loading\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.history.push('tags', extractText(app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip')));\n app.current.set('noTagsList', true);\n this.tags = [];\n const preloaded = app.preloadedApiDocument();\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n }\n this.loading = true;\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n this.loading = false;\n m.redraw();\n });\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n app.setTitle(extractText(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text')));\n app.setTitleCount(0);\n }\n view() {\n return m(PageStructure, {\n className: \"TagsPage Page--vertical\",\n hero: this.hero.bind(this),\n sidebar: this.sidebar.bind(this)\n }, this.contentItems().toArray());\n }\n contentItems() {\n const items = new ItemList();\n if (this.loading) {\n items.add('loading', m(LoadingIndicator, null));\n } else {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n return items;\n }\n hero() {\n return m(WelcomeHero, null);\n }\n sidebar() {\n return m(IndexSidebar, null);\n }\n tagTileListView(pinned) {\n return m(\"ul\", {\n className: \"TagTiles\"\n }, pinned.map(this.tagTileView.bind(this)));\n }\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n return m(\"li\", {\n className: classList('TagTile', {\n colored: tag.color()\n }, textContrastClass(tag.color())),\n style: {\n '--tag-bg': tag.color()\n }\n }, m(Link, {\n className: \"TagTile-info\",\n href: app.route.tag(tag)\n }, m(\"div\", {\n className: \"TagTile-heading\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), m(\"h3\", {\n className: \"TagTile-name\"\n }, tag.name())), m(\"p\", {\n className: \"TagTile-description\"\n }, tag.description()), !!children && m(\"div\", {\n className: \"TagTile-children\"\n }, children.map(child => [m(Link, {\n href: app.route.tag(child)\n }, child.name()), ' ']))), lastPostedDiscussion ? m(Link, {\n className: \"TagTile-lastPostedDiscussion\",\n href: app.route.discussion(lastPostedDiscussion, lastPostedDiscussion.lastPostNumber())\n }, m(\"span\", {\n className: \"TagTile-lastPostedDiscussion-title\"\n }, lastPostedDiscussion.title()), humanTime(lastPostedDiscussion.lastPostedAt())) : m(\"span\", {\n className: \"TagTile-lastPostedDiscussion\"\n }));\n }\n cloudView(cloud) {\n return m(\"div\", {\n className: \"TagCloud\"\n }, cloud.map(tag => [tagLabel(tag, {\n link: true\n }), ' ']));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagsPage', TagsPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n return m(\"header\", {\n className: classList('Hero', 'TagHero', {\n 'TagHero--colored': color,\n [textContrastClass(color)]: color\n }),\n style: color ? {\n '--hero-bg': color\n } : undefined\n }, m(\"div\", {\n className: \"container\"\n }, m(\"div\", {\n className: \"containerNarrow\"\n }, m(\"h1\", {\n className: \"Hero-title\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), \" \", tag.name()), m(\"div\", {\n className: \"Hero-subtitle\"\n }, tag.description()))));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagHero', TagHero);","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport TagHero from './components/TagHero';\nconst findTag = slug => app.store.all('tags').find(tag => tag.slug().localeCompare(slug, undefined, {\n sensitivity: 'base'\n}) === 0);\nexport default function addTagFilter() {\n app.currentTag = function (reload) {\n if (this.currentActiveTag && !reload) {\n return this.currentActiveTag;\n }\n const slug = this.search.state.params().tags;\n let tag = null;\n if (slug) {\n tag = findTag(slug);\n }\n if (slug && !tag || tag && !tag.isChild() && !tag.children()) {\n if (this.currentTagLoading) {\n return;\n }\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n this.store.find('tags', slug, {\n include: 'children,children.parent,parent'\n }).then(() => {\n this.currentActiveTag = findTag(slug);\n m.redraw();\n }).finally(() => {\n this.currentTagLoading = false;\n });\n }\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n this.currentActiveTag = undefined;\n return;\n };\n extend(IndexPage.prototype, 'view', function (vdom) {\n app.currentTag(true);\n });\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = app.currentTag();\n if (tag) return m(TagHero, {\n model: tag\n });\n return original();\n });\n extend(IndexPage.prototype, 'view', function (vdom) {\n const tag = app.currentTag();\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = app.currentTag();\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexSidebar.prototype, 'items', function (items) {\n const tag = app.currentTag();\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion');\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = {\n '--color': color\n };\n }\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button');\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n params.include?.push('tags', 'tags.parent');\n }\n if (this.params.tags) {\n params.filter ||= {};\n params.filter.tag = this.params.tags;\n }\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionHero');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\nexport default function addTagControl() {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add('tags', m(Button, {\n icon: \"fas fa-tag\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n discussion\n })\n }, app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button')));\n }\n });\n}flarum.reg.addChunkModule('371', '440', 'flarum-tags', 'forum/components/TagDiscussionModal');\nflarum.reg.addChunkModule('371', '440', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('371', '440', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n function diffTags(tags1, tags2) {\n return tags1.filter(tag => tags2.indexOf(tag) === -1).map(id => app.store.getById('tags', id));\n }\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n icon() {\n return 'fas fa-tag';\n }\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n descriptionData() {\n const data = {};\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, {\n link: true\n }),\n count: this.attrs.tagsAdded.length\n });\n }\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, {\n link: true\n }),\n count: this.attrs.tagsRemoved.length\n });\n }\n return data;\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/DiscussionTaggedPost', DiscussionTaggedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return `${negate ? '-' : ''}${this.key()}:${this.filterValueToGambitValue(value)}`;\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('tags', '/tags', TagsPage) //\n.add('tag', '/t/:tags', IndexPage) //\n.helper('tag', tag => app.route('tag', {\n tags: tag.slug()\n})), new Extend.PostTypes() //\n.add('discussionTagged', DiscussionTaggedPost), new Extend.Model(Discussion) //\n.hasMany('tags') //\n.attribute('canTag')];","import app from 'flarum/forum/app';\nimport TagListState from '../common/states/TagListState';\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', () => {\n app.tagList = new TagListState();\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagList() {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n items.add('tags', m(LinkButton, {\n icon: \"fas fa-th-large\",\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.tags_link')), -10);\n if (app.current.get('noTagsList')) return;\n items.add('separator', m(Separator, null), -12);\n const params = app.search.state.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = app.currentTag();\n const addTag = tag => {\n let active = currentTag === tag;\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add('tag' + tag.id(), m(TagLinkButton, {\n model: tag,\n params: params,\n active: active\n }, tag?.name()), -14);\n };\n sortTags(tags).filter(tag => tag.position() !== null && (!tag.isChild() || currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))).forEach(addTag);\n const more = tags.filter(tag => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n more.splice(0, 3).forEach(addTag);\n if (more.length) {\n items.add('moreTags', m(LinkButton, {\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.more_link')), -16);\n }\n });\n}","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagLabels() {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {\n '--hero-bg': color\n };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {\n link: true\n }), 5);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport classList from 'flarum/common/utils/classList';\nimport Button from 'flarum/common/components/Button';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\nexport default function addTagComposer() {\n extend(IndexSidebar.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = app.currentTag();\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then(composer => composer.fields.tags = tags);\n } else {\n app.composer.fields.tags = [];\n }\n });\n extend('flarum/forum/components/DiscussionComposer', 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n\n // Add tag-selection abilities to the discussion composer.\n this.constructor.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n if (!selectableTags.length) return;\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n }\n });\n };\n });\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend('flarum/forum/components/DiscussionComposer', 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n items.add('tags', m(Button, {\n className: classList(['DiscussionComposer-changeTags', 'Button Button--ua-reset', !selectableTags.length && 'disabled']),\n onclick: this.chooseTags.bind(this)\n }, tags.length ? tagsLabel(tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link'))), 10);\n });\n override('flarum/forum/components/DiscussionComposer', 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter(tag => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter(tag => tag.position() === null);\n const selectableTags = getSelectableTags();\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n if ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0 || chosenPrimaryTags.length < minPrimaryTags || chosenSecondaryTags.length < minSecondaryTags) && selectableTags.length) {\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: chosenTags,\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n original();\n }\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend('flarum/forum/components/DiscussionComposer', 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n if (discussion) {\n const discussionTags = discussion.tags() || [];\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussionTags.includes(tag));\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n return tags;\n}\nflarum.reg.add('flarum-tags', 'forum/utils/getSelectableTags', getSelectableTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/DiscussionPage');","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\tflarum.reg._webpack_runtimes[\"flarum-tags\"] ||= __webpack_require__;// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/components/TagDiscussionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t170: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","style","color","m","flarum","reg","add","tagLabel","link","tagText","name","app","translator","trans","title","description","href","route","tags","slug","isChild","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagListState","constructor","this","load","includes","loadedIncludes","query","unloadedIncludes","filter","include","has","length","Promise","resolve","all","Set","find","join","then","val","Array","isArray","forEach","get","TagLinkButton","view","vnode","model","child","undefined","initAttrs","super","params","TagsPage","arguments","oninit","push","set","preloaded","loading","redraw","oncreate","hero","bind","sidebar","contentItems","toArray","items","pinned","cloud","tagTileListView","cloudView","map","tagTileView","lastPostedDiscussion","children","colored","discussion","lastPostNumber","lastPostedAt","TagHero","findTag","localeCompare","sensitivity","tagsLabel","otherAttrs","addChunkModule","DiscussionTaggedPost","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","store","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","data","count","Tag","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isPrimary","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","value","fromFilter","negate","gambits","toString","filterValueToGambitValue","gambit","helper","hasMany","attribute","extend","state","stickyParams","currentTag","addTag","active","more","splice","reload","currentActiveTag","search","currentTagLoading","finally","vdom","override","original","user","newDiscussion","disabled","param","canTag","onclick","modal","show","promise","composer","fields","prototype","chooseTags","getSelectableTags","selectedTags","onsubmit","$","focus","selectableTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","parseInt","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","relationships","discussionTags","module","exports","_typeof","o","Symbol","iterator","_defineProperty","e","r","t","i","toPrimitive","TypeError","String","toPropertyKey","Object","defineProperty","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","_webpack_runtimes","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","f","chunkId","keys","reduce","promises","u","g","globalThis","Function","window","obj","prop","hasOwnProperty","l","url","done","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","fn","setTimeout","type","target","head","appendChild","toStringTag","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file diff --git a/framework/core/js/dist-typings/common/ExportRegistry.d.ts b/framework/core/js/dist-typings/common/ExportRegistry.d.ts index 3e3415eec7..4d6ea4716b 100644 --- a/framework/core/js/dist-typings/common/ExportRegistry.d.ts +++ b/framework/core/js/dist-typings/common/ExportRegistry.d.ts @@ -79,6 +79,7 @@ export default class ExportRegistry implements IExportRegistry, IChunkRegistry { chunks: Map; chunkModules: Map; private _revisions; + private _webpack_runtimes; add(namespace: string, id: string, object: any): void; onLoad(namespace: string, id: string, handler: (module: any) => void): void; get(namespace: string, id: string): any; diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index 144f8a28f5..9f469589a5 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={5710:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(){(0,r.A)(this,"element",void 0),(0,r.A)(this,"attrs",void 0),(0,r.A)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error(`[${this.constructor.name}] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute`);if("tag"in t)throw new Error(`[${this.constructor.name}] You cannot use the "tag" attribute name with Mithril 2.`)}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",s)},5420:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=n(5114);class a{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.A.store),(0,r.A)(this,"data",{}),(0,r.A)(this,"freshness",new Date),(0,r.A)(this,"exists",!1),(0,r.A)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){return this.data?.attributes?.[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){this.data.attributes||={};for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof a&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){const e=this.data.relationships??{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let s;s=r instanceof a?{data:a.getIdentifier(r)}:r instanceof Array?{data:r.map(a.getIdentifier)}:r,t.relationships[n]=s,e[n]=s}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships&&!("relationships"in this)){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(a.getIdentifier):a.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const i={data:n,meta:e.meta||void 0};return s.A.request({method:this.exists?"PATCH":"POST",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:i,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.A.request({method:"DELETE",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){return this.data.relationships?.[t]?.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&e instanceof Array)throw new Error(`Relationship ${t} on model ${this.data.type} is plural, so the hasOne method cannot be used to access it.`);return!!e&&this.store.getById(e.type,e.id)}}static hasMany(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&!(e instanceof Array))throw new Error(`Relationship ${t} on model ${this.data.type} is singular, so the hasMany method cannot be used to access it.`);return!!e&&e.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&t.data&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",a)},3920:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(8805),s=n(5114),a=n(8631);class i extends a.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",i);class o extends a.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",o);class l extends a.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends a.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends a.px{key(){return s.A.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.A.session.user||!s.A.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends a.px{key(){return s.A.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class m extends a.px{key(){return s.A.translator.trans("core.lib.gambits.posts.discussion.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.posts.discussion.hint",{},!0)}filterKey(){return"discussion"}}flarum.reg.add("core","common/query/discussions/DiscussionGambit",m);class h{constructor(){(0,r.A)(this,"gambits",{discussions:[i,o,l,c],posts:[i,m],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,r)=>{const s=t.toFilter(n,r);Object.keys(s).forEach((n=>{n in e&&t.predicates&&Array.isArray(s[n])?e[n]=e[n].concat(s[n]):e[n]=s[n]}))})),e}match(t,e,n){const r=this.for(t).filter((t=>t.enabled()));if(0===r.length)return e;const s=e.split(" ");for(const t of r)for(const r of s){const s=new RegExp(`^(-?)${t.pattern()}$`,"i");let a=r.match(s);if(a){const s="-"===a[1];a.splice(1,1),n(t,a,s,r),e=e.replace(r,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const r=this.for(t);return 0===r.length||Object.keys(n).forEach((t=>{for(const s of r){const r="-"===t[0];r&&(t=t.substring(1)),s.filterKey()===t&&(e+=` ${s.fromFilter(n[t],r)}`)}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",h);class p{constructor(t){(0,r.A)(this,"state",void 0),(0,r.A)(this,"gambits",new h),this.state=t}}(0,r.A)(p,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",p)},5114:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});const r=window,s=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),a=s;flarum.reg.add("core","common/app",s)},9924:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(3092),a=n(5673),i=n(4586),o=n(4268),l=n(5114),c=n(7479);class u extends r.A{view(t){const e=Object.assign({},this.attrs),n=(0,i.A)(e,"type");e.className=(0,o.A)("Alert",`Alert--${n}`,e.className);const r=(0,i.A)(e,"title"),u=(0,i.A)(e,"icon"),d=(0,i.A)(e,"content")||t.children,h=(0,i.A)(e,"controls")||[],p=(0,i.A)(e,"dismissible"),f=(0,i.A)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.A,{"aria-label":l.A.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,o.A)("Alert-container",e.containerClassName)},m("div",{className:"Alert-content"},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.A,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d)),m("ul",{className:"Alert-controls"},(0,a.A)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},367:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(4391),s=n(5710),a=n(4268),i=n(3288),o=n(7479);class l extends s.A{view(){const{type:t,icon:e,label:n,color:s,style:l={},...c}=this.attrs,u=(0,a.A)("Badge",[t&&`Badge--${t}`],c.className,(0,i.A)(s)),d=e?m(o.A,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l};window.testing||(h["--badge-bg"]=s);const p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.A,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},3092:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5710),s=n(4434),a=n(4268),i=n(117),o=n(43),l=n(7479);class c extends r.A{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:o,className:l,class:c,...u}=this.attrs;e||="button","object"==typeof n&&(n=(0,i.A)(n)),(s||o)&&delete u.onclick,l=(0,a.A)(c,l,{hasIcon:r,disabled:s||o,loading:o});const d={disabled:s,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){super.oncreate(t);const{"aria-label":e}=this.attrs;this.view!==c.prototype.view||e||(0,i.A)(t.children)||this.element?.getAttribute?.("aria-label")||(0,s.A)('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(l.A,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(o.A,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",c)},374:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5710),s=n(4268);class a extends r.A{view(t){const{label:e,description:n,className:r,...a}=t.attrs;return m("div",Object.assign({className:(0,s.A)("Form",r)},a),(e||n)&&m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",a)},2855:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2849);class s extends r.A{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){this.alertAttrs=t.alert,m.redraw(),422===t.status&&t.response?.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",s)},3550:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(367);class s extends r.A{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",s)},7479:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(4268),s=n(5710);class a extends s.A{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.A)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",a)},4164:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5710),s=n(7479),a=n(4268);class i extends r.A{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,a.A)("InfoTile",n)},r),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.A,{name:(0,a.A)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",i)},7882:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5114),s=n(5710),a=n(7479),i=n(43),o=n(4268),l=n(3092);class c extends s.A{oninit(t){super.oninit(t)}view(t){const{className:e,...n}=this.attrs.inputAttrs||{},s=this.attrs.value||this.attrs.stream?.()||"";return m("div",{className:(0,o.A)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(a.A,{name:(0,o.A)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:e,value:s,inputAttrs:n}),this.attrs.loading&&m(i.A,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&s&&!this.attrs.loading&&m(l.A,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||r.A.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:r}=t;const s={className:(0,o.A)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>this.onchange?.(t.target.value),"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...r};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){this.attrs.stream?this.attrs.stream(t):this.attrs.onchange?.(t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},43:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5114),s=n(5710),a=n(4268);class i extends s.A{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...i}=this.attrs,o=(0,a.A)("LoadingIndicator",s),l=(0,a.A)("LoadingIndicator-container","unset"!==t&&`LoadingIndicator-container--${t}`,e&&`LoadingIndicator-container--${e}`,n);return m("div",Object.assign({"aria-label":r.A.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},i.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:o},i)))}}flarum.reg.add("core","common/components/LoadingIndicator",i)},2849:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(8805),s=n(5114),a=n(5710),i=n(9924),o=n(3092),l=n(4268);class c extends a.A{constructor(){super(...arguments),(0,r.A)(this,"loading",!1),(0,r.A)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.A)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(o.A,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.A.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(i.A,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.A)(c,"isDismissibleViaCloseButton",!0),(0,r.A)(c,"isDismissibleViaEscKey",!0),(0,r.A)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},4391:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(8805),s=n(5710),a=n(4268),i=n(117);class o extends s.A{constructor(){super(...arguments),(0,r.A)(this,"firstChild",null),(0,r.A)(this,"childDomNode",null),(0,r.A)(this,"oldText",""),(0,r.A)(this,"oldVisibility",void 0),(0,r.A)(this,"shouldRecreateTooltip",!1),(0,r.A)(this,"shouldChangeTooltipVisibility",!1)}view(t){const e=t.children,{text:n,tooltipVisible:r,showOnFocus:s=!0,position:a="top",ignoreTitleWarning:i=!1,html:o=!1,delay:l=0,...c}=this.attrs;this.attrs.title&&!i&&console.warn("`title` attribute was passed to Tooltip component. Was this intentional? Tooltip content should be passed to the `text` attr instead.");const u=this.getRealText();if(u!==this.oldText&&(this.oldText=u,this.shouldRecreateTooltip=!0),r!==this.oldVisibility&&(this.oldVisibility=this.attrs.tooltipVisible,this.shouldChangeTooltipVisibility=!0),void 0===e)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if(1!==e.length)throw new Error("Tooltip component was either passed more than one or no child node.\n\nPlease wrap multiple children in another element, such as a
          or .");const d=e[0];if("object"!=typeof d||Array.isArray(d)||null===d)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof d.tag&&["#","[","<"].includes(d.tag))throw new Error(`Tooltip component with provided with a vnode with tag "${d.tag}". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
          or .`);return this.firstChild=d,e}oncreate(t){super.oncreate(t),this.checkDomNodeChanged(),this.recreateTooltip()}onupdate(t){super.onupdate(t),this.checkDomNodeChanged(),this.recreateTooltip()}recreateTooltip(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())}updateVisibility(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))}createTooltip(){if(null===this.childDomNode)return;const{showOnFocus:t=!0,position:e="top",delay:n,html:r=!1,tooltipVisible:s,text:i}=this.attrs,o="boolean"==typeof s?"manual":(0,a.A)("hover",[t&&"focus"]),l=this.getRealText();this.childDomNode.setAttribute("title",l),this.childDomNode.setAttribute("aria-label",l),$(this.childDomNode).tooltip({html:r,delay:n,placement:e,trigger:o},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}getRealText(){const{text:t}=this.attrs;return Array.isArray(t)?(0,i.A)(t):t}checkDomNodeChanged(){const t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)}}flarum.reg.add("core","common/components/Tooltip",o)},4434:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(5114);function s(){r.A.data.resources.find((t=>"forums"===t.type))?.attributes?.debug&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",s)},5673:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(646),s=n(4268);function a(t){return"object"==typeof t&&null!==t&&"tag"in t}function i(t){return a(t)&&t.tag===r.A}function o(t,e,n){void 0===e&&(e="li"),void 0===n&&(n={});const r=e;return function(t){const e=[];let n;return t.filter(Boolean).forEach(((r,s)=>{(!i(r)||n&&!i(n)&&s!==t.length-1)&&(n=r,e.push(r))})),e}(t instanceof Array?t:[t]).map((t=>{const e=[t.itemName&&`item-${t.itemName}`];if(a(t)&&t.tag.isListItem)return t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key,t;a(t)&&(e.push(t.attrs?.itemClassName||t.itemClassName),t.tag.isActive?.(t.attrs)&&e.push("active"));const i=a(t)&&t?.attrs?.key||t.itemName;return m(r,Object.assign({className:(0,s.A)(e),key:i},n),t)}))}flarum.reg.add("core","common/helpers/listItems",o)},3288:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2967);function s(t){return t?(0,r.A)(t)?"text-contrast--light":"text-contrast--dark":"text-contrast--unchanged"}flarum.reg.add("core","common/helpers/textContrastClass",s)},4583:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=n(5420);class a extends s.A{nameSingular(){return s.A.attribute("nameSingular").call(this)}namePlural(){return s.A.attribute("namePlural").call(this)}color(){return s.A.attribute("color").call(this)}icon(){return s.A.attribute("icon").call(this)}isHidden(){return s.A.attribute("isHidden").call(this)}}(0,r.A)(a,"ADMINISTRATOR_ID","1"),(0,r.A)(a,"GUEST_ID","2"),(0,r.A)(a,"MEMBER_ID","3"),flarum.reg.add("core","common/models/Group",a)},8631:(t,e,n)=>{"use strict";n.d(e,{$Q:()=>a,pm:()=>i,px:()=>o});var r=n(8805),s=n(5114);let a=function(t){return t.KeyValue="key:value",t.Grouped="grouped",t}({});class i{constructor(){(0,r.A)(this,"type",a.Grouped),(0,r.A)(this,"predicates",!1)}booleanKey(){return"is"}groupKey(){return s.A.translator.trans("core.lib.gambits.group_keys."+this.booleanKey(),{},!0)}pattern(){const t=this.groupKey();let e=this.key();return Array.isArray(e)&&(e=e.join("|")),`${t}:(${e})`}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:!0}}fromFilter(t,e){return`${e?"-":""}${this.groupKey()}:${this.key()}`}suggestion(){return{group:this.groupKey(),key:this.key()}}enabled(){return!0}}class o{constructor(){(0,r.A)(this,"type",a.KeyValue),(0,r.A)(this,"predicates",!1)}valuePattern(){return"(.+)"}gambitValueToFilterValue(t){return t}filterValueToGambitValue(t){return Array.isArray(t)?t.join(","):t.toString()}pattern(){return`${this.key()}:`+this.valuePattern()}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:this.gambitValueToFilterValue(t[1])}}fromFilter(t,e){return`${e?"-":""}${this.key()}:${this.filterValueToGambitValue(t)}`}suggestion(){return{key:this.key(),hint:this.hint()}}enabled(){return!0}}flarum.reg.add("core","common/query/IGambit",{GambitType:a,BooleanGambit:i,KeyValueGambit:o})},5992:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(t){(0,r.A)(this,"symbol",void 0),(0,r.A)(this,"relativeStart",0),(0,r.A)(this,"absoluteStart",0),this.symbol=t}check(t,e,n){void 0===n&&(n=null),this.absoluteStart=0;for(let r=t.length-1;r>=0;r--){const s=t.substr(r,1);if(n&&!n?.test(s))return null;if(this.symbol){const t="string"==typeof this.symbol?t=>t===this.symbol:this.symbol;if(!t(s))continue}if(0===r||/\s/.test(t.substr(r-1,1)))return this.relativeStart=r+(this.symbol?1:0),this.absoluteStart=e-t.length+r+(this.symbol?1:0),{symbol:this.symbol&&s,relativeStart:this.relativeStart,absoluteStart:this.absoluteStart,typed:t.substring(this.relativeStart).toLowerCase()}}return null}}flarum.reg.add("core","common/utils/AutocompleteReader",s)},6500:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(8805),s=n(5114),a=n(8631),i=n(5992),o=n(3092);class l{constructor(t,e,n,s){this.resource=t,this.jqueryInput=e,this.onchange=n,this.afterSuggest=s,(0,r.A)(this,"query","")}suggestions(t){const e=s.A.search.gambits.for(this.resource).filter((t=>t.enabled()));this.query=t;const n=e.filter((t=>t.type===a.$Q.Grouped)),r=e.filter((t=>t.type!==a.$Q.Grouped)),o=[];for(const t of n)o.includes(t.suggestion().group)||o.push(t.suggestion().group);const l=[];for(const t of o)l.push({type:a.$Q.Grouped,suggestion:()=>({group:t,key:n.filter((e=>e.suggestion().group===t)).map((t=>{const e=t.suggestion().key;return e instanceof Array?e.join(", "):e})).join(", ")}),pattern:()=>"",filterKey:()=>"",toFilter:()=>[],fromFilter:()=>"",predicates:!1,enabled:()=>!0});const c=new i.A(null),u=this.jqueryInput().prop("selectionStart")||t.length,d=t.slice(0,u),m=c.check(d,u,/\S+$/);let h=m?.typed||"";const p=h.startsWith("-");if(p&&(h=h.slice(1)),h.endsWith(":")){const t=h.replace(/:$/,"")||null,e=h.split(":").pop()||"";if(t){const r=this.specificGambitSuggestions(t,e,o,n,m);if(r)return r}}return[...l,...r].filter((t=>!m||new RegExp(h).test(t.type===a.$Q.Grouped?t.suggestion().group:t.suggestion().key))).map((t=>{const e=t.suggestion(),n=t.type===a.$Q.Grouped?e.group:e.key,r=t.type===a.$Q.Grouped?e.key:e.hint;return this.gambitSuggestion(n,r,(t=>this.suggest((t?"-":"")+n+":",h||"",(m?.relativeStart??u)+Number(p))))}))}specificGambitSuggestions(t,e,n,r,s){return n.includes(t)?r.filter((e=>e.suggestion().group===t)).flatMap((t=>t.suggestion().key instanceof Array?t.suggestion().key:[t.suggestion().key])).filter((t=>!e||t.toLowerCase().startsWith(e))).map((t=>this.gambitSuggestion(t,null,(()=>this.suggest(t,e,s.relativeStart+s.typed.length))))):null}gambitSuggestion(t,e,n){return m("li",null,m("span",{className:"Dropdown-item GambitsAutocomplete-gambit"},m("button",{type:"button",className:"Button--ua-reset",onclick:()=>n()},m("span",{className:"GambitsAutocomplete-gambit-key"},t,!!e&&":"),!!e&&m("span",{className:"GambitsAutocomplete-gambit-value"},e)),!!e&&m("span",{className:"GambitsAutocomplete-gambit-actions"},m(o.A,{class:"Button Button--icon",onclick:()=>n(),icon:"fas fa-plus","aria-label":s.A.translator.trans("core.lib.search.gambit_plus_button_a11y_label")}),m(o.A,{class:"Button Button--icon",onclick:()=>n(!0),icon:"fas fa-minus","aria-label":s.A.translator.trans("core.lib.search.gambit_minus_button_a11y_label")}))))}suggest(t,e,n){const r=this.jqueryInput(),s=this.query,a=s.slice(0,n)+t+s.slice(n+e.length);this.onchange(a),r[0].focus(),setTimeout((()=>{r[0].setSelectionRange(n+t.length,n+t.length),m.redraw()}),50),this.afterSuggest(a)}}flarum.reg.add("core","common/utils/GambitsAutocomplete",l)},6064:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=n(9648);class a{constructor(t,e){(0,r.A)(this,"content",void 0),(0,r.A)(this,"priority",void 0),this.content=t,this.priority=e}}class i{constructor(){(0,r.A)(this,"_items",{})}isEmpty(){return 0===Object.keys(this._items).length}has(t){return Object.keys(this._items).includes(t)}get(t){return this._items[t].content}getPriority(t){return this._items[t].priority}add(t,e,n){return void 0===n&&(n=0),this._items[t]=new a(e,n),this}setContent(t,e){if(!this.has(t))throw new Error(`[ItemList] Cannot set content of Item. Key \`${t}\` is not present.`);return null!==e&&(this._items[t].content=e),this}setPriority(t,e){if(!this.has(t))throw new Error(`[ItemList] Cannot set priority of Item. Key \`${t}\` is not present.`);return this._items[t].priority=e,this}remove(t){return delete this._items[t],this}merge(t){return Object.keys(t._items).forEach((e=>{const n=t._items[e];n instanceof a&&(this._items[e]=n)})),this}toArray(t){return void 0===t&&(t=!1),Object.keys(this._items).map(((e,n)=>{const r=this._items[e];return!t||(0,s.A)(r.content)?{...r,content:this.createItemContentProxy((0,s.A)(r.content)?r.content:Object(r.content),e)}:{...r}})).sort(((t,e)=>e.priority-t.priority)).map((t=>t.content))}toObject(){return Object.keys(this._items).reduce(((t,e)=>{const n={content:this.get(e),itemName:e,priority:this.getPriority(e)};return t[e]=n,t}),{})}createItemContentProxy(t,e){return new Proxy(t,{get:(t,n,r)=>"itemName"===n?e:Reflect.get(t,n,r),set(t,n,r,s){if(null!==e&&"itemName"===n)throw new Error("`itemName` property is read-only");return Reflect.set(t,n,r,s)}})}}flarum.reg.add("core","common/utils/ItemList",i)},6732:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=function(t){return t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowDown=40]="ArrowDown",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowRight=39]="ArrowRight",t[t.Tab=9]="Tab",t[t.Backspace=8]="Backspace",t}(s||{});class a{constructor(){(0,r.A)(this,"callbacks",new Map),(0,r.A)(this,"whenCallback",(t=>!0))}onUp(t){return this.onDirection(t,s.ArrowUp)}onDown(t){return this.onDirection(t,s.ArrowDown)}onLeft(t){return this.onDirection(t,s.ArrowLeft)}onRight(t){return this.onDirection(t,s.ArrowRight)}onDirection(t,e){return this.callbacks.set(e,(e=>{e.preventDefault(),t(e)})),this}onSelect(t,e){void 0===e&&(e=!1);const n=e=>{e.preventDefault(),t(e)};return e||this.callbacks.set(s.Tab,n),this.callbacks.set(s.Enter,n),this}onTab(t){return this.callbacks.set(9,(e=>{e.preventDefault(),t(e)})),this}onCancel(t){return this.callbacks.set(s.Escape,(e=>{e.stopPropagation(),e.preventDefault(),t(e)})),this}onRemove(t){return this.callbacks.set(s.Backspace,(e=>{e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&0===e.target.selectionStart&&0===e.target.selectionEnd&&(t(e),e.preventDefault())})),this}when(t){return this.whenCallback=t,this}bindTo(t){t[0].addEventListener("keydown",this.navigate.bind(this))}navigate(t){if(!this.whenCallback(t))return;const e=this.callbacks.get(t.which);e&&e(t)}}flarum.reg.add("core","common/utils/KeyboardNavigatable",a)},4311:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5263),s=n.n(r);const a=s();flarum.reg.add("core","common/utils/Stream",s())},2202:()=>{Array.prototype.flat||(Array.prototype.flat=function t(e){return(e??1)>0?Array.prototype.reduce.call(this,((n,r)=>n.concat(Array.isArray(r)?t.call(r,e-1):r)),[]):[...this]})},4268:(t,e,n)=>{"use strict";function r(t){var e,n,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;ea});const s=function(){for(var t,e,n=0,s="";n{"use strict";function r(t,e){const n=t[e];return delete t[e],n}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extract",r)},117:(t,e,n)=>{"use strict";function r(t){return t instanceof Array?t.map((t=>r(t))).join(""):"object"==typeof t&&null!==t?r(t.children):String(t)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extractText",r)},2967:(t,e,n)=>{"use strict";function r(t){if(!t||t.length<4)return!1;let e=t.replace("#","");return 3===e.length&&(e=e.split("").map((t=>t.repeat(2))).join("")),(299*parseInt(e.slice(0,2),16)+587*parseInt(e.slice(2,4),16)+114*parseInt(e.slice(4,6),16))/1e3<(parseInt(getComputedStyle(document.body).getPropertyValue("--yiq-threshold").trim())||128)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isDark",r)},9648:(t,e,n)=>{"use strict";function r(t){const e=typeof t;return"function"===e||"object"===e&&!!t}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isObject",r)},1592:()=>{!function(t){"use strict";var e=function(n,r){this.options=t.extend({},e.DEFAULTS,r);var s=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=s.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var r=t(this),s=r.data("bs.affix"),a="object"==typeof n&&n;s||r.data("bs.affix",s=new e(this,a)),"string"==typeof n&&s[n]()}))}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,n,r){var s=this.$target.scrollTop(),a=this.$element.offset(),i=this.$target.height();if(null!=n&&"top"==this.affixed)return s=t-r&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),r=this.options.offset,s=r.top,a=r.bottom,i=Math.max(t(document).height(),t(document.body).height());"object"!=typeof r&&(a=s=r),"function"==typeof s&&(s=r.top(this.$element)),"function"==typeof a&&(a=r.bottom(this.$element));var o=this.getState(i,n,s,a);if(this.affixed!=o){null!=this.unpin&&this.$element.css("top","");var l="affix"+(o?"-"+o:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=o,this.unpin="bottom"==o?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==o&&this.$element.offset({top:i-n-a})}};var r=t.fn.affix;t.fn.affix=n,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=r,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),r=e.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(e,r)}))}))}(jQuery)},5941:()=>{!function(t){"use strict";var e='[data-toggle="dropdown"]',n=function(e){t(e).on("click.bs.dropdown",this.toggle)};function r(e){var n=e.attr("data-target");n||(n=(n=e.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?t(document).find(n):null;return r&&r.length?r:e.parent()}function s(n){n&&3===n.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=t(this),s=r(e),a={relatedTarget:this};s.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&t.contains(s[0],n.target)||(s.trigger(n=t.Event("hide.bs.dropdown",a)),n.isDefaultPrevented()||(e.attr("aria-expanded","false"),s.removeClass("open").trigger(t.Event("hidden.bs.dropdown",a)))))})))}n.VERSION="3.4.1",n.prototype.toggle=function(e){var n=t(this);if(!n.is(".disabled, :disabled")){var a=r(n),i=a.hasClass("open");if(s(),!i){"ontouchstart"in document.documentElement&&!a.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s);var o={relatedTarget:this};if(a.trigger(e=t.Event("show.bs.dropdown",o)),e.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),a.toggleClass("open").trigger(t.Event("shown.bs.dropdown",o))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var s=t(this);if(n.preventDefault(),n.stopPropagation(),!s.is(".disabled, :disabled")){var a=r(s),i=a.hasClass("open");if(!i&&27!=n.which||i&&27==n.which)return 27==n.which&&a.find(e).trigger("focus"),s.trigger("click");var o=a.find(".dropdown-menu li:not(.disabled):visible a");if(o.length){var l=o.index(n.target);38==n.which&&l>0&&l--,40==n.which&&l{!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,s=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function a(e,a){var i=e.nodeName.toLowerCase();if(-1!==t.inArray(i,a))return-1===t.inArray(i,n)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(s));for(var o=t(a).filter((function(t,e){return e instanceof RegExp})),l=0,c=o.length;l
          ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},o.prototype.init=function(e,n,r){if(this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var s=this.options.trigger.split(" "),a=s.length;a--;){var i=s[a];if("click"==i)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=i){var o="hover"==i?"mouseenter":"focusin",l="hover"==i?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},o.prototype.getDefaults=function(){return o.DEFAULTS},o.prototype.getOptions=function(n){var r=this.$element.data();for(var s in r)r.hasOwnProperty(s)&&-1!==t.inArray(s,e)&&delete r[s];return(n=t.extend({},this.getDefaults(),r,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=i(n.template,n.whiteList,n.sanitizeFn)),n},o.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,(function(t,r){n[t]!=r&&(e[t]=r)})),e},o.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusin"==e.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},o.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},o.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusout"==e.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},o.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var r=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(i);c&&(i=i.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this),this.options.container?s.appendTo(t(document).find(this.options.container)):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=s[0].offsetWidth,m=s[0].offsetHeight;if(c){var h=i,p=this.getPosition(this.$viewport);i="bottom"==i&&u.bottom+m>p.bottom?"top":"top"==i&&u.top-mp.width?"left":"left"==i&&u.left-di.top+i.height&&(s.top=i.top+i.height-l)}else{var c=e.left-a,u=e.left+a+n;ci.right&&(s.left=i.left+i.width-u)}return s},o.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},o.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},o.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},o.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},o.prototype.enable=function(){this.enabled=!0},o.prototype.disable=function(){this.enabled=!1},o.prototype.toggleEnabled=function(){this.enabled=!this.enabled},o.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),e?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},o.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},o.prototype.sanitizeHtml=function(t){return i(t,this.options.whiteList,this.options.sanitizeFn)};var l=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var n=t(this),r=n.data("bs.tooltip"),s="object"==typeof e&&e;!r&&/destroy|hide/.test(e)||(r||n.data("bs.tooltip",r=new o(this,s)),"string"==typeof e&&r[e]())}))},t.fn.tooltip.Constructor=o,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=l,this}}(jQuery)},3387:()=>{!function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,r=this;return t(this).one("bsTransitionEnd",(function(){n=!0})),setTimeout((function(){n||t(r).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(jQuery)},7514:t=>{var e=function(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas),this.width=this.canvas.width=t.width,this.height=this.canvas.height=t.height,this.context.drawImage(t,0,0,this.width,this.height)};e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.update=function(t){this.context.putImageData(t,0,0)},e.prototype.getPixelCount=function(){return this.width*this.height},e.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)},e.prototype.removeCanvas=function(){this.canvas.parentNode.removeChild(this.canvas)};var n=function(){};if(n.prototype.getColor=function(t,e){return this.getPalette(t,5,e)[0]},n.prototype.getPalette=function(t,n,r){void 0===n&&(n=10),(void 0===r||1>r)&&(r=10);for(var a,i,o,l,c=new e(t),u=c.getImageData().data,d=c.getPixelCount(),m=[],h=0;d>h;h+=r)i=u[0+(a=4*h)],o=u[a+1],l=u[a+2],u[a+3]>=125&&(i>250&&o>250&&l>250||m.push([i,o,l]));var p=s.quantize(m,n),f=p?p.palette():null;return c.removeCanvas(),f},!r)var r={map:function(t,e){var n={};return e?t.map((function(t,r){return n.index=r,e.call(n,t)})):t.slice()},naturalOrder:function(t,e){return e>t?-1:t>e?1:0},sum:function(t,e){var n={};return t.reduce(e?function(t,r,s){return n.index=s,t+e.call(n,r)}:function(t,e){return t+e},0)},max:function(t,e){return Math.max.apply(null,e?r.map(t,e):t)}};var s=function(){function t(t,e,n){return(t<<2*l)+(e<>c,s=e[1]>>c,a=e[2]>>c,n=t(r,s,a),i[n]=(i[n]||0)+1})),i}function i(t,e){var r,s,a,i=1e6,o=0,l=1e6,u=0,d=1e6,m=0;return t.forEach((function(t){r=t[0]>>c,s=t[1]>>c,a=t[2]>>c,i>r?i=r:r>o&&(o=r),l>s?l=s:s>u&&(u=s),d>a?d=a:a>m&&(m=a)})),new n(i,o,l,u,d,m,e)}function o(e,n){if(n.count()){var s=n.r2-n.r1+1,a=n.g2-n.g1+1,i=n.b2-n.b1+1,o=r.max([s,a,i]);if(1==n.count())return[n.copy()];var l,c,u,d,m=0,h=[],p=[];if(o==s)for(l=n.r1;l<=n.r2;l++){for(d=0,c=n.g1;c<=n.g2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(l,c,u)]||0;m+=d,h[l]=m}else if(o==a)for(l=n.g1;l<=n.g2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(c,l,u)]||0;m+=d,h[l]=m}else for(l=n.b1;l<=n.b2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.g1;u<=n.g2;u++)d+=e[t(c,u,l)]||0;m+=d,h[l]=m}return h.forEach((function(t,e){p[e]=m-t})),function(t){var e,r,s,a,i,o=t+"1",c=t+"2",u=0;for(l=n[o];l<=n[c];l++)if(h[l]>m/2){for(s=n.copy(),a=n.copy(),e=l-n[o],i=(r=n[c]-l)>=e?Math.min(n[c]-1,~~(l+r/2)):Math.max(n[o],~~(l-1-e/2));!h[i];)i++;for(u=p[i];!u&&h[i-1];)u=p[--i];return s[c]=i,a[o]=s[c]+1,[s,a]}}(o==s?"r":o==a?"g":"b")}}var l=5,c=8-l;return n.prototype={volume:function(t){var e=this;return(!e._volume||t)&&(e._volume=(e.r2-e.r1+1)*(e.g2-e.g1+1)*(e.b2-e.b1+1)),e._volume},count:function(e){var n=this,r=n.histo;if(!n._count_set||e){var s,a,i,o=0;for(s=n.r1;s<=n.r2;s++)for(a=n.g1;a<=n.g2;a++)for(i=n.b1;i<=n.b2;i++)index=t(s,a,i),o+=r[index]||0;n._count=o,n._count_set=!0}return n._count},copy:function(){var t=this;return new n(t.r1,t.r2,t.g1,t.g2,t.b1,t.b2,t.histo)},avg:function(e){var n=this,r=n.histo;if(!n._avg||e){var s,a,i,o,c=0,u=1<<8-l,d=0,m=0,h=0;for(a=n.r1;a<=n.r2;a++)for(i=n.g1;i<=n.g2;i++)for(o=n.b1;o<=n.b2;o++)c+=s=r[t(a,i,o)]||0,d+=s*(a+.5)*u,m+=s*(i+.5)*u,h+=s*(o+.5)*u;n._avg=c?[~~(d/c),~~(m/c),~~(h/c)]:[~~(u*(n.r1+n.r2+1)/2),~~(u*(n.g1+n.g2+1)/2),~~(u*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(t){var e=this,n=t[0]>>c;return gval=t[1]>>c,bval=t[2]>>c,n>=e.r1&&n<=e.r2&&gval>=e.g1&&gval<=e.g2&&bval>=e.b1&&bval<=e.b2}},s.prototype={push:function(t){this.vboxes.push({vbox:t,color:t.avg()})},palette:function(){return this.vboxes.map((function(t){return t.color}))},size:function(){return this.vboxes.size()},map:function(t){for(var e=this.vboxes,n=0;n(n=Math.sqrt(Math.pow(t[0]-s.peek(a).color[0],2)+Math.pow(t[1]-s.peek(a).color[1],2)+Math.pow(t[2]-s.peek(a).color[2],2)))||void 0===e)&&(e=n,r=s.peek(a).color);return r},forcebw:function(){var t=this.vboxes;t.sort((function(t,e){return r.naturalOrder(r.sum(t.color),r.sum(e.color))}));var e=t[0].color;e[0]<5&&e[1]<5&&e[2]<5&&(t[0].color=[0,0,0]);var n=t.length-1,s=t[n].color;s[0]>251&&s[1]>251&&s[2]>251&&(t[n].color=[255,255,255])}},{quantize:function(t,n){function l(t,e){for(var n,r=1,s=0;1e3>s;)if((n=t.pop()).count()){var a=o(c,n),i=a[0],l=a[1];if(!i)return;if(t.push(i),l&&(t.push(l),r++),r>=e)return;if(s++>1e3)return}else t.push(n),s++}if(!t.length||2>n||n>256)return!1;var c=a(t);c.forEach((function(){}));var u=i(t,c),d=new e((function(t,e){return r.naturalOrder(t.count(),e.count())}));d.push(u),l(d,.75*n);for(var m=new e((function(t,e){return r.naturalOrder(t.count()*t.volume(),e.count()*e.volume())}));d.size();)m.push(d.pop());l(m,n-m.size());for(var h=new s;m.size();)h.push(m.pop());return h}}}();t.exports=n},1720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",s="minute",a="hour",i="day",o="week",l="month",c="quarter",u="year",d="date",m="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),s=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(s,2,"0")},m:function t(e,n){if(e.date()1)return t(i[0])}else{var o=e.name;y[o]=e,s=o}return!r&&s&&(b=s),s||!r&&b},N=function(t,e){if(A(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},k=v;k.l=x,k.i=A,k.w=function(t,e){return N(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function f(t){this.$L=x(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var g=f.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r){var s=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return k},g.isValid=function(){return!(this.$d.toString()===m)},g.isSame=function(t,e){var n=N(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return N(t)0,g<=f.r||!f.r){g<=1&&p>0&&(f=m[p-1]);var v=d[f.l];o&&(g=o(""+g)),c="string"==typeof v?v.replace("%d",g):v(g,r,f.l,u);break}}if(r)return c;var b=u?d.future:d.past;return"function"==typeof b?b(c):b.replace("%s",c)},r.to=function(t,e){return a(t,e,this,!0)},r.from=function(t,e){return a(t,e,this)};var i=function(t){return t.$u?n.utc():n()};r.toNow=function(t){return this.to(i(this),t)},r.fromNow=function(t){return this.from(i(this),t)}}}()},5187:(t,e,n)=>{"use strict";t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return t}()},3102:t=>{var e="long",n="short",r="narrow",s="numeric",a="2-digit";t.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:s,day:s,year:a},medium:{month:n,day:s,year:s},long:{month:e,day:s,year:s},full:{month:e,day:s,year:s,weekday:e},default:{month:n,day:s,year:s}},time:{short:{hour:s,minute:s},medium:{hour:s,minute:s,second:s},long:{hour:s,minute:s,second:s,timeZoneName:n},full:{hour:s,minute:s,second:s,timeZoneName:n},default:{hour:s,minute:s,second:s}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(t){if(t){var e={},n=t.match(/\b[A-Z]{3}\b/i),r=t.replace(/[^¤]/g,"").length;if(!r&&n&&(r=1),r?(e.style="currency",e.currencyDisplay=1===r?"symbol":2===r?"code":"name",e.currency=n?n[0].toUpperCase():"USD"):t.indexOf("%")>=0&&(e.style="percent"),!/[@#0]/.test(t))return e.style?e:void 0;if(e.useGrouping=t.indexOf(",")>=0,/E\+?[@#0]+/i.test(t)||t.indexOf("@")>=0){var s=t.replace(/E\+?[@#0]+|[^@#0]/gi,"");e.minimumSignificantDigits=Math.min(Math.max(s.replace(/[^@0]/g,"").length,1),21),e.maximumSignificantDigits=Math.min(Math.max(s.length,1),21)}else{for(var a=t.replace(/[^#0.]/g,"").split("."),i=a[0],o=i.length-1;"0"===i[o];)--o;e.minimumIntegerDigits=Math.min(Math.max(i.length-1-o,1),21);var l=a[1]||"";for(o=0;"0"===l[o];)++o;for(e.minimumFractionDigits=Math.min(Math.max(o,0),20);"#"===l[o];)++o;e.maximumFractionDigits=Math.min(Math.max(o,0),20)}return e}},parseDatePattern:function(t){if(t){for(var i={},o=0;o{"use strict";var r=n(3102),s=n(7995),a=n(2600);function i(t,e,n,r,s){var a=t.map((function(t){return function(t,e,n,r,s){if("string"==typeof t){var a=t;return function(){return a}}var l,c=t[0],u=t[1];if(e&&"#"===t[0]){c=e[0];var d=e[2],h=(r.number||m.number)([c,"number"],n);return function(t){return h(o(c,t)-d,t)}}"plural"===u||"selectordinal"===u?(l={},Object.keys(t[3]).forEach((function(e){l[e]=i(t[3][e],t,n,r,s)})),t=[t[0],t[1],t[2],l]):t[2]&&"object"==typeof t[2]&&(l={},Object.keys(t[2]).forEach((function(e){l[e]=i(t[2][e],t,n,r,s)})),t=[t[0],t[1],l]);var p=u&&(r[u]||m[u]);if(p){var f=p(t,n);return function(t){return f(o(c,t),t)}}return s?function(t){return String(o(c,t))}:function(t){return o(c,t)}}(t,e,n,r,s)}));return s?1===a.length?a[0]:function(t){for(var e="",n=0;n0)n=new Intl.PluralRules(e,{type:r});else{var l=s(e,a),c=l&&a[l][r]||d;n={select:c}}return function(t,e){return(o["="+ +t]||o[n.select(t-i)]||o.other)(e)}}function d(){return"other"}(e=t.exports=function(t,e,n){return i(t,null,e||"en",n||{},!0)}).toParts=function(t,e,n){return i(t,null,e||"en",n||{},!1)};var m={number:l,ordinal:l,spellout:l,duration:function(t,e){var n=t[2],s=r.duration[n]||r.duration.default,a=new Intl.NumberFormat(e,s.seconds).format,i=new Intl.NumberFormat(e,s.minutes).format,o=new Intl.NumberFormat(e,s.hours).format,l=/^fi$|^fi-|^da/.test(String(e))?".":":";return function(t,e){if(t=+t,!isFinite(t))return a(t);var n=~~(t/60/60),r=~~(t/60%60),s=(n?o(Math.abs(n))+l:"")+i(Math.abs(r))+l+a(Math.abs(t%60));return t<0?o(-1).replace(o(1),s):s}},date:c,time:c,plural:u,selectordinal:u,select:function(t,e){var n=t[2];return function(t,e){return(n[t]||n.other)(e)}}};e.types=m},2600:t=>{"use strict";var e="zero",n="one",r="two",s="few",a="many",i="other",o=[function(t){return 1==+t?n:i},function(t){var e=+t;return 0<=e&&e<=1?n:i},function(t){return 0===Math.floor(Math.abs(+t))||1==+t?n:i},function(t){var o=+t;return 0===o?e:1===o?n:2===o?r:3<=o%100&&o%100<=10?s:11<=o%100&&o%100<=99?a:i},function(t){var e=Math.floor(Math.abs(+t)),r=(t+".").split(".")[1].length;return 1===e&&0===r?n:i},function(t){var e=+t;return e%10==1&&e%100!=11?n:2<=e%10&&e%10<=4&&(e%100<12||14{"use strict";var n="{",r="}",s=",",a="#",i="<",o=">",l="=9&&t<=13||32===t||133===t||160===t||6158===t||t>=8192&&t<=8205||8232===t||8233===t||8239===t||8287===t||8288===t||12288===t||65279===t}function f(t){for(var e=t.pattern,n=e.length,r=t.index;t.index"===t.pattern.slice(t.index,t.index+2))return t.tokens&&t.tokens.push(["syntax","/>"]),t.index+=2,[n,e];if(t.pattern[t.index]!==o)throw A(t,o);t.tokens&&t.tokens.push(["syntax",o]),++t.index;var r=m(t,e),s=t.index;if(t.pattern.slice(t.index,t.index+2)!==l)throw A(t,l+n+o);t.tokens&&t.tokens.push(["syntax",l]),t.index+=2;var a=v(t,!0);if(a&&t.tokens&&t.tokens.push(["id",a]),n!==a)throw t.index=s,A(t,l+n+o,l+a+o);if(f(t),t.pattern[t.index]!==o)throw A(t,o);return t.tokens&&t.tokens.push(["syntax",o]),++t.index,[n,e,{children:r}]}}(t);if(c)return c;if(e[t.index]!==n)throw A(t,n);t.tokens&&t.tokens.push(["syntax",n]),++t.index,f(t);var d=v(t);if(!d)throw A(t,"placeholder id");t.tokens&&t.tokens.push(["id",d]),f(t);var h=e[t.index];if(h===r)return t.tokens&&t.tokens.push(["syntax",r]),++t.index,[d];if(h!==s)throw A(t,", or }");t.tokens&&t.tokens.push(["syntax",s]),++t.index,f(t);var p,g=v(t);if(!g)throw A(t,"placeholder type");if(t.tokens&&t.tokens.push(["type",g]),f(t),(h=e[t.index])===r){if(t.tokens&&t.tokens.push(["syntax",r]),"plural"===g||"selectordinal"===g||"select"===g)throw A(t,g+" sub-messages");return++t.index,[d,g]}if(h!==s)throw A(t,", or }");if(t.tokens&&t.tokens.push(["syntax",s]),++t.index,f(t),"plural"===g||"selectordinal"===g){var w=function(t){var e,n=t.pattern,r=n.length,s=0;if("offset:"===n.slice(t.index,t.index+7)){t.tokens&&t.tokens.push(["offset","offset"],["syntax",":"]),t.index+=7,f(t);for(var a=t.index;t.index=48&&e<=57);)++t.index;if(a===t.index)throw A(t,"offset number");t.tokens&&t.tokens.push(["number",n.slice(a,t.index)]),s=+n.slice(a,t.index)}return s}(t);f(t),p=[d,g,w,y(t,g)]}else if("select"===g)p=[d,g,y(t,g)];else if(u.indexOf(g)>=0)p=[d,g,b(t)];else{var x=t.index,N=b(t);f(t),e[t.index]===n&&(t.index=x,N=y(t,g)),p=[d,g,N]}if(f(t),e[t.index]!==r)throw A(t,r);return t.tokens&&t.tokens.push(["syntax",r]),++t.index,p}function v(t,e){for(var l=t.pattern,u=l.length,d="";t.index=0)throw A(t,null,null,'"other" sub-message must be specified in '+e);return a}function w(t,e){if(t.pattern[t.index]!==n)throw A(t,"{ to start sub-message");t.tokens&&t.tokens.push(["syntax",n]),++t.index;var s=m(t,e);if(t.pattern[t.index]!==r)throw A(t,"} to end sub-message");return t.tokens&&t.tokens.push(["syntax",r]),++t.index,s}function A(t,e,n,r){var s=t.pattern,a=s.slice(0,t.index).split(/\r?\n/),i=t.index,o=a.length,l=a.slice(-1)[0].length;return n=n||(t.index>=s.length?"end of message pattern":v(t)||s[t.index]),r||(r=function(t,e){return t?"Expected "+t+" but found "+e:"Unexpected "+e+" found"}(e,n)),new x(r+=" in "+s.replace(/\r?\n/g,"\n"),e,n,i,o,l)}function x(t,e,n,r,s,a){Error.call(this,t),this.name="SyntaxError",this.message=t,this.expected=e,this.found=n,this.offset=r,this.line=s,this.column=a}e=t.exports=function(t,e){return m({pattern:String(t),index:0,tagsType:e&&e.tagsType||null,tokens:e&&e.tokens||null},"")},x.prototype=Object.create(Error.prototype),e.SyntaxError=x},3083:(t,e,n)=>{"use strict";var r=n(9897),s=n(6087),a=n(2600),i=n(7995),o=n(3102);function l(t,e){return Object.keys(e).forEach((function(n){t[n]=e[n]})),t}t.exports=function t(){var e=l({},o),n="en",c={},u=function(t){return t},d=null,m="warning",h={};function p(t,e,a){var i="string"==typeof t?t:t.default,o=v(i,"object"==typeof t&&t.id||u(i),a||n);return(o.format||(o.format=s(r(o.message),a||n,h)))(e)}p.rich=function(t,e,a){var i="string"==typeof t?t:t.default,o=v(i,"object"==typeof t&&t.id||u(i),a||n);return(o.toParts||(o.toParts=s.toParts(r(o.message,{tagsType:f}),a||n,h)))(e)};var f="<>";function g(t,e){var n=t[2];return function(t,e){var r="object"==typeof n?function(t,e){return Object.keys(t).reduce((function(n,r){return n[r]=t[r](e),n}),{})}(n,e):n;return"function"==typeof t?t(r):t}}function v(t,e,n){var r=i(n,c)||"en",s=c[r]||(c[r]={}),a=s[e];if("string"==typeof a&&(a=s[e]={message:a}),!a){var o='Translation for "'+e+'" in "'+r+'" is missing';if("warning"===m)"undefined"!=typeof console&&console.warn(o);else if("ignore"!==m)throw new Error(o);var l="function"==typeof d?d(t,e,r)||t:d||t;a=s[e]={message:l}}return a}function b(t,e,r,s,o){"object"==typeof r&&"object"!=typeof s&&(o=s,s=r,r=0);var l=i(o||n,a),c=l&&a[l][t]||y;return s["="+ +e]||s[c(e-r)]||s.other}function y(){return"other"}return h[f]=g,p.setup=function(t){return(t=t||{}).locale&&(n=t.locale),"translations"in t&&(c=t.translations||{}),t.generateId&&(u=t.generateId),"missingReplacement"in t&&(d=t.missingReplacement),t.missingTranslation&&(m=t.missingTranslation),t.formats&&(t.formats.number&&l(e.number,t.formats.number),t.formats.date&&l(e.date,t.formats.date),t.formats.time&&l(e.time,t.formats.time)),t.types&&((h=t.types)[f]=g),{locale:n,translations:c,generateId:u,missingReplacement:d,missingTranslation:m,formats:e,types:h}},p.number=function(t,r,s){var a=r&&e.number[r]||e.parseNumberPattern(r)||e.number.default;return new Intl.NumberFormat(s||n,a).format(t)},p.date=function(t,r,s){var a=r&&e.date[r]||e.parseDatePattern(r)||e.date.default;return new Intl.DateTimeFormat(s||n,a).format(t)},p.time=function(t,r,s){var a=r&&e.time[r]||e.parseDatePattern(r)||e.time.default;return new Intl.DateTimeFormat(s||n,a).format(t)},p.select=function(t,e){return e[t]||e.other},p.custom=function(t,e,n,r){return t[1]in h?h[t[1]](t,e)(n,r):n},p.plural=b.bind(null,"cardinal"),p.selectordinal=b.bind(null,"ordinal"),p.namespace=t,p}()},2894:function(){!function(t){function e(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var n=e.handler,r=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable")||t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1)){var s="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),i="",o={};t.each(["alt","ctrl","shift"],(function(t,n){e[n+"Key"]&&s!==n&&(i+=n+"+")})),e.metaKey&&!e.ctrlKey&&"meta"!==s&&(i+="meta+"),e.metaKey&&"meta"!==s&&i.indexOf("alt+ctrl+shift+")>-1&&(i=i.replace("alt+ctrl+shift+","hyper+")),s?o[i+s]=!0:(o[i+a]=!0,o[i+t.hotkeys.shiftNums[a]]=!0,"shift+"===i&&(o[t.hotkeys.shiftNums[a]]=!0));for(var l=0,c=r.length;l","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},t.each(["keydown","keyup","keypress"],(function(){t.event.special[this]={add:e}}))}(jQuery||this.jQuery||window.jQuery)},1963:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,s){"use strict";var a=[],i=Object.getPrototypeOf,o=a.slice,l=a.flat?function(t){return a.flat.call(t)}:function(t){return a.concat.apply([],t)},c=a.push,u=a.indexOf,d={},m=d.toString,h=d.hasOwnProperty,p=h.toString,f=p.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},y=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function A(t,e,n){var r,s,a=(n=n||y).createElement("script");if(a.text=t,e)for(r in w)(s=e[r]||e.getAttribute&&e.getAttribute(r))&&a.setAttribute(r,s);n.head.appendChild(a).parentNode.removeChild(a)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[m.call(t)]||"object":typeof t}var N="3.7.1",k=/HTML$/i,_=function(t,e){return new _.fn.init(t,e)};function S(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!v(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}_.fn=_.prototype={jquery:N,constructor:_,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(_.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+P+")"+P+"*"),q=new RegExp(P+"|>"),H=new RegExp($),U=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:new RegExp("^(?:"+S+")$","i"),needsContext:new RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},z=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+P+"?|\\\\([^\\r\\n\\f])","g"),Q=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},X=function(){lt()},J=mt((function(t){return!0===t.disabled&&E(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{f.apply(a=o.call(L.childNodes),L.childNodes),a[L.childNodes.length].nodeType}catch(t){f={apply:function(t,e){j.apply(t,o.call(e))},call:function(t){j.apply(t,o.call(arguments,1))}}}function Z(t,e,n,r){var s,a,i,o,c,u,h,p=e&&e.ownerDocument,b=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return n;if(!r&&(lt(e),e=e||l,d)){if(11!==b&&(c=V.exec(t)))if(s=c[1]){if(9===b){if(!(i=e.getElementById(s)))return n;if(i.id===s)return f.call(n,i),n}else if(p&&(i=p.getElementById(s))&&Z.contains(e,i)&&i.id===s)return f.call(n,i),n}else{if(c[2])return f.apply(n,e.getElementsByTagName(t)),n;if((s=c[3])&&e.getElementsByClassName)return f.apply(n,e.getElementsByClassName(s)),n}if(!(N[t+" "]||m&&m.test(t))){if(h=t,p=e,1===b&&(q.test(t)||F.test(t))){for((p=K.test(t)&&ot(e.parentNode)||e)==e&&g.scope||((o=e.getAttribute("id"))?o=_.escapeSelector(o):e.setAttribute("id",o=v)),a=(u=ut(t)).length;a--;)u[a]=(o?"#"+o:":scope")+" "+dt(u[a]);h=u.join(",")}try{return f.apply(n,p.querySelectorAll(h)),n}catch(e){N(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(M,"$1"),e,n,r)}function tt(){var t=[];return function n(r,s){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=s}}function et(t){return t[v]=!0,t}function nt(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return E(e,"input")&&e.type===t}}function st(t){return function(e){return(E(e,"input")||E(e,"button"))&&e.type===t}}function at(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&J(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function it(t){return et((function(e){return e=+e,et((function(n,r){for(var s,a=t([],n.length,e),i=a.length;i--;)n[s=a[i]]&&(n[s]=!(r[s]=n[s]))}))}))}function ot(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var n,r=t?t.ownerDocument||t:L;return r!=l&&9===r.nodeType&&r.documentElement?(c=(l=r).documentElement,d=!_.isXMLDoc(l),p=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&L!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",X),g.getById=nt((function(t){return c.appendChild(t).id=_.expando,!l.getElementsByName||!l.getElementsByName(_.expando).length})),g.disconnectedMatch=nt((function(t){return p.call(t,"*")})),g.scope=nt((function(){return l.querySelectorAll(":scope")})),g.cssHas=nt((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),g.getById?(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n,r,s,a=e.getElementById(t);if(a){if((n=a.getAttributeNode("id"))&&n.value===t)return[a];for(s=e.getElementsByName(t),r=0;a=s[r++];)if((n=a.getAttributeNode("id"))&&n.value===t)return[a]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&d)return e.getElementsByClassName(t)},m=[],nt((function(t){var e;c.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||m.push("\\["+P+"*(?:value|"+S+")"),t.querySelectorAll("[id~="+v+"-]").length||m.push("~="),t.querySelectorAll("a#"+v+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll(":checked").length||m.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+P+"*name"+P+"*="+P+"*(?:''|\"\")")})),g.cssHas||m.push(":has"),m=m.length&&new RegExp(m.join("|")),k=function(t,e){if(t===e)return i=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===n?t===l||t.ownerDocument==L&&Z.contains(L,t)?-1:e===l||e.ownerDocument==L&&Z.contains(L,e)?1:s?u.call(s,t)-u.call(s,e):0:4&n?-1:1)},l):l}for(t in Z.matches=function(t,e){return Z(t,null,null,e)},Z.matchesSelector=function(t,e){if(lt(t),d&&!N[e+" "]&&(!m||!m.test(e)))try{var n=p.call(t,e);if(n||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){N(e,!0)}return Z(e,l,null,[t]).length>0},Z.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),_.contains(t,e)},Z.attr=function(t,n){(t.ownerDocument||t)!=l&<(t);var r=e.attrHandle[n.toLowerCase()],s=r&&h.call(e.attrHandle,n.toLowerCase())?r(t,n,!d):void 0;return void 0!==s?s:t.getAttribute(n)},Z.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},_.uniqueSort=function(t){var e,n=[],r=0,a=0;if(i=!g.sortStable,s=!g.sortStable&&o.call(t,0),C.call(t,k),i){for(;e=t[a++];)e===t[a]&&(r=n.push(a));for(;r--;)D.call(t,n[r],1)}return s=null,t},_.fn.uniqueSort=function(){return this.pushStack(_.uniqueSort(o.apply(this)))},e=_.expr={cacheLength:50,createPseudo:et,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,Q),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,Q),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Z.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Z.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&H.test(n)&&(e=ut(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,Q).toLowerCase();return"*"===t?function(){return!0}:function(t){return E(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+P+")"+t+"("+P+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var s=Z.attr(r,t);return null==s?"!="===e:!e||(s+="","="===e?s===n:"!="===e?s!==n:"^="===e?n&&0===s.indexOf(n):"*="===e?n&&s.indexOf(n)>-1:"$="===e?n&&s.slice(-n.length)===n:"~="===e?(" "+s.replace(B," ")+" ").indexOf(n)>-1:"|="===e&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,s){var a="nth"!==t.slice(0,3),i="last"!==t.slice(-4),o="of-type"===e;return 1===r&&0===s?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,m,h,p=a!==i?"nextSibling":"previousSibling",f=e.parentNode,g=o&&e.nodeName.toLowerCase(),y=!l&&!o,w=!1;if(f){if(a){for(;p;){for(d=e;d=d[p];)if(o?E(d,g):1===d.nodeType)return!1;h=p="only"===t&&!h&&"nextSibling"}return!0}if(h=[i?f.firstChild:f.lastChild],i&&y){for(w=(m=(c=(u=f[v]||(f[v]={}))[t]||[])[0]===b&&c[1])&&c[2],d=m&&f.childNodes[m];d=++m&&d&&d[p]||(w=m=0)||h.pop();)if(1===d.nodeType&&++w&&d===e){u[t]=[b,m,w];break}}else if(y&&(w=m=(c=(u=e[v]||(e[v]={}))[t]||[])[0]===b&&c[1]),!1===w)for(;(d=++m&&d&&d[p]||(w=m=0)||h.pop())&&(!(o?E(d,g):1===d.nodeType)||!++w||(y&&((u=d[v]||(d[v]={}))[t]=[b,w]),d!==e)););return(w-=s)===r||w%r==0&&w/r>=0}}},PSEUDO:function(t,n){var r,s=e.pseudos[t]||e.setFilters[t.toLowerCase()]||Z.error("unsupported pseudo: "+t);return s[v]?s(n):s.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,a=s(t,n),i=a.length;i--;)t[r=u.call(t,a[i])]=!(e[r]=a[i])})):function(t){return s(t,0,r)}):s}},pseudos:{not:et((function(t){var e=[],n=[],r=vt(t.replace(M,"$1"));return r[v]?et((function(t,e,n,s){for(var a,i=r(t,null,s,[]),o=t.length;o--;)(a=i[o])&&(t[o]=!(e[o]=a))})):function(t,s,a){return e[0]=t,r(e,null,a,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return Z(t,e).length>0}})),contains:et((function(t){return t=t.replace(Y,Q),function(e){return(e.textContent||_.text(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||Z.error("unsupported lang: "+t),t=t.replace(Y,Q).toLowerCase(),function(e){var n;do{if(n=d?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:at(!1),disabled:at(!0),checked:function(t){return E(t,"input")&&!!t.checked||E(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return W.test(t.nodeName)},input:function(t){return z.test(t.nodeName)},button:function(t){return E(t,"input")&&"button"===t.type||E(t,"button")},text:function(t){var e;return E(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:it((function(){return[0]})),last:it((function(t,e){return[e-1]})),eq:it((function(t,e,n){return[n<0?n+e:n]})),even:it((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:it((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var s=t.length;s--;)if(!t[s](e,n,r))return!1;return!0}:t[0]}function pt(t,e,n,r,s){for(var a,i=[],o=0,l=t.length,c=null!=e;o-1&&(a[c]=!(i[c]=m))}}else h=pt(h===i?h.splice(v,h.length):h),s?s(null,i,h,l):f.apply(i,h)}))}function gt(t){for(var r,s,a,i=t.length,o=e.relative[t[0].type],l=o||e.relative[" "],c=o?1:0,d=mt((function(t){return t===r}),l,!0),m=mt((function(t){return u.call(r,t)>-1}),l,!0),h=[function(t,e,s){var a=!o&&(s||e!=n)||((r=e).nodeType?d(t,e,s):m(t,e,s));return r=null,a}];c1&&ht(h),c>1&&dt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(M,"$1"),s,c0,a=t.length>0,i=function(i,o,c,u,m){var h,p,g,v=0,y="0",w=i&&[],A=[],x=n,N=i||a&&e.find.TAG("*",m),k=b+=null==x?1:Math.random()||.1,S=N.length;for(m&&(n=o==l||o||m);y!==S&&null!=(h=N[y]);y++){if(a&&h){for(p=0,o||h.ownerDocument==l||(lt(h),c=!d);g=t[p++];)if(g(h,o||l,c)){f.call(u,h);break}m&&(b=k)}s&&((h=!g&&h)&&v--,i&&w.push(h))}if(v+=y,s&&y!==v){for(p=0;g=r[p++];)g(w,A,o,c);if(i){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=T.call(u));A=pt(A)}f.apply(u,A),m&&!i&&A.length>0&&v+r.length>1&&_.uniqueSort(u)}return m&&(b=k,n=x),w};return s?et(i):i}(i,a)),o.selector=t}return o}function bt(t,n,r,s){var a,i,o,l,c,u="function"==typeof t&&t,m=!s&&ut(t=u.selector||t);if(r=r||[],1===m.length){if((i=m[0]=m[0].slice(0)).length>2&&"ID"===(o=i[0]).type&&9===n.nodeType&&d&&e.relative[i[1].type]){if(!(n=(e.find.ID(o.matches[0].replace(Y,Q),n)||[])[0]))return r;u&&(n=n.parentNode),t=t.slice(i.shift().value.length)}for(a=G.needsContext.test(t)?0:i.length;a--&&(o=i[a],!e.relative[l=o.type]);)if((c=e.find[l])&&(s=c(o.matches[0].replace(Y,Q),K.test(i[0].type)&&ot(n.parentNode)||n))){if(i.splice(a,1),!(t=s.length&&dt(i)))return f.apply(r,s),r;break}}return(u||vt(t,m))(s,n,!d,r,!n||K.test(t)&&ot(n.parentNode)||n),r}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,g.sortStable=v.split("").sort(k).join("")===v,lt(),g.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),_.find=Z,_.expr[":"]=_.expr.pseudos,_.unique=_.uniqueSort,Z.compile=vt,Z.select=bt,Z.setDocument=lt,Z.tokenize=ut,Z.escape=_.escapeSelector,Z.getText=_.text,Z.isXML=_.isXMLDoc,Z.selectors=_.expr,Z.support=_.support,Z.uniqueSort=_.uniqueSort}();var $=function(t,e,n){for(var r=[],s=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&_(t).is(n))break;r.push(t)}return r},B=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},R=_.expr.match.needsContext,F=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function q(t,e,n){return v(e)?_.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?_.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?_.grep(t,(function(t){return u.call(e,t)>-1!==n})):_.filter(e,t,n)}_.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?_.find.matchesSelector(r,t)?[r]:[]:_.find.matches(t,_.grep(e,(function(t){return 1===t.nodeType})))},_.fn.extend({find:function(t){var e,n,r=this.length,s=this;if("string"!=typeof t)return this.pushStack(_(t).filter((function(){for(e=0;e1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(q(this,t||[],!1))},not:function(t){return this.pushStack(q(this,t||[],!0))},is:function(t){return!!q(this,"string"==typeof t&&R.test(t)?_(t):t||[],!1).length}});var H,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var r,s;if(!t)return this;if(n=n||H,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:U.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),F.test(r[1])&&_.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(s=y.getElementById(r[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,H=_(y);var G=/^(?:parents|prev(?:Until|All))/,z={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&_.find.matchesSelector(n,t))){a.push(n);break}return this.pushStack(a.length>1?_.uniqueSort(a):a)},index:function(t){return t?"string"==typeof t?u.call(_(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return $(t,"parentNode")},parentsUntil:function(t,e,n){return $(t,"parentNode",n)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return $(t,"nextSibling")},prevAll:function(t){return $(t,"previousSibling")},nextUntil:function(t,e,n){return $(t,"nextSibling",n)},prevUntil:function(t,e,n){return $(t,"previousSibling",n)},siblings:function(t){return B((t.parentNode||{}).firstChild,t)},children:function(t){return B(t.firstChild)},contents:function(t){return null!=t.contentDocument&&i(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},(function(t,e){_.fn[t]=function(n,r){var s=_.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(s=_.filter(r,s)),this.length>1&&(z[t]||_.uniqueSort(s),G.test(t)&&s.reverse()),this.pushStack(s)}}));var V=/[^\x20\t\r\n\f]+/g;function K(t){return t}function Y(t){throw t}function Q(t,e,n,r){var s;try{t&&v(s=t.promise)?s.call(t).done(e).fail(n):t&&v(s=t.then)?s.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return _.each(t.match(V)||[],(function(t,n){e[n]=!0})),e}(t):_.extend({},t);var e,n,r,s,a=[],i=[],o=-1,l=function(){for(s=s||t.once,r=e=!0;i.length;o=-1)for(n=i.shift();++o-1;)a.splice(n,1),n<=o&&o--})),this},has:function(t){return t?_.inArray(t,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return s=i=[],a=n="",this},disabled:function(){return!a},lock:function(){return s=i=[],n||e||(a=n=""),this},locked:function(){return!!s},fireWith:function(t,n){return s||(n=[t,(n=n||[]).slice?n.slice():n],i.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return _.Deferred((function(n){_.each(e,(function(e,r){var s=v(t[r[4]])&&t[r[4]];a[r[1]]((function(){var t=s&&s.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,s?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,s){var a=0;function i(t,e,n,s){return function(){var o=this,l=arguments,c=function(){var r,c;if(!(t=a&&(n!==Y&&(o=void 0,l=[r]),e.rejectWith(o,l))}};t?u():(_.Deferred.getErrorHook?u.error=_.Deferred.getErrorHook():_.Deferred.getStackHook&&(u.error=_.Deferred.getStackHook()),r.setTimeout(u))}}return _.Deferred((function(r){e[0][3].add(i(0,r,v(s)?s:K,r.notifyWith)),e[1][3].add(i(0,r,v(t)?t:K)),e[2][3].add(i(0,r,v(n)?n:Y))})).promise()},promise:function(t){return null!=t?_.extend(t,s):s}},a={};return _.each(e,(function(t,r){var i=r[2],o=r[5];s[r[1]]=i.add,o&&i.add((function(){n=o}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),i.add(r[3].fire),a[r[0]]=function(){return a[r[0]+"With"](this===a?void 0:this,arguments),this},a[r[0]+"With"]=i.fireWith})),s.promise(a),t&&t.call(a,a),a},when:function(t){var e=arguments.length,n=e,r=Array(n),s=o.call(arguments),a=_.Deferred(),i=function(t){return function(n){r[t]=this,s[t]=arguments.length>1?o.call(arguments):n,--e||a.resolveWith(r,s)}};if(e<=1&&(Q(t,a.done(i(n)).resolve,a.reject,!e),"pending"===a.state()||v(s[n]&&s[n].then)))return a.then();for(;n--;)Q(s[n],i(n),a.reject);return a.promise()}});var X=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&X.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){r.setTimeout((function(){throw t}))};var J=_.Deferred();function Z(){y.removeEventListener("DOMContentLoaded",Z),r.removeEventListener("load",Z),_.ready()}_.fn.ready=function(t){return J.then(t).catch((function(t){_.readyException(t)})),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||J.resolveWith(y,[_]))}}),_.ready.then=J.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?r.setTimeout(_.ready):(y.addEventListener("DOMContentLoaded",Z),r.addEventListener("load",Z));var tt=function(t,e,n,r,s,a,i){var o=0,l=t.length,c=null==n;if("object"===x(n))for(o in s=!0,n)tt(t,e,o,n[o],!0,a,i);else if(void 0!==r&&(s=!0,v(r)||(i=!0),c&&(i?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(_(t),n)})),e))for(;o1,null,!0)},removeData:function(t){return this.each((function(){lt.remove(this,t)}))}}),_.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=ot.get(t,e),n&&(!r||Array.isArray(n)?r=ot.access(t,e,_.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),r=n.length,s=n.shift(),a=_._queueHooks(t,e);"inprogress"===s&&(s=n.shift(),r--),s&&("fx"===e&&n.unshift("inprogress"),delete a.stop,s.call(t,(function(){_.dequeue(t,e)}),a)),!r&&a&&a.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return ot.get(t,n)||ot.access(t,n,{empty:_.Callbacks("once memory").add((function(){ot.remove(t,[e+"queue",n])}))})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Et=/^$|^module$|\/(?:java|ecma)script/i;Nt=y.createDocumentFragment().appendChild(y.createElement("div")),(kt=y.createElement("input")).setAttribute("type","radio"),kt.setAttribute("checked","checked"),kt.setAttribute("name","t"),Nt.appendChild(kt),g.checkClone=Nt.cloneNode(!0).cloneNode(!0).lastChild.checked,Nt.innerHTML="",g.noCloneChecked=!!Nt.cloneNode(!0).lastChild.defaultValue,Nt.innerHTML="",g.option=!!Nt.lastChild;var Tt={thead:[1,"","
          "],col:[2,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],_default:[0,"",""]};function Ct(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?_.merge([t],n):n}function Dt(t,e){for(var n=0,r=t.length;n",""]);var Pt=/<|&#?\w+;/;function Mt(t,e,n,r,s){for(var a,i,o,l,c,u,d=e.createDocumentFragment(),m=[],h=0,p=t.length;h-1)s&&s.push(a);else if(c=gt(a),i=Ct(d.appendChild(a),"script"),c&&Dt(i),n)for(u=0;a=i[u++];)Et.test(a.type||"")&&n.push(a);return d}var It=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Lt(){return!1}function jt(t,e,n,r,s,a){var i,o;if("object"==typeof e){for(o in"string"!=typeof n&&(r=r||n,n=void 0),e)jt(t,o,n,r,e[o],a);return t}if(null==r&&null==s?(s=n,r=n=void 0):null==s&&("string"==typeof n?(s=r,r=void 0):(s=r,r=n,n=void 0)),!1===s)s=Lt;else if(!s)return t;return 1===a&&(i=s,s=function(t){return _().off(t),i.apply(this,arguments)},s.guid=i.guid||(i.guid=_.guid++)),t.each((function(){_.event.add(this,e,s,r,n)}))}function $t(t,e,n){n?(ot.set(t,e,!1),_.event.add(t,e,{namespace:!1,handler:function(t){var n,r=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(_.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=o.call(arguments),ot.set(this,e,r),this[e](),n=ot.get(this,e),ot.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(ot.set(this,e,_.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Ot)}})):void 0===ot.get(t,e)&&_.event.add(t,e,Ot)}_.event={global:{},add:function(t,e,n,r,s){var a,i,o,l,c,u,d,m,h,p,f,g=ot.get(t);if(at(t))for(n.handler&&(n=(a=n).handler,s=a.selector),s&&_.find.matchesSelector(ft,s),n.guid||(n.guid=_.guid++),(l=g.events)||(l=g.events=Object.create(null)),(i=g.handle)||(i=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(V)||[""]).length;c--;)h=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h&&(d=_.event.special[h]||{},h=(s?d.delegateType:d.bindType)||h,d=_.event.special[h]||{},u=_.extend({type:h,origType:f,data:r,handler:n,guid:n.guid,selector:s,needsContext:s&&_.expr.match.needsContext.test(s),namespace:p.join(".")},a),(m=l[h])||((m=l[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,p,i)||t.addEventListener&&t.addEventListener(h,i)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),s?m.splice(m.delegateCount++,0,u):m.push(u),_.event.global[h]=!0)},remove:function(t,e,n,r,s){var a,i,o,l,c,u,d,m,h,p,f,g=ot.hasData(t)&&ot.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(V)||[""]).length;c--;)if(h=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h){for(d=_.event.special[h]||{},m=l[h=(r?d.delegateType:d.bindType)||h]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=a=m.length;a--;)u=m[a],!s&&f!==u.origType||n&&n.guid!==u.guid||o&&!o.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(m.splice(a,1),u.selector&&m.delegateCount--,d.remove&&d.remove.call(t,u));i&&!m.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||_.removeEvent(t,h,g.handle),delete l[h])}else for(h in l)_.event.remove(t,h+e[c],n,r,!0);_.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,n,r,s,a,i,o=new Array(arguments.length),l=_.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],u=_.event.special[l.type]||{};for(o[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(a=[],i={},n=0;n-1:_.find(s,this,null,[c]).length),i[s]&&a.push(r);a.length&&o.push({elem:c,handlers:a})}return c=this,l\s*$/g;function qt(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&_(t).children("tbody")[0]||t}function Ht(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Gt(t,e){var n,r,s,a,i,o;if(1===e.nodeType){if(ot.hasData(t)&&(o=ot.get(t).events))for(s in ot.remove(e,"handle events"),o)for(n=0,r=o[s].length;n1&&"string"==typeof p&&!g.checkClone&&Rt.test(p))return t.each((function(s){var a=t.eq(s);f&&(e[0]=p.call(this,s,a.html())),Wt(a,e,n,r)}));if(m&&(a=(s=Mt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===s.childNodes.length&&(s=a),a||r)){for(o=(i=_.map(Ct(s,"script"),Ht)).length;d0&&Dt(i,!l&&Ct(t,"script")),o},cleanData:function(t){for(var e,n,r,s=_.event.special,a=0;void 0!==(n=t[a]);a++)if(at(n)){if(e=n[ot.expando]){if(e.events)for(r in e.events)s[r]?_.event.remove(n,r):_.removeEvent(n,r,e.handle);n[ot.expando]=void 0}n[lt.expando]&&(n[lt.expando]=void 0)}}}),_.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?_.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qt(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=qt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(Ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return _.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Bt.test(t)&&!Tt[(St.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-a-l-o-.5))||0),l+c}function ue(t,e,n){var r=Qt(t),s=(!g.boxSizingReliable()||n)&&"border-box"===_.css(t,"boxSizing",!1,r),a=s,i=Zt(t,e,r),o="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(i)){if(!n)return i;i="auto"}return(!g.boxSizingReliable()&&s||!g.reliableTrDimensions()&&E(t,"tr")||"auto"===i||!parseFloat(i)&&"inline"===_.css(t,"display",!1,r))&&t.getClientRects().length&&(s="border-box"===_.css(t,"boxSizing",!1,r),(a=o in t)&&(i=t[o])),(i=parseFloat(i)||0)+ce(t,e,n||(s?"border":"content"),a,r,i)+"px"}function de(t,e,n,r,s){return new de.prototype.init(t,e,n,r,s)}_.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Zt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,a,i,o=st(e),l=Yt.test(e),c=t.style;if(l||(e=se(o)),i=_.cssHooks[e]||_.cssHooks[o],void 0===n)return i&&"get"in i&&void 0!==(s=i.get(t,!1,r))?s:c[e];"string"==(a=typeof n)&&(s=ht.exec(n))&&s[1]&&(n=yt(t,e,s),a="number"),null!=n&&n==n&&("number"!==a||l||(n+=s&&s[3]||(_.cssNumber[o]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),i&&"set"in i&&void 0===(n=i.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var s,a,i,o=st(e);return Yt.test(e)||(e=se(o)),(i=_.cssHooks[e]||_.cssHooks[o])&&"get"in i&&(s=i.get(t,!0,n)),void 0===s&&(s=Zt(t,e,r)),"normal"===s&&e in oe&&(s=oe[e]),""===n||n?(a=parseFloat(s),!0===n||isFinite(a)?a||0:s):s}}),_.each(["height","width"],(function(t,e){_.cssHooks[e]={get:function(t,n,r){if(n)return!ae.test(_.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,r):Xt(t,ie,(function(){return ue(t,e,r)}))},set:function(t,n,r){var s,a=Qt(t),i=!g.scrollboxSize()&&"absolute"===a.position,o=(i||r)&&"border-box"===_.css(t,"boxSizing",!1,a),l=r?ce(t,e,r,o,a):0;return o&&i&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(a[e])-ce(t,e,"border",!1,a)-.5)),l&&(s=ht.exec(n))&&"px"!==(s[3]||"px")&&(t.style[e]=n,n=_.css(t,e)),le(0,n,l)}}})),_.cssHooks.marginLeft=te(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-Xt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),_.each({margin:"",padding:"",border:"Width"},(function(t,e){_.cssHooks[t+e]={expand:function(n){for(var r=0,s={},a="string"==typeof n?n.split(" "):[n];r<4;r++)s[t+pt[r]+e]=a[r]||a[r-2]||a[0];return s}},"margin"!==t&&(_.cssHooks[t+e].set=le)})),_.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,s,a={},i=0;if(Array.isArray(e)){for(r=Qt(t),s=e.length;i1)}}),_.Tween=de,de.prototype={constructor:de,init:function(t,e,n,r,s,a){this.elem=t,this.prop=n,this.easing=s||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=a||(_.cssNumber[n]?"":"px")},cur:function(){var t=de.propHooks[this.prop];return t&&t.get?t.get(this):de.propHooks._default.get(this)},run:function(t){var e,n=de.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):de.propHooks._default.set(this),this}},de.prototype.init.prototype=de.prototype,de.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||!_.cssHooks[t.prop]&&null==t.elem.style[se(t.prop)]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},de.propHooks.scrollTop=de.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=de.prototype.init,_.fx.step={};var me,he,pe=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;function ge(){he&&(!1===y.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ge):r.setTimeout(ge,_.fx.interval),_.fx.tick())}function ve(){return r.setTimeout((function(){me=void 0})),me=Date.now()}function be(t,e){var n,r=0,s={height:t};for(e=e?1:0;r<4;r+=2-e)s["margin"+(n=pt[r])]=s["padding"+n]=t;return e&&(s.opacity=s.width=t),s}function ye(t,e,n){for(var r,s=(we.tweeners[e]||[]).concat(we.tweeners["*"]),a=0,i=s.length;a1)},removeAttr:function(t){return this.each((function(){_.removeAttr(this,t)}))}}),_.extend({attr:function(t,e,n){var r,s,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===t.getAttribute?_.prop(t,e,n):(1===a&&_.isXMLDoc(t)||(s=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?Ae:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:(t.setAttribute(e,n+""),n):s&&"get"in s&&null!==(r=s.get(t,e))?r:null==(r=_.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,s=e&&e.match(V);if(s&&1===t.nodeType)for(;n=s[r++];)t.removeAttribute(n)}}),Ae={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||_.find.attr;xe[e]=function(t,e,r){var s,a,i=e.toLowerCase();return r||(a=xe[i],xe[i]=s,s=null!=n(t,e,r)?i:null,xe[i]=a),s}}));var Ne=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function _e(t){return(t.match(V)||[]).join(" ")}function Se(t){return t.getAttribute&&t.getAttribute("class")||""}function Ee(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}_.fn.extend({prop:function(t,e){return tt(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[_.propFix[t]||t]}))}}),_.extend({prop:function(t,e,n){var r,s,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&_.isXMLDoc(t)||(e=_.propFix[e]||e,s=_.propHooks[e]),void 0!==n?s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:t[e]=n:s&&"get"in s&&null!==(r=s.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):Ne.test(t.nodeName)||ke.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){_.propFix[this.toLowerCase()]=this})),_.fn.extend({addClass:function(t){var e,n,r,s,a,i;return v(t)?this.each((function(e){_(this).addClass(t.call(this,e,Se(this)))})):(e=Ee(t)).length?this.each((function(){if(r=Se(this),n=1===this.nodeType&&" "+_e(r)+" "){for(a=0;a-1;)n=n.replace(" "+s+" "," ");i=_e(n),r!==i&&this.setAttribute("class",i)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,s,a,i=typeof t,o="string"===i||Array.isArray(t);return v(t)?this.each((function(n){_(this).toggleClass(t.call(this,n,Se(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(n=Ee(t),this.each((function(){if(o)for(a=_(this),s=0;s-1)return!0;return!1}});var Te=/\r/g;_.fn.extend({val:function(t){var e,n,r,s=this[0];return arguments.length?(r=v(t),this.each((function(n){var s;1===this.nodeType&&(null==(s=r?t.call(this,n,_(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=_.map(s,(function(t){return null==t?"":t+""}))),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))}))):s?(e=_.valHooks[s.type]||_.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(s,"value"))?n:"string"==typeof(n=s.value)?n.replace(Te,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:_e(_.text(t))}},select:{get:function(t){var e,n,r,s=t.options,a=t.selectedIndex,i="select-one"===t.type,o=i?null:[],l=i?a+1:s.length;for(r=a<0?l:i?a:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),a}}}}),_.each(["radio","checkbox"],(function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},g.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ce=r.location,De={guid:Date.now()},Pe=/\?/;_.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||_.error("Invalid XML: "+(n?_.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Me=/^(?:focusinfocus|focusoutblur)$/,Ie=function(t){t.stopPropagation()};_.extend(_.event,{trigger:function(t,e,n,s){var a,i,o,l,c,u,d,m,p=[n||y],f=h.call(t,"type")?t.type:t,g=h.call(t,"namespace")?t.namespace.split("."):[];if(i=m=o=n=n||y,3!==n.nodeType&&8!==n.nodeType&&!Me.test(f+_.event.triggered)&&(f.indexOf(".")>-1&&(g=f.split("."),f=g.shift(),g.sort()),c=f.indexOf(":")<0&&"on"+f,(t=t[_.expando]?t:new _.Event(f,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:_.makeArray(e,[t]),d=_.event.special[f]||{},s||!d.trigger||!1!==d.trigger.apply(n,e))){if(!s&&!d.noBubble&&!b(n)){for(l=d.delegateType||f,Me.test(l+f)||(i=i.parentNode);i;i=i.parentNode)p.push(i),o=i;o===(n.ownerDocument||y)&&p.push(o.defaultView||o.parentWindow||r)}for(a=0;(i=p[a++])&&!t.isPropagationStopped();)m=i,t.type=a>1?l:d.bindType||f,(u=(ot.get(i,"events")||Object.create(null))[t.type]&&ot.get(i,"handle"))&&u.apply(i,e),(u=c&&i[c])&&u.apply&&at(i)&&(t.result=u.apply(i,e),!1===t.result&&t.preventDefault());return t.type=f,s||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),e)||!at(n)||c&&v(n[f])&&!b(n)&&((o=n[c])&&(n[c]=null),_.event.triggered=f,t.isPropagationStopped()&&m.addEventListener(f,Ie),n[f](),t.isPropagationStopped()&&m.removeEventListener(f,Ie),_.event.triggered=void 0,o&&(n[c]=o)),t.result}},simulate:function(t,e,n){var r=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(r,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each((function(){_.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}});var Oe=/\[\]$/,Le=/\r?\n/g,je=/^(?:submit|button|image|reset|file)$/i,$e=/^(?:input|select|textarea|keygen)/i;function Be(t,e,n,r){var s;if(Array.isArray(e))_.each(e,(function(e,s){n||Oe.test(t)?r(t,s):Be(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,n,r)}));else if(n||"object"!==x(e))r(t,e);else for(s in e)Be(t+"["+s+"]",e[s],n,r)}_.param=function(t,e){var n,r=[],s=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,(function(){s(this.name,this.value)}));else for(n in t)Be(n,t[n],e,s);return r.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&$e.test(this.nodeName)&&!je.test(t)&&(this.checked||!_t.test(t))})).map((function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,(function(t){return{name:e.name,value:t.replace(Le,"\r\n")}})):{name:e.name,value:n.replace(Le,"\r\n")}})).get()}});var Re=/%20/g,Fe=/#.*$/,qe=/([?&])_=[^&]*/,He=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,Ge=/^\/\//,ze={},We={},Ve="*/".concat("*"),Ke=y.createElement("a");function Ye(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,s=0,a=e.toLowerCase().match(V)||[];if(v(n))for(;r=a[s++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Qe(t,e,n,r){var s={},a=t===We;function i(o){var l;return s[o]=!0,_.each(t[o]||[],(function(t,o){var c=o(e,n,r);return"string"!=typeof c||a||s[c]?a?!(l=c):void 0:(e.dataTypes.unshift(c),i(c),!1)})),l}return i(e.dataTypes[0])||!s["*"]&&i("*")}function Xe(t,e){var n,r,s=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((s[n]?t:r||(r={}))[n]=e[n]);return r&&_.extend(!0,t,r),t}Ke.href=Ce.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Xe(Xe(t,_.ajaxSettings),e):Xe(_.ajaxSettings,t)},ajaxPrefilter:Ye(ze),ajaxTransport:Ye(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,s,a,i,o,l,c,u,d,m,h=_.ajaxSetup({},e),p=h.context||h,f=h.context&&(p.nodeType||p.jquery)?_(p):_.event,g=_.Deferred(),v=_.Callbacks("once memory"),b=h.statusCode||{},w={},A={},x="canceled",N={readyState:0,getResponseHeader:function(t){var e;if(c){if(!i)for(i={};e=He.exec(a);)i[e[1].toLowerCase()+" "]=(i[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=i[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(t,e){return null==c&&(t=A[t.toLowerCase()]=A[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)N.always(t[N.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),k(0,e),this}};if(g.promise(N),h.url=((t||h.url||Ce.href)+"").replace(Ge,Ce.protocol+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(V)||[""],null==h.crossDomain){l=y.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Ke.protocol+"//"+Ke.host!=l.protocol+"//"+l.host}catch(t){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=_.param(h.data,h.traditional)),Qe(ze,h,e,N),c)return N;for(d in(u=_.event&&h.global)&&0==_.active++&&_.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Ue.test(h.type),s=h.url.replace(Fe,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Re,"+")):(m=h.url.slice(s.length),h.data&&(h.processData||"string"==typeof h.data)&&(s+=(Pe.test(s)?"&":"?")+h.data,delete h.data),!1===h.cache&&(s=s.replace(qe,"$1"),m=(Pe.test(s)?"&":"?")+"_="+De.guid+++m),h.url=s+m),h.ifModified&&(_.lastModified[s]&&N.setRequestHeader("If-Modified-Since",_.lastModified[s]),_.etag[s]&&N.setRequestHeader("If-None-Match",_.etag[s])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&N.setRequestHeader("Content-Type",h.contentType),N.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ve+"; q=0.01":""):h.accepts["*"]),h.headers)N.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(p,N,h)||c))return N.abort();if(x="abort",v.add(h.complete),N.done(h.success),N.fail(h.error),n=Qe(We,h,e,N)){if(N.readyState=1,u&&f.trigger("ajaxSend",[N,h]),c)return N;h.async&&h.timeout>0&&(o=r.setTimeout((function(){N.abort("timeout")}),h.timeout));try{c=!1,n.send(w,k)}catch(t){if(c)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,i,l){var d,m,y,w,A,x=e;c||(c=!0,o&&r.clearTimeout(o),n=void 0,a=l||"",N.readyState=t>0?4:0,d=t>=200&&t<300||304===t,i&&(w=function(t,e,n){for(var r,s,a,i,o=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(s in o)if(o[s]&&o[s].test(r)){l.unshift(s);break}if(l[0]in n)a=l[0];else{for(s in n){if(!l[0]||t.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}if(a)return a!==l[0]&&l.unshift(a),n[a]}(h,N,i)),!d&&_.inArray("script",h.dataTypes)>-1&&_.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),w=function(t,e,n,r){var s,a,i,o,l,c={},u=t.dataTypes.slice();if(u[1])for(i in t.converters)c[i.toLowerCase()]=t.converters[i];for(a=u.shift();a;)if(t.responseFields[a]&&(n[t.responseFields[a]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=a,a=u.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(i=c[l+" "+a]||c["* "+a]))for(s in c)if((o=s.split(" "))[1]===a&&(i=c[l+" "+o[0]]||c["* "+o[0]])){!0===i?i=c[s]:!0!==c[s]&&(a=o[0],u.unshift(o[1]));break}if(!0!==i)if(i&&t.throws)e=i(e);else try{e=i(e)}catch(t){return{state:"parsererror",error:i?t:"No conversion from "+l+" to "+a}}}return{state:"success",data:e}}(h,w,N,d),d?(h.ifModified&&((A=N.getResponseHeader("Last-Modified"))&&(_.lastModified[s]=A),(A=N.getResponseHeader("etag"))&&(_.etag[s]=A)),204===t||"HEAD"===h.type?x="nocontent":304===t?x="notmodified":(x=w.state,m=w.data,d=!(y=w.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),N.status=t,N.statusText=(e||x)+"",d?g.resolveWith(p,[m,x,N]):g.rejectWith(p,[N,x,y]),N.statusCode(b),b=void 0,u&&f.trigger(d?"ajaxSuccess":"ajaxError",[N,h,d?m:y]),v.fireWith(p,[N,x]),u&&(f.trigger("ajaxComplete",[N,h]),--_.active||_.event.trigger("ajaxStop")))}return N},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],(function(t,e){_[e]=function(t,n,r,s){return v(n)&&(s=s||r,r=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:s,data:n,success:r},_.isPlainObject(t)&&t))}})),_.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),_._evalUrl=function(t,e,n){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){_.globalEval(t,e,n)}})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){_(this).wrapInner(t.call(this,e))})):this.each((function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){_(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){_(this).replaceWith(this.childNodes)})),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Je={0:200,1223:204},Ze=_.ajaxSettings.xhr();g.cors=!!Ze&&"withCredentials"in Ze,g.ajax=Ze=!!Ze,_.ajaxTransport((function(t){var e,n;if(g.cors||Ze&&!t.crossDomain)return{send:function(s,a){var i,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];for(i in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)o.setRequestHeader(i,s[i]);e=function(t){return function(){e&&(e=n=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===t?o.abort():"error"===t?"number"!=typeof o.status?a(0,"error"):a(o.status,o.statusText):a(Je[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=e(),n=o.onerror=o.ontimeout=e("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),_.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),_.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,s){e=_("