import{ak as $,ar as R,s as F,al as M,b_ as f,bp as I,bd as C,au as m,az as S,aL as U,aM as V,a as h,o as u,e as A,E as T,Y as D,f as z,w as j,b as k,aN as P,B as d,F as B,r as H,C as x,W,G as q}from"./JQJBiNWj.js";import{s as G}from"./CjLYEAc3.js";import{T as Y}from"./HM4z-iuB.js";import"./DqVYbxj5.js";var J=({dt:t})=>`
.p-speeddial {
    position: static;
    display: flex;
    gap: ${t("speeddial.gap")};
}

.p-speeddial-button {
    z-index: 1;
}

.p-speeddial-button.p-speeddial-rotate {
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, background ${t("speeddial.transition.duration")}, color ${t("speeddial.transition.duration")}, border-color ${t("speeddial.transition.duration")},
    box-shadow ${t("speeddial.transition.duration")}, outline-color ${t("speeddial.transition.duration")};
    will-change: transform;
}

.p-speeddial-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: inset-block-start 0s linear ${t("speeddial.transition.duration")};
    pointer-events: none;
    outline: 0 none;
    z-index: 2;
    gap: ${t("speeddial.gap")};
}

.p-speeddial-item {
    transform: scale(0);
    opacity: 0;
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;
    will-change: transform;
}

.p-speeddial-circle .p-speeddial-item,
.p-speeddial-semi-circle .p-speeddial-item,
.p-speeddial-quarter-circle .p-speeddial-item {
    position: absolute;
}

.p-speeddial-mask {
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background: ${t("mask.background")};
    border-radius: 6px;
    transition: opacity 150ms;
}

.p-speeddial-mask-visible {
    pointer-events: none;
    opacity: 1;
    transition: opacity 150ms;
}

.p-speeddial-open .p-speeddial-list {
    pointer-events: auto;
}

.p-speeddial-open .p-speeddial-item {
    transform: scale(1);
    opacity: 1;
}

.p-speeddial-open .p-speeddial-rotate {
    transform: rotate(45deg);
}
`;function b(t){"@babel/helpers - typeof";return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(t)}function L(t,e,n){return(e=Q(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q(t){var e=X(t,"string");return b(e)=="symbol"?e:e+""}function X(t,e){if(b(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(b(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Z={root:function(e){var n=e.props;return{alignItems:(n.direction==="up"||n.direction==="down")&&"center",justifyContent:(n.direction==="left"||n.direction==="right")&&"center",flexDirection:n.direction==="up"?"column-reverse":n.direction==="down"?"column":n.direction==="left"?"row-reverse":n.direction==="right"?"row":null}},list:function(e){var n=e.props;return{flexDirection:n.direction==="up"?"column-reverse":n.direction==="down"?"column":n.direction==="left"?"row-reverse":n.direction==="right"?"row":null}}},_={root:function(e){var n=e.instance,i=e.props;return["p-speeddial p-component p-speeddial-".concat(i.type),L(L(L({},"p-speeddial-direction-".concat(i.direction),i.type!=="circle"),"p-speeddial-open",n.d_visible),"p-disabled",i.disabled)]},pcButton:function(e){var n=e.props;return["p-speeddial-button",{"p-speeddial-rotate":n.rotateAnimation&&!n.hideIcon}]},list:"p-speeddial-list",item:"p-speeddial-item",action:"p-speeddial-action",actionIcon:"p-speeddial-action-icon",mask:function(e){var n=e.instance;return["p-speeddial-mask",{"p-speeddial-mask-visible":n.d_visible}]}},ee=$.extend({name:"speeddial",style:J,classes:_,inlineStyles:Z}),te={name:"BaseSpeedDial",extends:M,props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,buttonProps:{type:Object,default:function(){return{rounded:!0}}},actionButtonProps:{type:Object,default:function(){return{severity:"secondary",rounded:!0,size:"small"}}},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:ee,provide:function(){return{$pcSpeedDial:this,$parentInstance:this}}};function y(t){"@babel/helpers - typeof";return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(t)}function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function ne(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?N(Object(n),!0).forEach(function(i){ie(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function ie(t,e,n){return(e=oe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oe(t){var e=re(t,"string");return y(e)=="symbol"?e:e+""}function re(t,e){if(y(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(y(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function O(t){return ce(t)||le(t)||se(t)||ae()}function ae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function se(t,e){if(t){if(typeof t=="string")return K(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(t,e):void 0}}function le(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ce(t){if(Array.isArray(t))return K(t)}function K(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var E=3.14159265358979,ue={name:"SpeedDial",extends:te,inheritAttrs:!1,emits:["click","show","hide","focus","blur"],documentClickListener:null,container:null,list:null,data:function(){return{d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{visible:function(e){this.d_visible=e}},mounted:function(){if(this.type!=="linear"){var e=m(this.container,'[data-pc-name="pcbutton"]'),n=m(this.list,'[data-pc-section="item"]');if(e&&n){var i=Math.abs(e.offsetWidth-n.offsetWidth),r=Math.abs(e.offsetHeight-n.offsetHeight);this.list.style.setProperty(f("item.diff.x").name,"".concat(i/2,"px")),this.list.style.setProperty(f("item.diff.y").name,"".concat(r/2,"px"))}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeUnmount:function(){this.unbindDocumentClickListener()},methods:{getPTOptions:function(e,n){return this.ptm(n,{context:{active:this.isItemActive(e),hidden:!this.d_visible}})},onFocus:function(e){this.$emit("focus",e)},onBlur:function(e){this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick:function(e,n){n.command&&n.command({originalEvent:e,item:n}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick:function(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show:function(){this.d_visible=!0,this.$emit("show")},hide:function(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay:function(e){var n=this.model.length,i=this.d_visible;return(i?e:n-e-1)*this.transitionDelay},onTogglerKeydown:function(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey();break}},onKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"NumpadEnter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break}},onTogglerArrowUp:function(e){this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown:function(e){this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey:function(e){var n=this,i=I(this.container,'[data-pc-section="item"]'),r=O(i).findIndex(function(s){return s.id===n.focusedOptionIndex}),o=m(this.container,"button");this.onItemClick(e,this.model[r]),this.onBlur(e),o&&S(o)},onEscapeKey:function(){this.hide();var e=m(this.container,"button");e&&S(e)},onArrowUp:function(e){this.direction==="down"?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown:function(e){this.direction==="down"?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft:function(e){var n=["left","up-right","down-left"],i=["right","up-left","down-right"];n.includes(this.direction)?this.navigateNextItem(e):i.includes(this.direction)?this.navigatePrevItem(e):this.navigatePrevItem(e)},onArrowRight:function(e){var n=["left","up-right","down-left"],i=["right","up-left","down-right"];n.includes(this.direction)?this.navigatePrevItem(e):i.includes(this.direction)?this.navigateNextItem(e):this.navigateNextItem(e)},onEndKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem:function(e){var n=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(n),e.preventDefault()},navigatePrevItem:function(e){var n=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(n),e.preventDefault()},changeFocusedOptionIndex:function(e){var n=I(this.container,'[data-pc-section="item"]'),i=O(n).filter(function(o){return!C(m(o,"a"),"p-disabled")});if(i[e]){this.focusedOptionIndex=i[e].getAttribute("id");var r=m(i[e],'[type="button"]');r&&S(r)}},findPrevOptionIndex:function(e){var n=I(this.container,'[data-pc-section="item"]'),i=O(n).filter(function(s){return!C(m(s,"a"),"p-disabled")}),r=e===-1?i[i.length-1].id:e,o=i.findIndex(function(s){return s.getAttribute("id")===r});return o=e===-1?i.length-1:o-1,o},findNextOptionIndex:function(e){var n=I(this.container,'[data-pc-section="item"]'),i=O(n).filter(function(s){return!C(m(s,"a"),"p-disabled")}),r=e===-1?i[0].id:e,o=i.findIndex(function(s){return s.getAttribute("id")===r});return o=e===-1?0:o+1,o},calculatePointStyle:function(e){var n=this.type;if(n!=="linear"){var i=this.model.length,r=this.radius||i*20;if(n==="circle"){var o=2*E/i;return{left:"calc(".concat(r*Math.cos(o*e),"px + ").concat(f("item.diff.x").variable,")"),top:"calc(".concat(r*Math.sin(o*e),"px + ").concat(f("item.diff.y").variable,")")}}else if(n==="semi-circle"){var s=this.direction,v=E/(i-1),a="calc(".concat(r*Math.cos(v*e),"px + ").concat(f("item.diff.x").variable,")"),l="calc(".concat(r*Math.sin(v*e),"px + ").concat(f("item.diff.y").variable,")");if(s==="up")return{left:a,bottom:l};if(s==="down")return{left:a,top:l};if(s==="left")return{right:l,top:a};if(s==="right")return{left:l,top:a}}else if(n==="quarter-circle"){var c=this.direction,p=E/(2*(i-1)),g="calc(".concat(r*Math.cos(p*e),"px + ").concat(f("item.diff.x").variable,")"),w="calc(".concat(r*Math.sin(p*e),"px + ").concat(f("item.diff.y").variable,")");if(c==="up-left")return{right:g,bottom:w};if(c==="up-right")return{left:g,bottom:w};if(c==="down-left")return{right:w,top:g};if(c==="down-right")return{left:w,top:g}}}return{}},getItemStyle:function(e){var n=this.calculateTransitionDelay(e),i=this.calculatePointStyle(e);return ne({transitionDelay:"".concat(n,"ms")},i)},bindDocumentClickListener:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(n){e.d_visible&&e.isOutsideClicked(n)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:function(e){return typeof e.visible=="function"?e.visible():e.visible!==!1},isItemActive:function(e){return e===this.focusedOptionId},containerRef:function(e){this.container=e},listRef:function(e){this.list=e}},computed:{containerClass:function(){return[this.cx("root"),this.class]},focusedOptionId:function(){return this.focusedOptionIndex!==-1?this.focusedOptionIndex:null}},components:{Button:F,PlusIcon:G},directives:{ripple:R,tooltip:Y}},de=["id"],pe=["id","data-p-active"];function fe(t,e,n,i,r,o){var s=U("Button"),v=V("tooltip");return u(),h(B,null,[A("div",d({ref:o.containerRef,class:o.containerClass,style:[t.style,t.sx("root")]},t.ptmi("root")),[D(t.$slots,"button",{visible:r.d_visible,toggleCallback:o.onClick},function(){return[z(s,d({class:[t.cx("pcButton"),t.buttonClass],disabled:t.disabled,"aria-expanded":r.d_visible,"aria-haspopup":!0,"aria-controls":t.$id+"_list","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,unstyled:t.unstyled,onClick:e[0]||(e[0]=function(a){return o.onClick(a)}),onKeydown:o.onTogglerKeydown},t.buttonProps,{pt:t.ptm("pcButton")}),{icon:j(function(a){return[D(t.$slots,"icon",{visible:r.d_visible},function(){return[r.d_visible&&t.hideIcon?(u(),k(P(t.hideIcon?"span":"PlusIcon"),d({key:0,class:[t.hideIcon,a.class]},t.ptm("pcButton").icon,{"data-pc-section":"icon"}),null,16,["class"])):(u(),k(P(t.showIcon?"span":"PlusIcon"),d({key:1,class:[r.d_visible&&t.hideIcon?t.hideIcon:t.showIcon,a.class]},t.ptm("pcButton").icon,{"data-pc-section":"icon"}),null,16,["class"]))]})]}),_:3},16,["class","disabled","aria-expanded","aria-controls","aria-label","aria-labelledby","unstyled","onKeydown","pt"])]}),A("ul",d({ref:o.listRef,id:t.$id+"_list",class:t.cx("list"),style:t.sx("list"),role:"menu",tabindex:"-1",onFocus:e[1]||(e[1]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[2]||(e[2]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),onKeydown:e[3]||(e[3]=function(){return o.onKeyDown&&o.onKeyDown.apply(o,arguments)})},t.ptm("list")),[(u(!0),h(B,null,H(t.model,function(a,l){return u(),h(B,{key:l},[o.isItemVisible(a)?(u(),h("li",d({key:0,id:"".concat(t.$id,"_").concat(l),class:t.cx("item",{id:"".concat(t.$id,"_").concat(l)}),style:o.getItemStyle(l),role:"none","data-p-active":o.isItemActive("".concat(t.$id,"_").concat(l)),ref_for:!0},o.getPTOptions("".concat(t.$id,"_").concat(l),"item")),[t.$slots.item?(u(),k(P(t.$slots.item),{key:1,item:a,onClick:function(p){return o.onItemClick(p,a)},toggleCallback:function(p){return o.onItemClick(p,a)}},null,8,["item","onClick","toggleCallback"])):x((u(),k(s,d({key:0,tabindex:-1,role:"menuitem",class:t.cx("pcAction",{item:a}),"aria-label":a.label,disabled:t.disabled,unstyled:t.unstyled,onClick:function(p){return o.onItemClick(p,a)},ref_for:!0},t.actionButtonProps,{pt:o.getPTOptions("".concat(t.$id,"_").concat(l),"pcAction")}),W({_:2},[a.icon?{name:"icon",fn:j(function(c){return[D(t.$slots,"itemicon",{item:a,class:q(c.class)},function(){return[A("span",d({class:[a.icon,c.class],ref_for:!0},o.getPTOptions("".concat(t.$id,"_").concat(l),"actionIcon")),null,16)]})]}),key:"0"}:void 0]),1040,["class","aria-label","disabled","unstyled","onClick","pt"])),[[v,{value:a.label,disabled:!t.tooltipOptions},t.tooltipOptions]])],16,pe)):T("",!0)],64)}),128))],16,de)],16),t.mask?(u(),h("div",d({key:0,class:[t.cx("mask"),t.maskClass],style:t.maskStyle},t.ptm("mask")),null,16)):T("",!0)],64)}ue.render=fe;export{ue as default};
