import{r as s,c as V,P as _n,U as Dn,I as qe,O as _,a as we,D as P,Z as nn,j as Rn,k as I,L as rn}from"./iframe-B4rglaWu.js";import{C as Kn,u as an,a as Ln,c as Tn,d as be,n as xt,l as St,h as Pt,e as Et}from"./componentbase.esm-O764U3c0.js";import{C as jt}from"./index.esm-Dh1FCB31.js";import{C as kt,O as wt}from"./overlayservice.esm-C5VFRSbT.js";import{P as Ct}from"./portal.esm-9O3HNf5A.js";import{I as Nt}from"./iconbase.esm-CeJUwaxq.js";import{R as Ot}from"./ripple.esm-Bd7Vm0vw.js";import"./preload-helper-PPVm8Dsz.js";function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ce.apply(null,arguments)}function Ne(e){"@babel/helpers - typeof";return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ne(e)}function Mt(e,n){if(Ne(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var i=t.call(e,n);if(Ne(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function _t(e){var n=Mt(e,"string");return Ne(n)=="symbol"?n:n+""}function Dt(e,n,t){return(n=_t(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Rt(e){if(Array.isArray(e))return e}function Kt(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var i,a,x,S,v=[],E=!0,j=!1;try{if(x=(t=t.call(e)).next,n!==0)for(;!(E=(i=x.call(t)).done)&&(v.push(i.value),v.length!==n);E=!0);}catch(h){j=!0,a=h}finally{try{if(!E&&t.return!=null&&(S=t.return(),Object(S)!==S))return}finally{if(j)throw a}}return v}}function jn(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}function Lt(e,n){if(e){if(typeof e=="string")return jn(e,n);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?jn(e,n):void 0}}function Tt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(e,n){return Rt(e)||Kt(e,n)||Lt(e,n)||Tt()}var $t={icon:"p-menuitem-icon",action:"p-menuitem-link",label:"p-menuitem-text",home:function(n){var t=n._className,i=n.disabled;return V("p-breadcrumb-home p-menuitem",{"p-disabled":i},t)},separatorIcon:"p-breadcrumb-chevron",separator:"p-menuitem-separator",menuitem:function(n){var t=n.item;return V("p-menuitem",t.className,{"p-disabled":t.disabled})},menu:"p-breadcrumb-list",root:"p-breadcrumb p-component"},Bt=`
@layer primereact {
    .p-breadcrumb {
        overflow-x: auto;
        display: flex;
    }

    .p-breadcrumb ol {
        margin: 0;
        padding: 0;
        list-style-type: none;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .p-breadcrumb .p-menuitem-text {
        line-height: 1;
    }

    .p-breadcrumb .p-menuitem-link {
        text-decoration: none;
        display: flex;
        align-items: center;
    }

    .p-breadcrumb .p-menuitem-separator {
        display: flex;
        align-items: center;
    }

    .p-breadcrumb::-webkit-scrollbar {
        display: none;
    }
}
`,Be=Kn.extend({defaultProps:{__TYPE:"BreadCrumb",id:null,model:null,home:null,separatorIcon:null,style:null,className:null,children:void 0},css:{classes:$t,styles:Bt}});function kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function wn(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?kn(Object(t),!0).forEach(function(i){Dt(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):kn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var An=s.memo(s.forwardRef(function(e,n){var t=an(),i=s.useContext(_n),a=Be.getProps(e,i),x=s.useState(a.id),S=At(x,2),v=S[0],E=S[1],j=s.useRef(null),h=Be.setMetaData({props:a,state:{id:v}}),b=h.ptm,g=h.cx,k=h.isUnstyled;Ln(Be.css.styles,k,{name:"breadcrumb"});var A=function(m,c){if(c.disabled){m.preventDefault();return}c.command&&c.command({originalEvent:m,item:c}),c.url||(m.preventDefault(),m.stopPropagation())},N=function(m){var c=typeof window<"u"?window.location.pathname:"";return m===c?"page":void 0},$=function(){var m=a.home;if(m){if(m.visible===!1)return null;var c=m.icon,p=m.target,o=m.url,f=m.disabled,y=m.style,D=m.className,L=m.template,R=m.label,z=t({className:g("icon")},b("icon")),F=qe.getJSXIcon(c,wn({},z),{props:a}),ue=t({href:o||"#",className:g("action"),"aria-disabled":f,"aria-current":N(o),target:p,onClick:function(re){return A(re,m)}},b("action")),Q=t({className:g("label")},b("label")),w=R&&s.createElement("span",Q,R),H=s.createElement("a",ue,F,w);if(L){var ee={onClick:function(re){return A(re,m)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",element:H,props:a};H=_.getJSXElement(L,m,ee)}var ne=v+"_home",se=t({id:ne,className:g("home",{_className:D,disabled:f}),style:y},b("home"));return s.createElement("li",Ce({},se,{key:ne}),H)}return null},G=function(m){var c=v+"_sep_"+m,p=t({className:g("separatorIcon"),"aria-hidden":"true"},b("separatorIcon")),o=a.separatorIcon||s.createElement(jt,p),f=qe.getJSXIcon(o,wn({},p),{props:a}),y=t({id:c,className:g("separator"),role:"separator"},b("separator"));return s.createElement("li",Ce({},y,{key:c}),f)},oe=function(m,c){if(m.visible===!1)return null;var p=t({className:g("label")},b("label")),o=m.label&&s.createElement("span",p,m.label),f=t({href:m.url||"#",className:g("action"),target:m.target,"aria-current":N(m.url),onClick:function(F){return A(F,m)},"aria-disabled":m.disabled,tabIndex:m.disabled?-1:void 0},b("action")),y=s.createElement("a",f,o);if(m.template){var D={onClick:function(F){return A(F,m)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",element:y,props:a};y=_.getJSXElement(m.template,m,D)}var L=m.id||v+"_"+c,R=t({id:L,className:g("menuitem",{item:m}),style:m.style},b("menuitem"));return s.createElement("li",Ce({},R,{key:L}),y)},ye=function(){if(a.model){var m=a.model.map(function(c,p){if(c.visible===!1)return null;var o=oe(c,p),f=p===a.model.length-1?null:G(p),y=v+"_"+p;return s.createElement(s.Fragment,{key:y},o,f)});return m}return null};Tn(function(){v||E(Dn())}),s.useImperativeHandle(n,function(){return{props:a,getElement:function(){return j.current}}});var Y=$(),q=ye(),le=G("home"),X=t({className:g("menu")},b("menu")),ge=t({id:a.id,ref:j,className:V(a.className,g("root")),style:a.style},Be.getOtherProps(a),b("root"));return s.createElement("nav",ge,s.createElement("ol",X,Y,Y&&!!(q!=null&&q.length)&&le,q))}));An.displayName="BreadCrumb";function tn(){return tn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},tn.apply(null,arguments)}var $n=s.memo(s.forwardRef(function(e,n){var t=Nt.getPTI(e);return s.createElement("svg",tn({ref:n,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),s.createElement("path",{d:"M5.25 11.1728C5.14929 11.1694 5.05033 11.1455 4.9592 11.1025C4.86806 11.0595 4.78666 10.9984 4.72 10.9228C4.57955 10.7822 4.50066 10.5916 4.50066 10.3928C4.50066 10.1941 4.57955 10.0035 4.72 9.86283L7.72 6.86283L4.72 3.86283C4.66067 3.71882 4.64765 3.55991 4.68275 3.40816C4.71785 3.25642 4.79932 3.11936 4.91585 3.01602C5.03238 2.91268 5.17819 2.84819 5.33305 2.83149C5.4879 2.81479 5.64411 2.84671 5.78 2.92283L9.28 6.42283C9.42045 6.56346 9.49934 6.75408 9.49934 6.95283C9.49934 7.15158 9.42045 7.34221 9.28 7.48283L5.78 10.9228C5.71333 10.9984 5.63193 11.0595 5.5408 11.1025C5.44966 11.1455 5.35071 11.1694 5.25 11.1728Z",fill:"currentColor"}))}));$n.displayName="AngleRightIcon";function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Oe.apply(null,arguments)}function Me(e){"@babel/helpers - typeof";return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Me(e)}function Ft(e,n){if(Me(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var i=t.call(e,n);if(Me(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ht(e){var n=Ft(e,"string");return Me(n)=="symbol"?n:n+""}function Bn(e,n,t){return(n=Ht(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ut(e){if(Array.isArray(e))return e}function Wt(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var i,a,x,S,v=[],E=!0,j=!1;try{if(x=(t=t.call(e)).next,n!==0)for(;!(E=(i=x.call(t)).done)&&(v.push(i.value),v.length!==n);E=!0);}catch(h){j=!0,a=h}finally{try{if(!E&&t.return!=null&&(S=t.return(),Object(S)!==S))return}finally{if(j)throw a}}return v}}function Cn(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}function Vt(e,n){if(e){if(typeof e=="string")return Cn(e,n);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cn(e,n):void 0}}function zt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(e,n){return Ut(e)||Wt(e,n)||Vt(e,n)||zt()}var Zt={root:function(n){var t=n.props,i=n.context;return V("p-tieredmenu p-component",{"p-tieredmenu-overlay":t.popup,"p-input-filled":i&&i.inputStyle==="filled"||we.inputStyle==="filled","p-ripple-disabled":i&&i.ripple===!1||we.ripple===!1})},separator:"p-menuitem-separator",icon:function(n){var t=n._icon;return V("p-menuitem-icon",t)},content:"p-menuitem-content",label:"p-menuitem-text",submenuIcon:"p-submenu-icon",action:"p-menuitem-link",menuitem:function(n){var t=n.itemClassName,i=n.active,a=n.focused,x=n.disabled;return V("p-menuitem",{"p-menuitem-active p-highlight":i,"p-focus":a,"p-disabled":x},t)},menu:"p-tieredmenu-root-list",submenu:"p-submenu-list",transition:"p-connected-overlay"},qt={submenu:function(n){var t=n.subProps;return{display:!t.root&&t.parentActive?"block":"none"}}},Xt=`
@layer primereact {
    .p-tieredmenu-overlay {
        position: absolute;
    }

    .p-tieredmenu ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .p-tieredmenu .p-submenu-list {
        position: absolute;
        min-width: 100%;
        z-index: 1;
        display: none;
    }

    .p-tieredmenu .p-menuitem-link {
        cursor: pointer;
        display: flex;
        align-items: center;
        text-decoration: none;
        overflow: hidden;
        position: relative;
    }

    .p-tieredmenu .p-menuitem-text {
        line-height: 1;
    }

    .p-tieredmenu .p-menuitem {
        position: relative;
    }

    .p-tieredmenu .p-menuitem-link .p-submenu-icon {
        margin-left: auto;
    }

    .p-tieredmenu .p-menuitem-active > .p-submenu-list {
        display: block;
        left: 100%;
        top: 0;
    }

    .p-tieredmenu .p-menuitem-active > .p-submenu-list-flipped {
        left: -100%;
    }
}
`,Fe=Kn.extend({defaultProps:{__TYPE:"TieredMenu",__parentMetadata:null,id:null,model:null,popup:!1,style:null,className:null,autoZIndex:!0,baseZIndex:0,breakpoint:void 0,scrollHeight:"400px",appendTo:null,transitionOptions:null,onShow:null,onFocus:null,onBlur:null,onHide:null,submenuIcon:null,children:void 0},css:{classes:Zt,styles:Xt,inlineStyles:qt}});function Nn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function On(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Nn(Object(t),!0).forEach(function(i){Bn(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Nn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var on=s.memo(s.forwardRef(function(e,n){var t=s.useRef(null),i=an(),a=e.ptm,x=e.cx,S=e.sx,v=function(o,f){return a(f,{hostName:e.hostName,context:{active:g(o)}})},E=function(){if(t.current){var o=t.current.parentElement,f=P.getOffset(o),y=P.getViewport(),D=t.current.offsetParent?t.current.offsetWidth:P.getHiddenElementOuterWidth(t.current),L=P.getOuterWidth(o.children[0]),R=parseInt(f.top,10)+t.current.offsetHeight-P.getWindowScrollTop();R>y.height?t.current.style.top=y.height-R+"px":t.current.style.top="0px",parseInt(f.left,10)+L+D>y.width-P.calculateScrollbarWidth()&&P.addClass(t.current,"p-submenu-list-flipped")}},j=function(o,f){var y=f.item;if(A(f)){o.preventDefault();return}y.command&&y.command({originalEvent:o,item:y}),e.onItemClick&&e.onItemClick({originalEvent:o,processedItem:f}),y.url||(o.preventDefault(),o.stopPropagation())},h=function(o){return o.item&&o.item.id?o.item.id:"".concat(e.menuId,"_").concat(o.key)},b=function(o,f,y){return o&&o.item?_.getItemValue(o.item[f],y):void 0},g=function(o){return e.activeItemPath.some(function(f){return f.key===o.key})},k=function(o){return b(o,"visible")!==!1},A=function(o){return b(o,"disabled")},N=function(o){return e.focusedItemId===h(o)},$=function(o){return _.isNotEmpty(o.items)},G=function(o,f){e.onItemMouseEnter&&e.onItemMouseEnter({originalEvent:o,processedItem:f})},oe=function(){return e.model.filter(function(o){return k(o)&&!b(o,"separator")}).length},ye=function(o){return o-e.model.slice(0,o).filter(function(f){return k(f)&&b(f,"separator")}).length+1};be(function(){!e.root&&e.parentActive&&!e.isMobileMode&&E()},[e.parentActive]),s.useImperativeHandle(n,function(){return{getElement:function(){return t.current}}});var Y=function(o){var f="separator_"+o,y=i({className:x("separator"),role:"separator"},a("separator",{hostName:e.hostName}));return s.createElement("li",Oe({},y,{key:f}))},q=function(o,f){return $(o)?s.createElement(on,{id:e.id+"_"+f,menuProps:e.menuProps,model:o.items,menuId:e.menuId,ariaLabelledby:h(o),focusedItemId:e.focusedItemId,activeItemPath:e.activeItemPath,level:e.level+1,onItemClick:e.onItemClick,popup:e.popup,onItemMouseEnter:e.onItemMouseEnter,parentActive:g(o),isMobileMode:e.isMobileMode,submenuIcon:e.submenuIcon,ptm:e.ptm,cx:x,sx:S}):null},le=function(o,f){if(k(o)===!1)return null;var y=o.item,D=b(o,"style"),L=b(o,"className"),R=b(o,"icon"),z=b(o,"target"),F=b(o,"url"),ue=h(o),Q=N(o),w=g(o),H=A(o),ee=$(o),ne=V("p-menuitem-link"),se=V("p-menuitem-icon",R),te=i({className:V(y.icon,"p-menuitem-icon","icon")},v(o,"icon")),re=qe.getJSXIcon(R,On({},te),{props:e.menuProps}),_e=i({className:x("label")},v(o,"label")),U=y.label&&s.createElement("span",_e,y.label),Xe="p-submenu-icon",De=i({className:x("submenuIcon")},v(o,"submenuIcon")),ce=ee&&qe.getJSXIcon(e.submenuIcon||s.createElement($n,De),On({},De),{props:e.menuProps}),he=q(o,f),Ie=i({href:F||"#",tabIndex:"-1",onFocus:function(W){return W.stopPropagation()},className:x("action"),target:z},v(o,"action")),xe=s.createElement("a",Ie,re,U,ce,s.createElement(Ot,null));if(y.template){var Je={className:ne,labelClassName:"p-menuitem-text",iconClassName:se,submenuIconClassName:Xe,element:xe,props:e,active:w,disabled:H};xe=_.getJSXElement(y.template,y,Je)}var O=i({onClick:function(W){return j(W,o)},onMouseEnter:function(W){return G(W,o)},className:x("content")},v(o,"content")),Se=i({id:ue,"aria-label":y.label,"aria-disabled":H,"aria-expanded":ee?w:void 0,"aria-haspopup":ee&&!F?"menu":void 0,"aria-setsize":oe(),"aria-posinset":ye(f),"data-p-highlight":w,"data-p-disabled":H,"data-p-visited":Q,className:x("menuitem",{itemClassName:L,active:w,focused:Q,disabled:H}),style:D,onMouseEnter:function(W){return G(W,y)},role:"menuitem"},v(o,"menuitem"));return s.createElement("li",Oe({},Se,{key:ue}),s.createElement("div",O,xe),he)},X=function(o,f){return o.visible===!1?null:b(o,"separator")?Y(f):le(o,f)},ge=function(){return e.model?e.model.map(X):null},B=ge(),m=e.root?"menu":"submenu",c=i({ref:t,id:e.id,tabIndex:e.tabIndex,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:e.onKeyDown,className:x(m,{subProps:e}),style:S(m,{subProps:e}),role:e.root?"menubar":"menu","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-orientation":e.ariaOrientation,"aria-activedescendant":e.focusedItemId},a(m,{hostName:e.hostName}));return s.createElement("ul",c,B)}));on.displayName="TieredMenuSub";function Mn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function ve(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Mn(Object(t),!0).forEach(function(i){Bn(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var Fn=s.memo(s.forwardRef(function(e,n){var t=an(),i=s.useContext(_n),a=Fe.getProps(e,i),x=s.useState(a.id),S=K(x,2),v=S[0],E=S[1],j=s.useState(!a.popup),h=K(j,2),b=h[0],g=h[1],k=s.useState([]),A=K(k,2),N=A[0],$=A[1],G=s.useState(!1),oe=K(G,2),ye=oe[0],Y=oe[1],q=s.useState(null),le=K(q,2),X=le[0],ge=le[1],B=s.useState({index:-1,level:0,parentKey:""}),m=K(B,2),c=m[0],p=m[1],o=s.useState(!1),f=K(o,2),y=f[0],D=f[1],L=s.useState([]),R=K(L,2),z=R[0],F=R[1],ue=s.useState([]),Q=K(ue,2),w=Q[0],H=Q[1],ee=s.useState(!1),ne=K(ee,2),se=ne[0],te=ne[1],re=s.useState(null),_e=K(re,2),U=_e[0],Xe=_e[1],De=ve(ve({props:a},a.__parentMetadata),{},{state:{id:v,visible:b,attributeSelector:U}}),ce=Fe.setMetaData(De),he=ce.ptm,Ie=ce.cx,xe=ce.sx,Je=ce.isUnstyled;Ln(Fe.css.styles,Je,{name:"tieredmenu"});var O=s.useRef(null),Se=s.useRef(null),M=s.useRef(null),W=s.useRef(null),Pe=s.useRef(null),ae=s.useRef(null),Re=s.useRef(null),ln=xt("screen and (max-width: ".concat(a.breakpoint,")"),!!a.breakpoint),Un=St({type:"click",listener:function(r){var l=O.current&&!O.current.contains(r.target),d=a.popup?!(M.current&&(M.current===r.target||M.current.contains(r.target))):!0;l&&d&&Z(r,!a.popup)}}),un=K(Un,2),sn=un[0],cn=un[1],Wn=Pt({listener:function(){!ln&&Z(event,!0)}}),mn=K(Wn,2),dn=mn[0],pn=mn[1],Vn=function(r){a.popup&&wt.emit("overlay-click",{originalEvent:r,target:M.current})},zn=function(r){a.popup&&(b?Z(r):fn(r))},fn=function(r){a.popup&&(M.current=r.currentTarget,g(!0),a.onShow&&a.onShow(r),W.current=r.relatedTarget||null),p({index:de(),level:0,parentKey:""})},Z=function(r,l){a.popup&&(g(!1),a.onHide&&a.onHide(r));var d=je();$([]),p({index:-1,level:0,parentKey:""}),l&&P.focus(W.current||M.current||d),D(!1)},Zn=function(r){Y(!0),p(c.index!==-1?c:{index:de(),level:0,parentKey:""}),a.onFocus&&a.onFocus(r)},qn=function(r){Y(!1),p({index:-1,level:0,parentKey:""}),ae.current="",D(!1),a.onBlur&&a.onBlur(r)},Xn=function(r){var l=r.metaKey||r.ctrlKey;switch(r.code){case"ArrowDown":Yn(r);break;case"ArrowUp":Qn(r);break;case"ArrowLeft":et(r);break;case"ArrowRight":nt(r);break;case"Home":tt(r);break;case"End":rt(r);break;case"Space":at(r);break;case"Enter":case"NumpadEnter":vn(r);break;case"Escape":a.popup&&P.focus(M.current),it(r);break;case"Tab":ot(r);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!l&&_.isPrintableCharacter(r.key)&&pt(r.key);break}},Ee=function(r){var l=r.processedItem,d=r.isFocus;if(!_.isEmpty(l)){var C=l.index,T=l.key,fe=l.level,J=l.parentKey,ie=l.items,ke=_.isNotEmpty(ie),Le=N.filter(function(Te){return Te.parentKey!==J&&Te.parentKey!==T});ke&&Le.push(l),p({index:C,level:fe,parentKey:J}),$(Le),ke&&D(!0),d&&P.focus(je())}},Jn=function(r){var l=r.originalEvent,d=r.processedItem;if(!(Ye(d)||a.isMobileMode)){var C=Ke(d),T=_.isEmpty(d.parent),fe=bn(d),J=je();if(fe){var ie=d.index,ke=d.key,Le=d.level,Te=d.parentKey;$(N.filter(function($e){return ke!==$e.key&&ke.startsWith($e.key)})),p({index:ie,level:Le,parentKey:Te}),C||D(!T),setTimeout(function(){P.focus(J),C&&D(!0)},0)}else if(C)P.focus(J),Ee(r);else{var Ae=T?d:N.find(function($e){return $e.parentKey===""}),It=Ae?Ae.index:-1;Z(l,!0),p({index:It,parentKey:Ae?Ae.parentKey:""})}}},Gn=function(r){var l=r.originalEvent,d=r.processedItem;if(Ye(d)||a.isMobileMode){l.preventDefault();return}y&&!a.popup&&Ee(r)},Yn=function(r){var l=c.index!==-1?hn(c.index):de();pe(l),r.preventDefault()},Qn=function(r){if(r.altKey){if(a.popup&&P.focus(M.current),c.index!==-1){var l=w[c.index],d=Ke(l);!d&&Ee({processedItem:l})}a.popup&&Z(r,!0),r.preventDefault()}else{var C=c.index!==-1?mt(c.index):dt();pe(C),r.preventDefault()}},et=function(r){var l=w[c.index],d=N.find(function(T){return T.key===l.parentKey}),C=_.isEmpty(l.parent);C||(p({index:-1,parentKey:d?d.parentKey:""}),ae.current="",setTimeout(function(){return te(!0)},0)),$(N.filter(function(T){return T.parentKey!==c.parentKey})),r.preventDefault()},nt=function(r){var l=w[c.index],d=Ke(l);d&&(Ee({processedItem:l}),p({index:-1,parentKey:l.key}),ae.current="",setTimeout(function(){return te(!0)},0)),r.preventDefault()},tt=function(r){pe(yn()),r.preventDefault()},rt=function(r){pe(gn()),r.preventDefault()},vn=function(r){if(c.index!==-1){var l=P.findSingle(je(),'li[id="'.concat("".concat(X),'"]')),d=l&&P.findSingle(l,'[data-pc-section="action"]');a.popup&&P.focus(M.current),d?d.click():l&&l.click()}r.preventDefault()},at=function(r){vn(r)},it=function(r){Z(r,!0),!a.popup&&p(ve(ve({},c),{},{index:de()})),r.preventDefault()},ot=function(r){if(c.index!==-1){var l=w[c.index],d=Ke(l);!d&&Ee({processedItem:l})}Z(r)},je=function(){return Se.current.getElement()||null},Ge=function(r,l){return r?_.getItemValue(r[l]):void 0},lt=function(r){return Ge(r,"label")},Ye=function(r){return Ge(r,"disabled")},ut=function(r){return Ge(r,"separator")},st=function(r){return r?lt(r.item):void 0},Ke=function(r){return r&&_.isNotEmpty(r.items)},Qe=function(r){return me(r)&&st(r).toLocaleLowerCase().startsWith(ae.current.toLocaleLowerCase())},me=function(r){return!!r&&!Ye(r.item)&&!ut(r.item)},ct=function(r){return me(r)&&bn(r)},bn=function(r){return N.some(function(l){return l.key===r.key})},yn=function(){return w.findIndex(function(r){return me(r)})},gn=function(){return _.findLastIndex(w,function(r){return me(r)})},hn=function(r){var l=r<w.length-1?w.slice(r+1).findIndex(function(d){return me(d)}):-1;return l>-1?l+r+1:r},mt=function(r){var l=r>0?_.findLastIndex(w.slice(0,r),function(d){return me(d)}):-1;return l>-1?l:r},In=function(){return w.findIndex(function(r){return ct(r)})},de=function(){var r=In();return r<0?yn():r},dt=function(){var r=In();return r<0?gn():r},pt=function(r){ae.current=(ae.current||"")+r;var l=-1,d=!1;return c.index!==-1?(l=w.slice(c.index).findIndex(function(C){return Qe(C)}),l=l===-1?w.slice(0,c.index).findIndex(function(C){return Qe(C)}):l+c.index):l=w.findIndex(function(C){return Qe(C)}),l!==-1&&(d=!0),l===-1&&c.index===-1&&(l=de()),l!==-1&&pe(l),Re.current&&clearTimeout(Re),Re.current=setTimeout(function(){ae.current="",Re.current=null},500),d},pe=function(r){c.index!==r&&(p(ve(ve({},c),{},{index:r})),xn())},xn=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,l=r!==-1?"".concat(v,"_").concat(r):X,d=P.findSingle(je(),'li[id="'.concat(l,'"]'));d&&d.scrollIntoView&&d.scrollIntoView({block:"nearest",inline:"start"})},en=s.useCallback(function(u){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",C=[];return u&&u.forEach(function(T,fe){var J=(d!==""?d+"_":"")+fe,ie={item:T,index:fe,level:r,key:J,parent:l,parentKey:d};ie.items=en(T.items,r+1,ie,J),C.push(ie)}),C},[]),Sn=function(){if(!Pe.current){Pe.current=P.createInlineStyle(i&&i.nonce||we.nonce,i&&i.styleContainer);var r="".concat(U),l=`
@media screen and (max-width: `.concat(a.breakpoint,`) {
    .p-tieredmenu[`).concat(r,`] > ul {
        max-height: `).concat(a.scrollHeight,`;
        overflow: `).concat(a.scrollHeight?"auto":"",`;
    }

    .p-tieredmenu[`).concat(r,`] .p-submenu-list {
        position: relative;
    }

    .p-tieredmenu[`).concat(r,`] .p-menuitem-active > .p-submenu-list {
        left: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0 0 0 calc(var(--inline-spacing) * 2); /* @todo */
    }

    .p-tieredmenu[`).concat(r,`] .p-menuitem-active > .p-menuitem-link > .p-submenu-icon {
        transform: rotate(-180deg);
    }

    .p-tieredmenu[`).concat(r,`] .p-submenu-icon:before {
        content: "\\e930";
    }

    `).concat(a.popup?"":".p-tieredmenu[".concat(r,"] { width: 100%; }"),`
}
`);Pe.current.innerHTML=l}},Pn=function(){Pe.current=P.removeInlineStyle(Pe.current)},ft=function(){var r=P.getOuterWidth(M.current)>P.getOuterWidth(O.current);P.alignOverlay(O.current,M.current,a.appendTo,r)},vt=function(){a.autoZIndex&&nn.set("menu",O.current,i&&i.autoZIndex||we.autoZIndex,a.baseZIndex||i&&i.zIndex.menu||we.zIndex.menu),P.addStyles(O.current,{position:"absolute",top:"0",left:"0"}),ft(),P.focus(Se.current.getElement()),xn(),U&&a.breakpoint&&(O.current.setAttribute(U,""),Sn())},bt=function(){sn(),dn()},yt=function(){M.current=null,cn(),pn()},gt=function(){nn.clear(O.current),Pn()};Tn(function(){var u=Dn();!v&&E(u),a.breakpoint&&!U&&Xe(u)}),s.useEffect(function(){var u=a.model||[],r=en(u);F(r)},[a.model,en]),be(function(){var u=N.find(function(l){return l.key===c.parentKey}),r=u?u.items:z;H(r)},[N,c,z]),be(function(){var u=c.index!==-1?"".concat(v).concat(_.isNotEmpty(c.parentKey)?"_"+c.parentKey:"","_").concat(c.index):null;ge(u)},[c]),be(function(){a.popup||(_.isNotEmpty(N)?(sn(),dn()):(cn(),pn()))},[N]),be(function(){if(se){var u=c.index!==-1?hn(c.index):de();pe(u),$(N.filter(function(r){return r.parentKey!==c.parentKey})),te(!1)}},[se]),be(function(){return U&&O.current&&(O.current.setAttribute(U,""),Sn()),function(){Pn()}},[U,a.breakpoint]),Et(function(){nn.clear(O.current)}),s.useImperativeHandle(n,function(){return{props:a,toggle:zn,show:fn,hide:Z,getElement:function(){return O.current}}});var ht=function(){var r=t({ref:O,id:a.id,className:V(a.className,Ie("root")),style:a.style,onClick:Vn},Fe.getOtherProps(a),he("root")),l=t({classNames:Ie("transition"),in:b,timeout:{enter:120,exit:100},options:a.transitionOptions,unmountOnExit:!0,onEnter:vt,onEntered:bt,onExit:yt,onExited:gt},he("transition"));return s.createElement(kt,Oe({nodeRef:O},l),s.createElement("div",r,s.createElement(on,{id:v+"_list",ref:Se,hostName:"TieredMenu",menuProps:a,tabIndex:0,model:z,ariaLabel:a.ariaLabel,ariaLabelledBy:a.ariaLabelledBy,ariaOrientation:"vertical",ariaActiveDescendant:ye?X:void 0,menuId:v,level:0,focusedItemId:X,activeItemPath:N,onFocus:Zn,onBlur:qn,onKeyDown:Xn,onItemClick:Jn,onItemMouseEnter:Gn,root:!0,popup:a.popup,onHide:Z,isMobileMode:ln,submenuIcon:a.submenuIcon,ptm:he,cx:Ie,sx:xe})))},En=ht();return a.popup?s.createElement(Ct,{element:En,appendTo:a.appendTo}):En}));Fn.displayName="TieredMenu";const Hn=e=>{const n=Rn.c(11),{model:t,home:i,chevronLeft:a}=e,x=a===void 0?!0:a;let S;n[0]===Symbol.for("react.memo_cache_sentinel")?(S={icon:"pi pi-home",to:"/",template:Gt},n[0]=S):S=n[0];const v=S;let E;n[1]!==t?(E=t?.map(Yt),n[1]=t,n[2]=E):E=n[2];const j=E;let h;n[3]!==x?(h=x&&I.jsx("span",{children:I.jsx("i",{className:"pi pi-chevron-right opacity-[0.55] pt-1.5 text-[0.95rem]!"})}),n[3]=x,n[4]=h):h=n[4];const b=i?v:void 0;let g;n[5]!==j||n[6]!==b?(g=I.jsx(An,{model:j,home:b}),n[5]=j,n[6]=b,n[7]=g):g=n[7];let k;return n[8]!==h||n[9]!==g?(k=I.jsxs("div",{className:"flex items-center",children:[h,g]}),n[8]=h,n[9]=g,n[10]=k):k=n[10],k};function Jt(e){const n=Rn.c(16),{item:t}=e,i=s.useRef(null);let a;n[0]!==t.icon||n[1]!==t.items?(a=t.items?.map(k=>({...k,template:k.url?()=>I.jsxs(rn,{to:k.url,className:"p-menuitem-link space-x-2",children:[t.icon&&I.jsx("span",{className:"p-menuitem-icon",children:I.jsx("i",{className:k.icon})}),I.jsx("span",{className:"p-menuitem-text",children:k.label})]}):void 0})),n[0]=t.icon,n[1]=t.items,n[2]=a):a=n[2];const S=a;let v;n[3]!==S?(v=I.jsx(Fn,{model:S,popup:!0,ref:i}),n[3]=S,n[4]=v):v=n[4];let E;n[5]===Symbol.for("react.memo_cache_sentinel")?(E=k=>i.current?.toggle(k),n[5]=E):E=n[5];let j;n[6]!==t.icon?(j=t.icon&&I.jsx("span",{className:"p-menuitem-icon",children:I.jsx("i",{className:t.icon})}),n[6]=t.icon,n[7]=j):j=n[7];let h;n[8]!==t.label?(h=I.jsx("span",{className:"p-menuitem-text",children:t.label}),n[8]=t.label,n[9]=h):h=n[9];let b;n[10]!==j||n[11]!==h?(b=I.jsxs("a",{className:"p-menuitem-link space-x-2",onClick:E,children:[j,h]}),n[10]=j,n[11]=h,n[12]=b):b=n[12];let g;return n[13]!==v||n[14]!==b?(g=I.jsxs(I.Fragment,{children:[v,b]}),n[13]=v,n[14]=b,n[15]=g):g=n[15],g}Hn.__docgenInfo={description:`Componente de breadcrumb baseado no \`BreadCrumb\` do PrimeReact com suporte a navegação
via TanStack Router e sub-menus em popup (\`TieredMenu\`).

Cada item do breadcrumb pode ser:
- **Link**: quando \`to\` é informado, renderiza um \`<Link>\` navegável.
- **Texto estático**: quando \`to\` não é informado e não há sub-itens.
- **Menu dropdown**: quando \`items\` é informado, abre um \`TieredMenu\` popup ao clicar.

@example
\`\`\`tsx
<UiBreadCrumb
  home
  model={[
    { label: 'Projetos', to: '/projetos', icon: 'pi pi-folder' },
    { label: 'Meu Projeto', items: [
      { label: 'Editar', url: '/projetos/1/editar', icon: 'pi pi-pencil' },
      { label: 'Excluir', command: () => handleDelete() },
    ]},
    { label: 'Detalhes' },
  ]}
/>
\`\`\``,methods:[],displayName:"UiBreadCrumb",props:{model:{required:!1,tsType:{name:"Array",elements:[{name:"BreadCrumbMenuItem"}],raw:"Array<BreadCrumbMenuItem>"},description:`Uma array de \`BreadCrumbMenuItem\`.

@example
\`\`\`TSX
model={[
    { label: 'Projetos', to: '/projetos', icon: 'pi pi-folder' },
    { label: 'Meu Projeto', items: [
      { label: 'Editar', url: '/projetos/1/editar', icon: 'pi pi-pencil' },
      { label: 'Excluir', command: () => handleDelete() },
    ]},
    { label: 'Detalhes' },
  ]}
\`\`\``},home:{required:!1,tsType:{name:"boolean"},description:"Se `true`, exibe o ícone de home como primeiro item com link para `/`."},chevronLeft:{required:!1,tsType:{name:"boolean"},description:"Se `true`, exibe um icone chevron antes do breadcrumb.",defaultValue:{value:"true",computed:!1}}}};function Gt(){return I.jsx(rn,{to:"/",className:"p-menuitem-link",children:I.jsx("span",{className:"p-menuitem-icon",children:I.jsx("i",{className:"pi pi-home text-lg!"})})})}function Yt(e){return e.items?.length?{label:e.label,template:()=>I.jsx(Jt,{item:e})}:{label:e.label,template:e.to?()=>I.jsxs(rn,{to:e.to,className:"p-menuitem-link space-x-2",children:[e.icon&&I.jsx("span",{className:"p-menuitem-icon",children:I.jsx("i",{className:e.icon})}),I.jsx("span",{className:"p-menuitem-text",children:e.label})]}):I.jsxs("span",{className:"p-menuitem-link space-x-2",children:[e.icon&&I.jsx("span",{className:"p-menuitem-icon",children:I.jsx("i",{className:e.icon})}),I.jsx("span",{className:"p-menuitem-text",children:e.label})]})}}const lr={title:"Components/UiBreadCrumb",component:Hn,parameters:{layout:"centered"},tags:["autodocs"],argTypes:{home:{control:"boolean",description:"Exibe o ícone de home como primeiro item com link para `/`"},chevronLeft:{control:"boolean",description:"Exibe um ícone chevron antes do breadcrumb"},model:{control:"object",description:"Array de itens do breadcrumb"}}},He={args:{model:[{label:"Projetos",to:"/"},{label:"Meu Projeto",to:"/"},{label:"Detalhes"}]}},Ue={args:{chevronLeft:!1,model:[{label:"Projetos",to:"/"},{label:"Detalhes"}]}},We={args:{home:!0,chevronLeft:!1,model:[{label:"Projetos",to:"/"},{label:"Detalhes"}]}},Ve={args:{home:!0,chevronLeft:!1,model:[{label:"Projetos",to:"/",icon:"pi pi-folder"},{label:"Meu Projeto",to:"/",icon:"pi pi-file"},{label:"Detalhes",icon:"pi pi-info-circle"}]}},ze={args:{home:!0,chevronLeft:!1,model:[{label:"Projetos",to:"/",icon:"pi pi-folder",items:[{label:"Meu Projeto",icon:"pi pi-file"},{label:"Meu Projeto 2",icon:"pi pi-lock"}]},{label:"Meu Projeto",icon:"pi pi-file",items:[{label:"Editar",icon:"pi pi-pencil",url:"/"},{label:"Excluir",icon:"pi pi-trash"}]},{label:"Detalhes"}]}},Ze={args:{model:[{label:"Dashboard"}]}};He.parameters={...He.parameters,docs:{...He.parameters?.docs,source:{originalSource:`{
  args: {
    model: [{
      label: 'Projetos',
      to: '/'
    }, {
      label: 'Meu Projeto',
      to: '/'
    }, {
      label: 'Detalhes'
    }]
  }
}`,...He.parameters?.docs?.source}}};Ue.parameters={...Ue.parameters,docs:{...Ue.parameters?.docs,source:{originalSource:`{
  args: {
    chevronLeft: false,
    model: [{
      label: 'Projetos',
      to: '/'
    }, {
      label: 'Detalhes'
    }]
  }
}`,...Ue.parameters?.docs?.source}}};We.parameters={...We.parameters,docs:{...We.parameters?.docs,source:{originalSource:`{
  args: {
    home: true,
    chevronLeft: false,
    model: [{
      label: 'Projetos',
      to: '/'
    }, {
      label: 'Detalhes'
    }]
  }
}`,...We.parameters?.docs?.source}}};Ve.parameters={...Ve.parameters,docs:{...Ve.parameters?.docs,source:{originalSource:`{
  args: {
    home: true,
    chevronLeft: false,
    model: [{
      label: 'Projetos',
      to: '/',
      icon: 'pi pi-folder'
    }, {
      label: 'Meu Projeto',
      to: '/',
      icon: 'pi pi-file'
    }, {
      label: 'Detalhes',
      icon: 'pi pi-info-circle'
    }]
  }
}`,...Ve.parameters?.docs?.source}}};ze.parameters={...ze.parameters,docs:{...ze.parameters?.docs,source:{originalSource:`{
  args: {
    home: true,
    chevronLeft: false,
    model: [{
      label: 'Projetos',
      to: '/',
      icon: 'pi pi-folder',
      items: [{
        label: 'Meu Projeto',
        icon: 'pi pi-file'
      }, {
        label: 'Meu Projeto 2',
        icon: 'pi pi-lock'
      }]
    }, {
      label: 'Meu Projeto',
      icon: 'pi pi-file',
      items: [{
        label: 'Editar',
        icon: 'pi pi-pencil',
        url: '/'
      }, {
        label: 'Excluir',
        icon: 'pi pi-trash'
      }]
    }, {
      label: 'Detalhes'
    }]
  }
}`,...ze.parameters?.docs?.source}}};Ze.parameters={...Ze.parameters,docs:{...Ze.parameters?.docs,source:{originalSource:`{
  args: {
    model: [{
      label: 'Dashboard'
    }]
  }
}`,...Ze.parameters?.docs?.source}}};const ur=["Default","WithoutChevron","WithHome","WithIcons","WithSubMenu","SingleItem"];export{He as Default,Ze as SingleItem,We as WithHome,Ve as WithIcons,ze as WithSubMenu,Ue as WithoutChevron,ur as __namedExportsOrder,lr as default};
