MC/website/control-panel/native-editor/js/740.78e44f80.js
2026-11-27 23:43:05 +00:00

8 lines
No EOL
16 KiB
JavaScript

(self["webpackChunkluckperms_web"]=self["webpackChunkluckperms_web"]||[]).push([[740],{5115:function(t,e,i){"use strict";i.d(e,{A:function(){return u}});var s=function(){var t=this,e=t._self._c;return e("img",{staticClass:"avatar",attrs:{src:"Hytale"===t.platform?`https://crafthead.net/hytale/helm/${t.key}/24`:`https://crafthead.net/helm/${t.key}/24`,alt:t.$t("avatar",{name:t.name}),title:t.title?t.$t("avatar",{name:t.name}):""},on:{error:t.replaceWithDefault}})},r=[],n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAA9klEQVR4nEWOvUoDQRSFv5nN7mQVsyISg0KwFgQ7K+sExEJ8AbUQDAiWWmmlIoKdPoFWYqOIheRFFGQ1oIKykCXETXZmMpAip7mXe8+fWJyPrDbgCUlP5+S5RkqJX/CwFsRCNXJjCBUUKCmJQfKXZmijh4TTvU0CPyAsluh22s5Okvx8cXH3hLg52rWhUnSzDM9TJO2E6kyZOH51ni7i/mTfrh9eslY/Y3v5EzUxzvXLFA/PB9weNxBXO6u2XJnDVxGPzabTwEZ9hdbHG+/fv4jzrZoNhCFupe41QmV2jLTTRzRqS9YYw/Rk5M6Q9XuEqug2XK9/BgqfVAJK5487AAAAAElFTkSuQmCC",a={props:{id:{required:!0},name:{required:!1},title:{type:Boolean,default:!0}},computed:{key(){return this.id.replace(/-/g,"")},platform(){var t,e,i,s,r;return(null===(t=this.$store.getters.metaData)||void 0===t?void 0:t.platform)??(null===(e=this.$store.getters.verbose)||void 0===e||null===(i=e.metadata)||void 0===i?void 0:i.platform)??(null===(s=this.$store.getters.tree)||void 0===s||null===(r=s.metadata)||void 0===r?void 0:r.platform)??"Minecraft"}},methods:{replaceWithDefault(t){t.target.src=n}}},o=a,l=i(845),h=(0,l.A)(o,s,r,!1,null,null,null),u=h.exports},5952:function(t,e,i){"use strict";i.d(e,{A:function(){return r}});var s=i(649);async function r(t,e){const{params:{id:i},query:r,hash:n}=t,a=Object.keys(r);let o;if(i)o=t.params.id;else if(a.length>0){const[t]=a;o=`?${t}`}else n&&(o=n);o&&await s.A.dispatch(e,o)}},7929:function(t,e,i){
/*!
* vue-virtual-scroll-list v2.3.4
* open source under the MIT license
* https://github.com/tangbc/vue-virtual-scroll-list#readme
*/
(function(e,s){t.exports=s(i(5471))})(0,(function(t){"use strict";function e(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function i(t){for(var i=1;i<arguments.length;i++){var s=null!=arguments[i]?arguments[i]:{};i%2?e(Object(s),!0).forEach((function(e){a(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):e(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function n(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function o(t){return l(t)||h(t)||u(t)||d()}function l(t){if(Array.isArray(t))return c(t)}function h(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t,e){if(t){if("string"===typeof t)return c(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t;var f={FRONT:"FRONT",BEHIND:"BEHIND"},p={INIT:"INIT",FIXED:"FIXED",DYNAMIC:"DYNAMIC"},g=0,y=function(){function t(e,i){s(this,t),this.init(e,i)}return n(t,[{key:"init",value:function(t,e){this.param=t,this.callUpdate=e,this.sizes=new Map,this.firstRangeTotalSize=0,this.firstRangeAverageSize=0,this.fixedSizeValue=0,this.calcType=p.INIT,this.offset=0,this.direction="",this.range=Object.create(null),t&&this.checkRange(0,t.keeps-1)}},{key:"destroy",value:function(){this.init(null,null)}},{key:"getRange",value:function(){var t=Object.create(null);return t.start=this.range.start,t.end=this.range.end,t.padFront=this.range.padFront,t.padBehind=this.range.padBehind,t}},{key:"isBehind",value:function(){return this.direction===f.BEHIND}},{key:"isFront",value:function(){return this.direction===f.FRONT}},{key:"getOffset",value:function(t){return(t<1?0:this.getIndexOffset(t))+this.param.slotHeaderSize}},{key:"updateParam",value:function(t,e){var i=this;this.param&&t in this.param&&("uniqueIds"===t&&this.sizes.forEach((function(t,s){e.includes(s)||i.sizes["delete"](s)})),this.param[t]=e)}},{key:"saveSize",value:function(t,e){this.sizes.set(t,e),this.calcType===p.INIT?(this.fixedSizeValue=e,this.calcType=p.FIXED):this.calcType===p.FIXED&&this.fixedSizeValue!==e&&(this.calcType=p.DYNAMIC,delete this.fixedSizeValue),this.calcType!==p.FIXED&&"undefined"!==typeof this.firstRangeTotalSize&&(this.sizes.size<Math.min(this.param.keeps,this.param.uniqueIds.length)?(this.firstRangeTotalSize=o(this.sizes.values()).reduce((function(t,e){return t+e}),0),this.firstRangeAverageSize=Math.round(this.firstRangeTotalSize/this.sizes.size)):delete this.firstRangeTotalSize)}},{key:"handleDataSourcesChange",value:function(){var t=this.range.start;this.isFront()?t-=g:this.isBehind()&&(t+=g),t=Math.max(t,0),this.updateRange(this.range.start,this.getEndByStart(t))}},{key:"handleSlotSizeChange",value:function(){this.handleDataSourcesChange()}},{key:"handleScroll",value:function(t){this.direction=t<this.offset||0===t?f.FRONT:f.BEHIND,this.offset=t,this.param&&(this.direction===f.FRONT?this.handleFront():this.direction===f.BEHIND&&this.handleBehind())}},{key:"handleFront",value:function(){var t=this.getScrollOvers();if(!(t>this.range.start)){var e=Math.max(t-this.param.buffer,0);this.checkRange(e,this.getEndByStart(e))}}},{key:"handleBehind",value:function(){var t=this.getScrollOvers();t<this.range.start+this.param.buffer||this.checkRange(t,this.getEndByStart(t))}},{key:"getScrollOvers",value:function(){var t=this.offset-this.param.slotHeaderSize;if(t<=0)return 0;if(this.isFixedType())return Math.floor(t/this.fixedSizeValue);var e=0,i=0,s=0,r=this.param.uniqueIds.length;while(e<=r){if(i=e+Math.floor((r-e)/2),s=this.getIndexOffset(i),s===t)return i;s<t?e=i+1:s>t&&(r=i-1)}return e>0?--e:0}},{key:"getIndexOffset",value:function(t){if(!t)return 0;for(var e=0,i=0,s=0;s<t;s++)i=this.sizes.get(this.param.uniqueIds[s]),e+="number"===typeof i?i:this.getEstimateSize();return e}},{key:"isFixedType",value:function(){return this.calcType===p.FIXED}},{key:"getLastIndex",value:function(){return this.param.uniqueIds.length-1}},{key:"checkRange",value:function(t,e){var i=this.param.keeps,s=this.param.uniqueIds.length;s<=i?(t=0,e=this.getLastIndex()):e-t<i-1&&(t=e-i+1),this.range.start!==t&&this.updateRange(t,e)}},{key:"updateRange",value:function(t,e){this.range.start=t,this.range.end=e,this.range.padFront=this.getPadFront(),this.range.padBehind=this.getPadBehind(),this.callUpdate(this.getRange())}},{key:"getEndByStart",value:function(t){var e=t+this.param.keeps-1,i=Math.min(e,this.getLastIndex());return i}},{key:"getPadFront",value:function(){return this.isFixedType()?this.fixedSizeValue*this.range.start:this.getIndexOffset(this.range.start)}},{key:"getPadBehind",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixedType()?(e-t)*this.fixedSizeValue:(e-t)*this.getEstimateSize()}},{key:"getEstimateSize",value:function(){return this.isFixedType()?this.fixedSizeValue:this.firstRangeAverageSize||this.param.estimateSize}}]),t}(),m={dataKey:{type:[String,Function],required:!0},dataSources:{type:Array,required:!0},dataComponent:{type:[Object,Function],required:!0},keeps:{type:Number,default:30},extraProps:{type:Object},estimateSize:{type:Number,default:50},direction:{type:String,default:"vertical"},start:{type:Number,default:0},offset:{type:Number,default:0},topThreshold:{type:Number,default:0},bottomThreshold:{type:Number,default:0},pageMode:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object},itemTag:{type:String,default:"div"},itemClass:{type:String,default:""},itemClassAdd:{type:Function},itemStyle:{type:Object},headerTag:{type:String,default:"div"},headerClass:{type:String,default:""},headerStyle:{type:Object},footerTag:{type:String,default:"div"},footerClass:{type:String,default:""},footerStyle:{type:Object},itemScopedSlots:{type:Object}},v={index:{type:Number},event:{type:String},tag:{type:String},horizontal:{type:Boolean},source:{type:Object},component:{type:[Object,Function]},slotComponent:{type:Function},uniqueKey:{type:[String,Number]},extraProps:{type:Object},scopedSlots:{type:Object}},S={event:{type:String},uniqueKey:{type:String},tag:{type:String},horizontal:{type:Boolean}},z={created:function(){this.shapeKey=this.horizontal?"offsetWidth":"offsetHeight"},mounted:function(){var t=this;"undefined"!==typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver((function(){t.dispatchSizeChange()})),this.resizeObserver.observe(this.$el))},updated:function(){this.resizeObserver.observe(this.$el)},beforeDestroy:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},methods:{getCurrentSize:function(){return this.$el?this.$el[this.shapeKey]:0},dispatchSizeChange:function(){this.$parent.$emit(this.event,this.uniqueKey,this.getCurrentSize(),this.hasInitial)}}},b=t.component("virtual-list-item",{mixins:[z],props:v,render:function(t){var e=this.tag,s=this.component,r=this.extraProps,n=void 0===r?{}:r,a=this.index,o=this.source,l=this.scopedSlots,h=void 0===l?{}:l,u=this.uniqueKey,c=this.slotComponent,d=i(i({},n),{},{source:o,index:a});return t(e,{key:u,attrs:{role:"listitem"}},[c?c({item:o,index:a,scope:d}):t(s,{props:d,scopedSlots:h})])}}),O=t.component("virtual-list-slot",{mixins:[z],props:S,render:function(t){var e=this.tag,i=this.uniqueKey;return t(e,{key:i,attrs:{role:i}},this.$slots["default"])}}),T={ITEM:"item_resize",SLOT:"slot_resize"},k={HEADER:"thead",FOOTER:"tfoot"},I=t.component("virtual-list",{props:m,data:function(){return{range:null}},watch:{"dataSources.length":function(){this.virtual.updateParam("uniqueIds",this.getUniqueIdFromDataSources()),this.virtual.handleDataSourcesChange()},keeps:function(t){this.virtual.updateParam("keeps",t),this.virtual.handleSlotSizeChange()},start:function(t){this.scrollToIndex(t)},offset:function(t){this.scrollToOffset(t)}},created:function(){this.isHorizontal="horizontal"===this.direction,this.directionKey=this.isHorizontal?"scrollLeft":"scrollTop",this.installVirtual(),this.$on(T.ITEM,this.onItemResized),(this.$slots.header||this.$slots.footer)&&this.$on(T.SLOT,this.onSlotResized)},activated:function(){this.scrollToOffset(this.virtual.offset),this.pageMode&&document.addEventListener("scroll",this.onScroll,{passive:!1})},deactivated:function(){this.pageMode&&document.removeEventListener("scroll",this.onScroll)},mounted:function(){this.start?this.scrollToIndex(this.start):this.offset&&this.scrollToOffset(this.offset),this.pageMode&&(this.updatePageModeFront(),document.addEventListener("scroll",this.onScroll,{passive:!1}))},beforeDestroy:function(){this.virtual.destroy(),this.pageMode&&document.removeEventListener("scroll",this.onScroll)},methods:{getSize:function(t){return this.virtual.sizes.get(t)},getSizes:function(){return this.virtual.sizes.size},getOffset:function(){if(this.pageMode)return document.documentElement[this.directionKey]||document.body[this.directionKey];var t=this.$refs.root;return t?Math.ceil(t[this.directionKey]):0},getClientSize:function(){var t=this.isHorizontal?"clientWidth":"clientHeight";if(this.pageMode)return document.documentElement[t]||document.body[t];var e=this.$refs.root;return e?Math.ceil(e[t]):0},getScrollSize:function(){var t=this.isHorizontal?"scrollWidth":"scrollHeight";if(this.pageMode)return document.documentElement[t]||document.body[t];var e=this.$refs.root;return e?Math.ceil(e[t]):0},scrollToOffset:function(t){if(this.pageMode)document.body[this.directionKey]=t,document.documentElement[this.directionKey]=t;else{var e=this.$refs.root;e&&(e[this.directionKey]=t)}},scrollToIndex:function(t){if(t>=this.dataSources.length-1)this.scrollToBottom();else{var e=this.virtual.getOffset(t);this.scrollToOffset(e)}},scrollToBottom:function(){var t=this,e=this.$refs.shepherd;if(e){var i=e[this.isHorizontal?"offsetLeft":"offsetTop"];this.scrollToOffset(i),setTimeout((function(){t.getOffset()+t.getClientSize()+1<t.getScrollSize()&&t.scrollToBottom()}),3)}},updatePageModeFront:function(){var t=this.$refs.root;if(t){var e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView,s=this.isHorizontal?e.left+i.pageXOffset:e.top+i.pageYOffset;this.virtual.updateParam("slotHeaderSize",s)}},reset:function(){this.virtual.destroy(),this.scrollToOffset(0),this.installVirtual()},installVirtual:function(){this.virtual=new y({slotHeaderSize:0,slotFooterSize:0,keeps:this.keeps,estimateSize:this.estimateSize,buffer:Math.round(this.keeps/3),uniqueIds:this.getUniqueIdFromDataSources()},this.onRangeChanged),this.range=this.virtual.getRange()},getUniqueIdFromDataSources:function(){var t=this.dataKey;return this.dataSources.map((function(e){return"function"===typeof t?t(e):e[t]}))},onItemResized:function(t,e){this.virtual.saveSize(t,e),this.$emit("resized",t,e)},onSlotResized:function(t,e,i){t===k.HEADER?this.virtual.updateParam("slotHeaderSize",e):t===k.FOOTER&&this.virtual.updateParam("slotFooterSize",e),i&&this.virtual.handleSlotSizeChange()},onRangeChanged:function(t){this.range=t},onScroll:function(t){var e=this.getOffset(),i=this.getClientSize(),s=this.getScrollSize();e<0||e+i>s+1||!s||(this.virtual.handleScroll(e),this.emitEvent(e,i,s,t))},emitEvent:function(t,e,i,s){this.$emit("scroll",s,this.virtual.getRange()),this.virtual.isFront()&&this.dataSources.length&&t-this.topThreshold<=0?this.$emit("totop"):this.virtual.isBehind()&&t+e+this.bottomThreshold>=i&&this.$emit("tobottom")},getRenderSlots:function(t){for(var e=[],i=this.range,s=i.start,r=i.end,n=this.dataSources,a=this.dataKey,o=this.itemClass,l=this.itemTag,h=this.itemStyle,u=this.isHorizontal,c=this.extraProps,d=this.dataComponent,f=this.itemScopedSlots,p=this.$scopedSlots&&this.$scopedSlots.item,g=s;g<=r;g++){var y=n[g];if(y){var m="function"===typeof a?a(y):y[a];"string"===typeof m||"number"===typeof m?e.push(t(b,{props:{index:g,tag:l,event:T.ITEM,horizontal:u,uniqueKey:m,source:y,extraProps:c,component:d,slotComponent:p,scopedSlots:f},style:h,class:"".concat(o).concat(this.itemClassAdd?" "+this.itemClassAdd(g):"")})):console.warn("Cannot get the data-key '".concat(a,"' from data-sources."))}else console.warn("Cannot get the index '".concat(g,"' from data-sources."))}return e}},render:function(t){var e=this.$slots,i=e.header,s=e.footer,r=this.range,n=r.padFront,a=r.padBehind,o=this.isHorizontal,l=this.pageMode,h=this.rootTag,u=this.wrapTag,c=this.wrapClass,d=this.wrapStyle,f=this.headerTag,p=this.headerClass,g=this.headerStyle,y=this.footerTag,m=this.footerClass,v=this.footerStyle,S={padding:o?"0px ".concat(a,"px 0px ").concat(n,"px"):"".concat(n,"px 0px ").concat(a,"px")},z=d?Object.assign({},d,S):S;return t(h,{ref:"root",on:{"&scroll":!l&&this.onScroll}},[i?t(O,{class:p,style:g,props:{tag:f,event:T.SLOT,uniqueKey:k.HEADER}},i):null,t(u,{class:c,attrs:{role:"group"},style:z},this.getRenderSlots(t)),s?t(O,{class:m,style:v,props:{tag:y,event:T.SLOT,uniqueKey:k.FOOTER}},s):null,t("div",{ref:"shepherd",style:{width:o?"0px":"100%",height:o?"100%":"0px"}})])}});return I}))}}]);
//# sourceMappingURL=740.78e44f80.js.map