PageSourceSearch

https://photobucket.com/assets/js/SidebarLayout-B6naJR5X.js

js photobucket.com collected 2026-09-24 06:57:01 UTC 64,065 bytes, 1 lines download raw bytes

1var $n=Object.defineProperty,Fn=Object.defineProperties;var jn=Object.getOwnPropertyDescriptors;var Me=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var xt=e=>{throw TypeError(e)};var bt=(e,t,n)=>t in e?$n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))vt.call(t,n)&&bt(e,n,t[n]);if(Me)for(var n of Me(t))yt.call(t,n)&&bt(e,n,t[n]);return e},I=(e,t)=>Fn(e,jn(t));var re=(e,t)=>{var n={};for(var r in e)vt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Me)for(var r of Me(e))t.indexOf(r)<0&&yt.call(e,r)&&(n[r]=e[r]);return n};var St=(e,t,n)=>t.has(e)||xt("Cannot "+n);var Se=(e,t,n)=>(St(e,t,"read from private field"),n?n.call(e):t.get(e)),wt=(e,t,n)=>t.has(e)?xt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zt=(e,t,n,r)=>(St(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);import{_ as m,a as _,b as De}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{e as j,c as q,k as Ze,b as H,g as Ae,s as Wn,a as K,i as W,q as Un,u as tn,d as _e,r as Vn}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{_ as ye,e as Hn,d as Le,k as Yn,b as Ct}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import{I as et,n as Y,q as Kn,r as qn,s as tt,m as Xn,G as Jn,l as nn,t as rn,j as on,A as Qn,v as Ye,w as Zn,x as Ke,y as Dt,z as Pt,C as Ie,E as Pe,F as an,H as er,u as sn,J as tr,K as kt,o as nr}from"./index-C8DIms-h.js";import{d as nt}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";import{u as rr,f as Lt,a as or,b as ir,H as ar}from"./formatStorageBytes-B0bS0L06.js";import{I as sr}from"./ImageIcon-D2XgVoX2.js";import{L as lr}from"./Link1Icon-b7kYrNLi.js";import{S as ur}from"./Star1Icon-BLgURgew.js";import{T as cr}from"./Trash1Icon-Dznmln5s.js";import{I as ln}from"./IconButton-Cswe56TH.js";import{G as qe}from"./GridIcon-8_Np-10u.js";import{P as un}from"./PlusIcon-Cwk4M6I2.js";import{u as dr}from"./CreateGroupDrawerContext-CYmLA6sq.js";import{B as fr,a as pr}from"./useBucketList-Dp_j2Qaf.js";import{C as gr}from"./ChevronDownIcon-CB9Tmqtp.js";import{C as mr}from"./ChevronUpIcon-BOlKj0kT.js";import{u as hr}from"./useGroupCounters-htIN71tD.js";import{F as Xe}from"./FolderIcon-Djop75le.js";import{L as br}from"./LoadingIcon-BUCARp-P.js";import{u as vr}from"./useBucketMediaMove-BQjlNRvH.js";import{r as yr,p as xr}from"./albumCacheLinks-COyuqQrC.js";import{u as Sr}from"./CreateAlbumDrawerContext-BrLdwoFb.js";import{B as Et}from"./BucketCreate-W2j7i5fC.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.js";import"./preload-helper-s0Msbe4-.js";import"./index-DM2295YJ.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_fD68H2V.js";import"./formatBytes-jRUNT9z8.js";import"./usePositioner-D-LvJytS.js";import"./DirectionContext-CJiZK74l.js";import"./logger-YHhloPCO.js";import"./useSelectedMedia-moNafvFD.js";import"./index-CKJ3iTdM.js";import"./groupCapUpsell-C7pFxje8.js";import"./useProfilePlan-CFYSgKgo.js";import"./useAnalytics-Bqtss9LT.js";import"./TextField-XHezjr4a.js";import"./Select-C0o-DiOk.js";import"./isMuiElement-ByswdNQJ.js";import"./List-g65CIM25.js";import"./FormControlLabel-DDOXog2C.js";import"./Divider-D0Q2hE10.js";import"./dividerClasses-DKoWjx9h.js";import"./Dialog-DJadggB1.js";const wr='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M3.5 6.5L6 9L8.5 6.5M3.5 3L6 5.5L8.5 3" stroke="#3A0090" stroke-linecap="round" stroke-linejoin="round"/></svg>';function zr(e){return m(et,M({svg:wr},e))}const Cr='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="m18 17-5-5 5-5M11 17l-5-5 5-5" stroke="#1A1A1A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';function Dr(e){return m(et,M({svg:Cr},e))}function Pr(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function kr(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),r=parseFloat(n.fontSize);return t*r}function Lr(e){return e/100*window.innerHeight}function Er(e){return e/100*window.innerWidth}function Mr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function we({groupSize:e,panelElement:t,styleProp:n}){let r;const[o,i]=Mr(n);switch(i){case"%":{r=o/100*e;break}case"px":{r=o;break}case"rem":{r=kr(t,o);break}case"em":{r=Pr(t,o);break}case"vh":{r=Lr(o);break}case"vw":{r=Er(o);break}}return r}function V(e){return parseFloat(e.toFixed(3))}function ve({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,o)=>(r+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,r),0)}function Je(e){const{panels:t}=e,n=ve({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:o,panelConstraints:i}=r;let l=0;if(i.collapsedSize!==void 0){const u=we({groupSize:n,panelElement:o,styleProp:i.collapsedSize});l=V(u/n*100)}let s;if(i.defaultSize!==void 0){const u=we({groupSize:n,panelElement:o,styleProp:i.defaultSize});s=V(u/n*100)}let a=0;if(i.minSize!==void 0){const u=we({groupSize:n,panelElement:o,styleProp:i.minSize});a=V(u/n*100)}let c=100;if(i.maxSize!==void 0){const u=we({groupSize:n,panelElement:o,styleProp:i.maxSize});c=V(u/n*100)}return{groupResizeBehavior:i.groupResizeBehavior,collapsedSize:l,collapsible:i.collapsible===!0,defaultSize:s,disabled:i.disabled,minSize:a,maxSize:c,panelId:r.id}})}function R(e,t="Assertion error"){if(!e)throw Error(t)}function Qe(e,t){return Array.from(t).sort(e==="horizontal"?Tr:Rr)}function Tr(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Rr(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function cn(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function dn(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Nr({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let o,i=Number.MAX_VALUE;for(const l of t){const{x:s,y:a}=dn(r,l),c=e==="horizontal"?s:a;c<i&&(i=c,o=l)}return R(o,"No rect found"),o}let Te;function Ar(){return Te===void 0&&(typeof matchMedia=="function"?Te=!!matchMedia("(pointer:coarse)").matches:Te=!1),Te}function fn(e){const{element:t,orientation:n,panels:r,separators:o}=e,i=Qe(n,Array.from(t.children).filter(cn).map(y=>({element:y}))).map(({element:y})=>y),l=[];let s=!1,a=!1,c=-1,u=-1,p=0,f,b=[];{let y=-1;for(const h of i)h.hasAttribute("data-panel")&&(y++,h.hasAttribute("data-disabled")||(p++,c===-1&&(c=y),u=y))}if(p>1){let y=-1;for(const h of i)if(h.hasAttribute("data-panel")){y++;const g=r.find(d=>d.element===h);if(g){if(f){const d=f.element.getBoundingClientRect(),v=h.getBoundingClientRect();let x;if(a){const w=n==="horizontal"?new DOMRect(d.right,d.top,0,d.height):new DOMRect(d.left,d.bottom,d.width,0),S=n==="horizontal"?new DOMRect(v.left,v.top,0,v.height):new DOMRect(v.left,v.top,v.width,0);switch(b.length){case 0:{x=[w,S];break}case 1:{const z=b[0],C=Nr({orientation:n,rects:[d,v],targetRect:z.element.getBoundingClientRect()});x=[z,C===d?S:w];break}default:{x=b;break}}}else b.length?x=b:x=[n==="horizontal"?new DOMRect(d.right,v.top,v.left-d.right,v.height):new DOMRect(v.left,d.bottom,v.width,v.top-d.bottom)];for(const w of x){let S="width"in w?w:w.element.getBoundingClientRect();const z=Ar()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<z){const D=z-S.width;S=new DOMRect(S.x-D/2,S.y,S.width+D,S.height)}if(S.height<z){const D=z-S.height;S=new DOMRect(S.x,S.y-D/2,S.width,S.height+D)}const C=y<=c||y>u;!s&&!C&&l.push({group:e,groupSize:ve({group:e}),panels:[f,g],separator:"width"in w?void 0:w,rect:S}),s=!1}}a=!1,f=g,b=[]}}else if(h.hasAttribute("data-separator")){h.ariaDisabled!==null&&(s=!0);const g=o.find(d=>d.element===h);g?b.push(g):(f=void 0,b=[])}else a=!0}return l}var te;class pn{constructor(){wt(this,te,{})}addListener(t,n){const r=Se(this,te)[t];return r===void 0?Se(this,te)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=Se(this,te)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let o=!1,i=null;const l=Array.from(r);for(let s=0;s<l.length;s++){const a=l[s];try{a.call(null,n)}catch(c){i===null&&(o=!0,i=c)}}if(o)throw i}}removeAllListeners(){zt(this,te,{})}removeListener(t,n){const r=Se(this,te)[t];if(r!==void 0){const o=r.indexOf(n);o>=0&&r.splice(o,1)}}}te=new WeakMap;let J=new Map;const gn=new pn;
1function _r(e){J=new Map(J),J.delete(e)}function Mt(e,t){for(const[n]of J)if(n.id===e)return n}function ne(e,t){for(const[n,r]of J)if(n.id===e)return r;if(t)throw Error("Could not find data for Group with id ".concat(e))}function ce(){return J}function rt(e,t){return gn.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Z(e,t){const n=J.get(e);J=new Map(J),J.set(e,t),gn.emit("groupChange",{group:e,prev:n,next:t})}function Ir(e,t,n){let r,o={x:1/0,y:1/0};for(const i of t){const l=dn(n,i.rect);switch(e){case"horizontal":{l.x<=o.x&&(r=i,o=l);break}case"vertical":{l.y<=o.y&&(r=i,o=l);break}}}return r?{distance:o,hitRegion:r}:void 0}function Or(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Br(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Nt(e),b:Nt(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();R(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Rt(Tt(n.a)),b:Rt(Tt(n.b))};if(o.a===o.b){const i=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let s=i.length;for(;s--;){const a=i[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(o.a-o.b)}const Gr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function $r(e){var n;const t=getComputedStyle((n=mn(e))!=null?n:e).display;return t==="flex"||t==="inline-flex"}function Fr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||$r(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Gr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Tt(e){let t=e.length;for(;t--;){const n=e[t];if(R(n,"Missing node"),Fr(n))return n}return null}function Rt(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Nt(e){const t=[];for(;e;)t.push(e),e=mn(e);return t}function mn(e){const{parentNode:t}=e;return Or(t)?t.host:t}function jr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Wr({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!cn(n)||n.contains(e)||e.contains(n))return!0;if(Br(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(jr(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function ot(e,t){const n=[];return t.forEach((r,o)=>{if(o.disabled)return;const i=fn(o),l=Ir(o.orientation,i,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&Wr({groupElement:o.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function Ur(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function F(e,t,n=0){return Math.abs(V(e)-V(t))<=n}function X(e,t){return F(e,t)?0:e>t?1:-1}function me({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:o=0,collapsible:i,disabled:l,maxSize:s=100,minSize:a=0}=t;if(l&&!e)return n;if(X(r,a)<0)if(i){const c=(o+a)/2;X(r,c)<0?r=o:r=a}else r=a;return r=Math.min(s,r),r=V(r),r}function ke({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(F(e,0))return t;const l=i==="imperative-api",s=Object.values(t),a=Object.values(o),c=[...s],[u,p]=r;R(u!=null,"Invalid first pivot index"),R(p!=null,"Invalid second pivot index");let f=0;switch(i){case"keyboard":{{const h=e<0?p:u,g=n[h];R(g,"Panel constraints not found for index ".concat(h));const{collapsedSize:d=0,collapsible:v,minSize:x=0}=g;if(v){const w=s[h];if(R(w!=null,"Previous layout not found for panel index ".concat(h)),F(w,d)){const S=x-w;X(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const h=e<0?u:p,g=n[h];R(g,"No panel constraints found for index ".concat(h));const{collapsedSize:d=0,collapsible:v,minSize:x=0}=g;if(v){const w=s[h];if(R(w!=null,"Previous layout not found for panel index ".concat(h)),F(w,x)){const S=w-d;X(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}
1default:{const h=e<0?p:u,g=n[h];R(g,"Panel constraints not found for index ".concat(h));const d=s[h],{collapsible:v,collapsedSize:x,minSize:w}=g;if(v&&X(d,w)<0)if(e>0){const S=w-x,z=S/2,C=d+e;X(C,w)<0&&(e=X(e,z)<=0?0:S)}else{const S=w-x,z=100-S/2,C=d-e;X(C,w)<0&&(e=X(100+e,z)>0?0:-S)}break}}{const h=e<0?1:-1;let g=e<0?p:u,d=0;for(;;){const x=s[g];R(x!=null,"Previous layout not found for panel index ".concat(g));const w=me({overrideDisabledPanels:l,panelConstraints:n[g],prevSize:x,size:100})-x;if(d+=w,g+=h,g<0||g>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(d));e=e<0?0-v:v}{let h=e<0?u:p;for(;h>=0&&h<n.length;){const g=Math.abs(e)-Math.abs(f),d=s[h];R(d!=null,"Previous layout not found for panel index ".concat(h));const v=d-g,x=me({overrideDisabledPanels:l,panelConstraints:n[h],prevSize:d,size:v});if(!F(d,x)&&(f+=d-x,c[h]=x,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(Ur(a,c))return o;{const h=e<0?p:u,g=s[h];R(g!=null,"Previous layout not found for panel index ".concat(h));const d=g+f,v=me({overrideDisabledPanels:l,panelConstraints:n[h],prevSize:g,size:d});if(c[h]=v,!F(v,d)){let x=d-v,w=e<0?p:u;for(;w>=0&&w<n.length;){const S=c[w];R(S!=null,"Previous layout not found for panel index ".concat(w));const z=S+x,C=me({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:S,size:z});if(F(S,C)||(x-=C-S,c[w]=C),F(x,0))break;e>0?w--:w++}}}const b=Object.values(c).reduce((h,g)=>g+h,0);if(!F(b,100,.1))return o;const y=Object.keys(o);return c.reduce((h,g,d)=>(h[y[d]]=g,h),{})}function se(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||X(e[n],t[n])!==0)return!1;return!0}function le({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],o=r.reduce((s,a)=>s+a,0);if(r.length!==t.length)throw Error("Invalid ".concat(t.length," panel layout: ").concat(r.map(s=>"".concat(s,"%")).join(", ")));if(!F(o,100)&&r.length>0)for(let s=0;s<t.length;s++){const a=r[s];R(a!=null,"No layout data found for index ".concat(s));const c=100/o*a;r[s]=c}let i=0;for(let s=0;s<t.length;s++){const a=n[s];R(a!=null,"No layout data found for index ".concat(s));const c=r[s];R(c!=null,"No layout data found for index ".concat(s));const u=me({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:a,size:c});c!=u&&(i+=c-u,r[s]=u)}if(!F(i,0))for(let s=0;s<t.length;s++){const a=r[s];R(a!=null,"No layout data found for index ".concat(s));const c=a+i,u=me({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:a,size:c});if(a!==u&&(i-=u-a,r[s]=u,F(i,0)))break}const l=Object.keys(e);return r.reduce((s,a,c)=>(s[l[c]]=a,s),{})}function hn({groupId:e,panelId:t}){const n=()=>{const a=ce();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:p,layout:f,groupSize:b,separatorToPanels:y}]of a)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:p,group:c,groupSize:b,layout:f,separatorToPanels:y};throw Error("Group ".concat(e," not found"))},r=()=>{const a=n().derivedPanelConstraints.find(c=>c.panelId===t);if(a!==void 0)return a;throw Error("Panel constraints not found for Panel ".concat(t))},o=()=>{const a=n().group.panels.find(c=>c.id===t);if(a!==void 0)return a;throw Error("Layout not found for Panel ".concat(t))},i=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error("Layout not found for Panel ".concat(t))},l=({nextSize:a,panels:c,prevLayout:u,derivedPanelConstraints:p})=>{const f=i(),b=c.findIndex(g=>g.id===t),y=b===0,h=b===c.length-1;if(h&&a<f&&(y||c.slice(0,b).every((g,d)=>{const v=p[d];return(v==null?void 0:v.collapsible)&&F(v.collapsedSize,u[v.panelId])}))){const g=c.slice(0,b).reduce((d,v)=>d+u[v.id],0);return I(M({},u),{[t]:V(100-g)})}return ke({delta:h?f-a:a-f,initialLayout:u,panelConstraints:p,pivotIndices:h?[b-1,b]:[b,b+1],prevLayout:u,trigger:"imperative-api"})},s=a=>{const c=i();if(a===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:p,group:f,groupSize:b,layout:y,separatorToPanels:h}=n(),g=l({nextSize:a,panels:f.panels,prevLayout:y,derivedPanelConstraints:p}),d=le({layout:g,panelConstraints:p});se(y,d)||Z(f,{defaultLayoutDeferred:u,derivedPanelConstraints:p,groupSize:b,layout:d,separatorToPanels:h})};return{collapse:()=>{const{collapsible:a,collapsedSize:c}=r(),{mutableValues:u}=o(),p=i();a&&p!==c&&(u.expandToSize=p,s(c))},expand:()=>{var b;const{collapsible:a,collapsedSize:c,minSize:u}=r(),{mutableValues:p}=o(),f=i();if(a&&f===c){let y=(b=p.expandToSize)!=null?b:u;y===0&&(y=1),s(y)}},getSize:()=>{const{group:a}=n(),c=i(),{element:u}=o(),p=a.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:p}},isCollapsed:()=>{const{collapsible:a,collapsedSize:c}=r(),u=i();return a&&F(c,u)},resize:a=>{const{group:c}=n(),{element:u}=o(),p=ve({group:c}),f=we({groupSize:p,panelElement:u,styleProp:a}),b=V(f/p*100);s(b)}}}function At(e){if(e.defaultPrevented)return;const t=ce();ot(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(r){const o=r.panelConstraints.defaultSize,i=hn({groupId:n.group.id,panelId:r.id});i&&o!==void 0&&(i.resize(o),e.preventDefault())}}})}function Ne(e){const t=ce();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function bn({groupId:e}){const t=()=>{const n=ce();for(const[r,o]of n)if(r.id===e)return M({group:r},o);throw Error('Could not find Group with id "'.concat(e,'"'))};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:o,group:i,groupSize:l,layout:s,separatorToPanels:a}=t(),c=le({layout:n,panelConstraints:o});return r?s:(se(s,c)||Z(i,{defaultLayoutDeferred:r,derivedPanelConstraints:o,groupSize:l,layout:c,separatorToPanels:a}),c)}}}function oe(e,t){const n=Ne(e),r=ne(n.id,!0),o=n.separators.find(u=>u.element===e);R(o,"Matching separator not found");const i=r.separatorToPanels.get(o);R(i,"Matching panels not found");const l=i.map(u=>n.panels.indexOf(u)),s=bn({groupId:n.id}).getLayout(),a=ke({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:s,trigger:"keyboard"}),c=le({layout:a,panelConstraints:r.derivedPanelConstraints});se(s,c)||Z(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function _t(e){var r;if(e.defaultPrevented)return;const t=e.currentTarget,n=Ne(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&oe(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&oe(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&oe(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&oe(t,-5);break}case"End":{e.preventDefault(),oe(t,100);break}case"Enter":{e.preventDefault();const o=Ne(t),i=ne(o.id,!0),{derivedPanelConstraints:l,layout:s,separatorToPanels:a}=i,c=o.separators.find(b=>b.element===t);R(c,"Matching separator not found");const u=a.get(c);R(u,"Matching panels not found");const p=u[0],f=l.find(b=>b.panelId===p.id);if(R(f,"Panel metadata not found"),f.collapsible){const b=s[p.id],y=f.collapsedSize===b?(r=o.mutableState.expandedPanelSizes[p.id])!=null?r:f.minSize:f.collapsedSize;oe(t,y-b)}break}case"F6":{e.preventDefault();const o=Ne(t).separators.map(s=>s.element),i=Array.from(o).findIndex(s=>s===e.currentTarget);R(i!==null,"Index not found");const l=e.shiftKey?i>0?i-1:o.length-1:i+1<o.length?i+1:0;o[l].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),oe(t,-100);break}}}let he={cursorFlags:0,state:"inactive"};const it=new pn;function ue(){return he}function Vr(e){return it.addListener("change",e)}function Hr(e){const t=he,n=M({},he);n.cursorFlags=e,he=n,it.emit("change",{prev:t,next:n})}function be(e){const t=he;he=e,it.emit("change",{prev:t,next:e})}function It(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ce(),n=ot(e,t),r=new Map;let o=!1;
1n.forEach(i=>{i.separator&&(o||(o=!0,i.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(i.group);l&&r.set(i.group,l.layout)}),be({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const Yr=e=>e,je=()=>{},vn=1,yn=2,xn=4,Sn=8,Ot=3,Bt=12;let Re;function Gt(){return Re===void 0&&(Re=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Re=!0)),Re}function Kr({cursorFlags:e,groups:t,state:n}){let r=0,o=0;switch(n){case"active":case"hover":t.forEach(i=>{if(!i.mutableState.disableCursor)switch(i.orientation){case"horizontal":{r++;break}case"vertical":{o++;break}}})}if(!(r===0&&o===0)){switch(n){case"active":{if(e&&Gt()){const i=(e&vn)!==0,l=(e&yn)!==0,s=(e&xn)!==0,a=(e&Sn)!==0;if(i)return s?"se-resize":a?"ne-resize":"e-resize";if(l)return s?"sw-resize":a?"nw-resize":"w-resize";if(s)return"s-resize";if(a)return"n-resize"}break}}return Gt()?r>0&&o>0?"move":r>0?"ew-resize":"ns-resize":r>0&&o>0?"grab":r>0?"col-resize":"row-resize"}}const $t=new WeakMap;function at(e){var o;if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=(o=$t.get(e))!=null?o:{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const r=ue();switch(r.state){case"active":case"hover":{const i=Kr({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(s=>s.group),state:r.state}),l="*, *:hover {cursor: ".concat(i," !important; }");if(t===l)return;t=l,i?n.cssRules.length===0?n.insertRule(l):n.replaceSync(l):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}$t.set(e,{prevStyle:t,styleSheet:n})}function wn({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:o,pointerDownAtPoint:i,prevCursorFlags:l}){let s=0;n.forEach(c=>{const{group:u,groupSize:p}=c,{orientation:f,panels:b}=u,{disableCursor:y}=u.mutableState;let h=0;i?f==="horizontal"?h=(t.clientX-i.x)/p*100:h=(t.clientY-i.y)/p*100:f==="horizontal"?h=t.clientX<0?-100:100:h=t.clientY<0?-100:100;const g=r.get(u),d=o.get(u);if(!g||!d)return;const{defaultLayoutDeferred:v,derivedPanelConstraints:x,groupSize:w,layout:S,separatorToPanels:z}=d;if(x&&S&&z){const C=ke({delta:h,initialLayout:g,panelConstraints:x,pivotIndices:c.panels.map(D=>b.indexOf(D)),prevLayout:S,trigger:"mouse-or-touch"});if(se(C,S)){if(h!==0&&!y)switch(f){case"horizontal":{s|=h<0?vn:yn;break}case"vertical":{s|=h<0?xn:Sn;break}}}else Z(c.group,{defaultLayoutDeferred:v,derivedPanelConstraints:x,groupSize:w,layout:C,separatorToPanels:z})}});let a=0;t.movementX===0?a|=l&Ot:a|=s&Ot,t.movementY===0?a|=l&Bt:a|=s&Bt,Hr(a),at(e)}function Ft(e){const t=ce(),n=ue();n.state==="active"&&wn({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function jt(e){var r,o;if(e.defaultPrevented)return;const t=ue(),n=ce();switch(t.state){case"active":{if(e.buttons===0){be({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(i=>{const l=ne(i.group.id,!0);Z(i.group,l)});return}for(const i of t.hitRegions)if(i.separator){const{element:l}=i.separator;(r=l.hasPointerCapture)!=null&&r.call(l,e.pointerId)||((o=l.setPointerCapture)==null||o.call(l,e.pointerId))}wn({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const i=ot(e,n);i.length===0?t.state!=="inactive"&&be({cursorFlags:0,state:"inactive"}):be({cursorFlags:0,hitRegions:i,state:"hover"}),at(e.currentTarget);break}}}function Wt(e){e.relatedTarget instanceof HTMLIFrameElement&&ue().state==="hover"&&be({cursorFlags:0,state:"inactive"})}function Ut(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ue();t.state==="active"&&(be({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(at(e.currentTarget),t.hitRegions.forEach(n=>{const r=ne(n.group.id,!0);Z(n.group,r)}),e.preventDefault()))}function Vt(e){let t=0,n=0;const r={};for(const i of e)if(i.defaultSize!==void 0){t++;const l=V(i.defaultSize);n+=l,r[i.panelId]=l}else r[i.panelId]=void 0;const o=e.length-t;if(o!==0){const i=V((100-n)/o);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=i)}return r}function qr(e,t,n){if(!n[0])return;const r=e.panels.find(a=>a.element===t);if(!r||!r.onResize)return;const o=ve({group:e}),i=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,s={asPercentage:V(i/o*100),inPixels:i};r.mutableValues.prevSize=s,r.onResize(s,r.id,l)}function Xr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Jr({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){var p,f;if(n<=0||t<=0||n===t)return r;let o=0,i=0,l=!1;const s=new Map,a=[];for(const b of e.panels){const y=(p=r[b.id])!=null?p:0;
1if(b.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){l=!0;const h=y/100*n,g=V(h/t*100);s.set(b.id,g),o+=g}else a.push(b.id),i+=y}if(!l||a.length===0)return r;const c=100-o,u=M({},r);if(s.forEach((b,y)=>{u[y]=b}),i>0)for(const b of a){const y=(f=r[b])!=null?f:0;u[b]=V(y/i*c)}else{const b=V(c/a.length);for(const y of a)u[y]=b}return u}function Qr(e,t){const n=e.map(o=>o.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o))return!1;return!0}const pe=new Map;function Zr(e){var y,h,g;let t=!0;R(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,o=new Set,i=new n(d=>{for(const v of d){const{borderBoxSize:x,target:w}=v;if(w===e.element){if(t){const S=ve({group:e});if(S===0)return;const z=ne(e.id);if(!z)return;const C=Je(e),D=z.defaultLayoutDeferred?Vt(C):z.layout,L=Jr({group:e,nextGroupSize:S,prevGroupSize:z.groupSize,prevLayout:D}),E=le({layout:L,panelConstraints:C});if(!z.defaultLayoutDeferred&&se(z.layout,E)&&Xr(z.derivedPanelConstraints,C)&&z.groupSize===S)return;Z(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:C,groupSize:S,layout:E,separatorToPanels:z.separatorToPanels})}}else qr(e,w,x)}});i.observe(e.element),e.panels.forEach(d=>{R(!r.has(d.id),'Panel ids must be unique; id "'.concat(d.id,'" was used more than once')),r.add(d.id),d.onResize&&i.observe(d.element)});const l=ve({group:e}),s=Je(e),a=e.panels.map(({id:d})=>d).join(",");let c=e.mutableState.defaultLayout;c&&(Qr(e.panels,c)||(c=void 0));const u=(h=(y=e.mutableState.layouts[a])!=null?y:c)!=null?h:Vt(s),p=le({layout:u,panelConstraints:s}),f=e.element.ownerDocument;pe.set(f,((g=pe.get(f))!=null?g:0)+1);const b=new Map;return fn(e).forEach(d=>{d.separator&&b.set(d.separator,d.panels)}),Z(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:s,groupSize:l,layout:p,separatorToPanels:b}),e.separators.forEach(d=>{R(!o.has(d.id),'Separator ids must be unique; id "'.concat(d.id,'" was used more than once')),o.add(d.id),d.element.addEventListener("keydown",_t)}),pe.get(f)===1&&(f.addEventListener("dblclick",At,!0),f.addEventListener("pointerdown",It,!0),f.addEventListener("pointerleave",Ft),f.addEventListener("pointermove",jt),f.addEventListener("pointerout",Wt),f.addEventListener("pointerup",Ut,!0)),function(){var d;t=!1,pe.set(f,Math.max(0,((d=pe.get(f))!=null?d:0)-1)),_r(e),e.separators.forEach(v=>{v.element.removeEventListener("keydown",_t)}),pe.get(f)||(f.removeEventListener("dblclick",At,!0),f.removeEventListener("pointerdown",It,!0),f.removeEventListener("pointerleave",Ft),f.removeEventListener("pointermove",jt),f.removeEventListener("pointerout",Wt),f.removeEventListener("pointerup",Ut,!0)),i.disconnect()}}function eo(){const[e,t]=K({}),n=W(()=>t({}),[]);return[e,n]}function st(e){const t=Un();return"".concat(e!=null?e:t)}const de=typeof window<"u"?Ze:H;function Ce(e){const t=j(e);return de(()=>{t.current=e},[e]),W((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function lt(...e){return Ce(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function ut(e){const t=j(M({},e));return de(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const zn=Ae(null);function to(e,t){const n=j({getLayout:()=>({}),setLayout:Yr});tn(t,()=>n.current,[]),de(()=>{Object.assign(n.current,bn({groupId:e}))})}function Cn(y){var h=y,{children:e,className:t,defaultLayout:n,disableCursor:r,disabled:o,elementRef:i,groupRef:l,id:s,onLayoutChange:a,onLayoutChanged:c,orientation:u="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:f}=h,b=re(h,["children","className","defaultLayout","disableCursor","disabled","elementRef","groupRef","id","onLayoutChange","onLayoutChanged","orientation","resizeTargetMinimumSize","style"]);const g=j({onLayoutChange:{},onLayoutChanged:{}}),d=Ce(P=>{se(g.current.onLayoutChange,P)||(g.current.onLayoutChange=P,a==null||a(P))}),v=Ce(P=>{se(g.current.onLayoutChanged,P)||(g.current.onLayoutChanged=P,c==null||c(P))}),x=st(s),w=j(null),[S,z]=eo(),C=j({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),D=lt(w,i);to(x,l);const L=Ce((P,k)=>{var A;const N=ue(),T=Mt(P),O=ne(P);if(O){let B=!1;return N.state==="active"&&(B=N.hitRegions.some($=>$.group===T)),{flexGrow:(A=O.layout[k])!=null?A:1,pointerEvents:B?"none":void 0}}if(n!=null&&n[k])return{flexGrow:n==null?void 0:n[k]}}),E=ut({defaultLayout:n,disableCursor:r}),G=q(()=>
1({get disableCursor(){return!!E.disableCursor},getPanelStyles:L,id:x,orientation:u,registerPanel:P=>{const k=C.current;return k.panels=Qe(u,[...k.panels,P]),z(),()=>{k.panels=k.panels.filter(N=>N!==P),z()}},registerSeparator:P=>{const k=C.current;return k.separators=Qe(u,[...k.separators,P]),z(),()=>{k.separators=k.separators.filter(N=>N!==P),z()}},updatePanelProps:(P,{disabled:k})=>{const N=C.current.panels.find(A=>A.id===P);N&&(N.panelConstraints.disabled=k);const T=Mt(x),O=ne(x);T&&O&&Z(T,I(M({},O),{derivedPanelConstraints:Je(T)}))},updateSeparatorProps:(P,{disabled:k,disableDoubleClick:N})=>{const T=C.current.separators.find(O=>O.id===P);T&&(T.disabled=k,T.disableDoubleClick=N)}}),[L,x,z,u,E]),U=j(null);return de(()=>{const P=w.current;if(P===null)return;const k=C.current;let N;if(E.defaultLayout!==void 0&&Object.keys(E.defaultLayout).length===k.panels.length){N={};for(const ee of k.panels){const fe=E.defaultLayout[ee.id];fe!==void 0&&(N[ee.id]=fe)}}const T={disabled:!!o,element:P,id:x,mutableState:{defaultLayout:N,disableCursor:!!E.disableCursor,expandedPanelSizes:C.current.lastExpandedPanelSizes,layouts:C.current.layouts},orientation:u,panels:k.panels,resizeTargetMinimumSize:k.resizeTargetMinimumSize,separators:k.separators};U.current=T;const O=Zr(T),{defaultLayoutDeferred:A,derivedPanelConstraints:B,layout:$}=ne(T.id,!0);!A&&B.length>0&&(d($),v($));const xe=rt(x,ee=>{const{defaultLayoutDeferred:fe,derivedPanelConstraints:mt,layout:Ee}=ee.next;if(fe||mt.length===0)return;const In=T.panels.map(({id:Q})=>Q).join(",");T.mutableState.layouts[In]=Ee,mt.forEach(Q=>{var ht;if(Q.collapsible){const{layout:Fe}=(ht=ee.prev)!=null?ht:{};if(Fe){const Bn=F(Q.collapsedSize,Ee[Q.panelId]),Gn=F(Q.collapsedSize,Fe[Q.panelId]);Bn&&!Gn&&(T.mutableState.expandedPanelSizes[Q.panelId]=Fe[Q.panelId])}}});const On=ue().state!=="active";d(Ee),On&&v(Ee)});return()=>{U.current=null,O(),xe()}},[o,x,v,d,u,S,E]),H(()=>{const P=U.current;P&&(P.mutableState.defaultLayout=n,P.mutableState.disableCursor=!!r)}),m(zn.Provider,{value:G,children:m("div",I(M({},b),{className:t,"data-group":!0,"data-testid":x,id:x,ref:D,style:I(M({height:"100%",width:"100%",overflow:"hidden"},f),{display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"}),children:e}))})}Cn.displayName="Group";function ct(){const e=_e(zn);return R(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function no(e,t){const{id:n}=ct(),r=j({collapse:je,expand:je,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:je});tn(t,()=>r.current,[]),de(()=>{Object.assign(r.current,hn({groupId:n,panelId:e}))})}function Dn(h){var g=h,{children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:o,disabled:i,elementRef:l,groupResizeBehavior:s="preserve-relative-size",id:a,maxSize:c="100%",minSize:u="0%",onResize:p,panelRef:f,style:b}=g,y=re(g,["children","className","collapsedSize","collapsible","defaultSize","disabled","elementRef","groupResizeBehavior","id","maxSize","minSize","onResize","panelRef","style"]);const d=!!a,v=st(a),x=ut({disabled:i}),w=j(null),S=lt(w,l),{getPanelStyles:z,id:C,orientation:D,registerPanel:L,updatePanelProps:E}=ct(),G=p!==null,U=Ce((T,O,A)=>{p==null||p(T,a,A)});de(()=>{const T=w.current;if(T!==null){const O={element:T,id:v,idIsStable:d,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?U:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:o,disabled:x.disabled,maxSize:c,minSize:u}};return L(O)}},[s,n,r,o,G,v,d,c,u,U,L,x]),H(()=>{E(v,{disabled:i})},[i,v,E]),no(v,f);const P=()=>{const T=z(C,v);if(T)return JSON.stringify(T)},k=Wn(T=>rt(C,T),P,P);let N;return k?N=JSON.parse(k):o!==void 0?N={flexGrow:void 0,flexShrink:void 0,flexBasis:o}:N={flexGrow:1},m("div",I(M({},y),{"data-disabled":i||void 0,"data-panel":!0,"data-testid":v,id:v,ref:S,style:M(I(M({},ro),{display:"flex",flexBasis:0,flexShrink:1,overflow:"visible"}),N),children:m("div",{className:t,style:I(M({maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto"},b),{touchAction:D==="horizontal"?"pan-y":"pan-x"}),children:e})}))}Dn.displayName="Panel";const ro={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function oo(){return j(null)}function io({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let o,i;const l=e[n],s=t.find(a=>a.panelId===n);if(s){const a=s.maxSize,c=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];i=le({layout:ke({delta:c-l,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],o=le({layout:ke({delta:a-l,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:i,valueNow:l}}function Pn(a){var c=a,{children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:o,id:i,style:l}=c,s=re(c,["children","className","disabled","disableDoubleClick","elementRef","id","style"]);const u=st(i),p=ut({disabled:n,disableDoubleClick:r}),[f,b]=K({}),[y,h]=K("inactive"),[g,d]=K(!1),v=j(null),x=lt(v,o),{disableCursor:w,id:S,orientation:z,registerSeparator:C,updateSeparatorProps:D}=ct(),L=z==="horizontal"?"vertical":"horizontal";de(()=>{const U=v.current;if(U!==null){const P={disabled:p.disabled,disableDoubleClick:p.disableDoubleClick,element:U,id:u},k=C(P),N=Vr(O=>{h(O.next.state!=="inactive"&&O.next.hitRegions.some(A=>A.separator===P)?O.next.state:"inactive")}),T=rt(S,O=>{const{derivedPanelConstraints:A,layout:B,separatorToPanels:$}=O.next,xe=$.get(P);
1if(xe){const ee=xe[0],fe=xe.indexOf(ee);b(io({layout:B,panelConstraints:A,panelId:ee.id,panelIndex:fe}))}});return()=>{N(),T(),k()}}},[S,u,C,p]),H(()=>{D(u,{disabled:n,disableDoubleClick:r})},[n,r,u,D]);let E;n&&!w&&(E="not-allowed");let G;return n?G="disabled":y==="active"?G="active":g?G="focus":G=y,m("div",I(M({},s),{"aria-controls":f.valueControls,"aria-disabled":n||void 0,"aria-orientation":L,"aria-valuemax":f.valueMax,"aria-valuemin":f.valueMin,"aria-valuenow":f.valueNow,children:e,className:t,"data-separator":G,"data-testid":u,id:u,onBlur:()=>d(!1),onFocus:()=>d(!0),ref:x,role:"separator",style:I(M({flexBasis:"auto",cursor:E},l),{flexGrow:0,flexShrink:0,touchAction:"none"}),tabIndex:n?void 0:0}))}Pn.displayName="Separator";function ao(n){var r=n,{className:e}=r,t=re(r,["className"]);return m(Cn,M({"data-slot":"resizable-panel-group",className:Y("flex h-full w-full aria-[orientation=vertical]:flex-col",e)},t))}function Ht(t){var e=re(t,[]);return m(Dn,M({"data-slot":"resizable-panel"},e))}function so(r){var o=r,{withHandle:e,className:t}=o,n=re(o,["withHandle","className"]);return m(Pn,I(M({"data-slot":"resizable-handle",className:Y("bg-border ring-offset-background focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-4 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",t)},n),{children:e&&m("div",{className:"bg-border z-10 flex h-24 w-4 shrink-0 rounded-12"})}))}function lo({usage:e}){const{usedBytes:t,limitBytes:n,percent:r}=e,o=Lt(t),i=n===null?"Unlimited":Lt(n);return _("div",{className:"flex flex-col gap-4",children:[_("div",{className:"text-foreground flex items-center justify-between text-base",children:[m("span",{className:"font-text",children:"Usage"}),_("span",{className:"font-display font-semibold",children:[o," / ",i]})]}),n!==null&&r!==null&&m("div",{role:"meter","aria-label":"Storage usage","aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":Math.min(t,n),"aria-valuetext":"".concat(o," of ").concat(i," used"),className:"bg-brand-200 relative h-8 w-full overflow-hidden rounded-full",children:m("div",{className:"bg-gradient-purple-pink absolute inset-y-0 left-0 rounded-full",style:{width:"".concat(r,"%")}})})]})}function uo(){const e=rr(),t=Kn();return!e&&!t?null:m("div",{className:"border-border border-t",children:_("div",{className:"flex flex-col gap-8 pr-16 pl-24 pt-8",children:[e&&m(lo,{usage:e}),t&&m("button",{type:"button",onClick:()=>qn("upsellModal"),className:"bg-gradient-purple-pink font-display focus-visible:ring-ring inline-flex h-32 w-full items-center justify-center rounded-24 bg-clip-text text-base font-semibold text-transparent outline-none focus-visible:ring-3",children:"Upgrade plan"})]})})}const co=5;function fo(e,t=!0,n=!0){var u;const{data:r,loading:o,error:i,fetchMore:l,refetch:s}=tt(Jn,{skip:!e||!t,fetchPolicy:"cache-first",variables:{userId:e,bucketType:Xn.Group,sorter:fr,limit:co}}),a=(u=r==null?void 0:r.bucketsByUserId)==null?void 0:u.nextToken;return H(()=>{t&&n&&!o&&a&&e&&l({variables:{nextToken:a,limit:pr}}).catch(p=>{nn.warn("useGroupSidebarData: failed to fetch next page of groups:",p)})},[t,n,o,a,e,l]),{buckets:q(()=>{var p,f;return((f=(p=r==null?void 0:r.bucketsByUserId)==null?void 0:p.items)!=null?f:[]).filter(b=>!b.isBanned)},[r]),loading:o||n&&!!a&&!i,error:i,refetch:s}}function po(e,t,n){if(!e||e.bucketId!==t)return;if(n===void 0)return e.albumIds[0];const r=e.albumIds.indexOf(n);return r===-1?void 0:e.albumIds[r+1]}const go={isExpanded:()=>!1,toggle:()=>{},expand:()=>{}},dt=Ae(go);function ft(){return _e(dt)}function kn(e,t){const n=new Set(e);return t.reduce((o,i)=>n.has(i)?o:(n.add(i),!0),!1)?n:e}const mo={isOnSelectionPath:()=>!1,publishSelectionPath:()=>{}},Ln=Ae(mo),Yt=[];function En({children:e}){const{pathname:t}=ye(),[n,r]=K({path:Yt,route:t}),o=n.route===t?n.path:Yt,i=q(()=>({isOnSelectionPath:l=>o.includes(l),publishSelectionPath:l=>r(s=>s.route===t&&s.path.length===l.length&&s.path.every((a,c)=>a===l[c])?s:{path:l,route:t})}),[o,t]);return m(Ln.Provider,{value:i,children:e})}function Oe(){return _e(Ln)}const ho=24,bo=16,vo=88;function Mn(e){return Math.min(ho+e*bo,vo)}const yo=32;function xo(e){return Mn(e)+yo}const So=rn("flex h-40 w-full items-center gap-8 pr-8 text-base outline-none",{variants:{isActive:{true:"bg-brand-200 text-brand-700 font-display font-bold border-brand-700 border-r-2",false:"text-foreground font-text hover:bg-muted focus-within:bg-muted"},isOnSelectionPath:{true:"font-display font-bold",false:""}},defaultVariants:{isActive:!1,isOnSelectionPath:!1}});function wo(e,t){return e&&t&&"bg-gradient-sidebar-selected border-accent"}function zo({depth:e,label:t,count:n,isExpandable:r,isExpanded:o,isActive:i=!1,isOnSelectionPath:l=!1,rebrand:s=!1,onNavigate:a,onToggle:c,regionId:u,leading:p,action:f,onDragOver:b,onDragLeave:y,onDrop:h,isDropTarget:g=!1,isDropBlocked:d=!1}){return _("div",{onDragOver:b,onDragLeave:y,onDrop:h,className:Y("group",So({isActive:i,isOnSelectionPath:l||i}),wo(i,s),g&&"bg-brand-100 ring-2 ring-inset ring-brand-500",d&&"opacity-40"),children:[_("button",{type:"button",onClick:a,"aria-current":i?"page":void 0,style:{paddingLeft:"".concat(Mn(e),"px")}
1,className:"flex min-w-0 flex-1 items-center gap-8 py-8 text-left",children:[p&&m("span",{className:"flex size-24 shrink-0 items-center justify-center",children:p}),m("span",{title:t,className:"truncate",children:t}),n!==void 0&&_("span",{className:"shrink-0 text-sm whitespace-nowrap tabular-nums",children:["(",n,")"]})]}),f,r&&m("span",{className:"flex shrink-0 items-center pl-8",children:m("button",{type:"button",onClick:c,"aria-expanded":o,"aria-controls":o?u:void 0,"aria-label":o?"Collapse ".concat(t):"Expand ".concat(t),className:"text-foreground focus-visible:ring-ring inline-flex size-20 shrink-0 items-center justify-center rounded-4 outline-none focus-visible:ring-2",children:o?m(mr,{size:"small"}):m(gr,{size:"small"})})})]})}const Be=Vn(zo),Co='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.45 7L11.3902 4.76892C11.0852 4.1268 10.9327 3.80573 10.7052 3.57116C10.504 3.36373 10.2615 3.20597 9.99527 3.10931C9.69421 3 9.3532 3 8.67118 3H5.04C3.9759 3 3.44385 3 3.03742 3.21799C2.67991 3.40973 2.38925 3.71569 2.20709 4.09202C2 4.51984 2 5.0799 2 6.2V7
1M2 7H15.44C17.0361 7 17.8342 7 18.4439 7.32698C18.9801 7.6146 19.5 8.36197 19.5 9M2 7V16.2C2 17.8802 2 18.7202 2.31063 19.362C2.58387 19.9265 3.01987 20.3854 3.55613 20.673C4.16578 21 4.96385 21 6.56 21H15.44" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 19.3077L7.35409 11.5C7.83869 10.6538 8.63376 10 9.54427 10C10.4548 10 17.5902 10 21.3839 10C22.8074 10 23.2884 11.6018 22.8353 12.5C21.9817 14.1923 20.1669 17.8974 18.9339 19.7308C18.7442 20.1538 18.1372 21 17.2267 21C16.3162 21 8.50098 21 4.7072 21" stroke="currentColor" stroke-width="2"/></svg>';function Do(e){return m(et,M({svg:Co},e))}function Po(e,t){var b,y;const{bucketId:n}=Hn(),r=(b=on().currentUser)==null?void 0:b.uid,o=t!=null?t:n,i=tt(Qn,{skip:!o,variables:{bucketId:o!=null?o:"",albumId:e},fetchPolicy:"cache-first"}),l=(y=i.data)==null?void 0:y.bucketAlbums,s=l==null?void 0:l.nextToken,a=i.loading||!r||!o,c=i.fetchMore,{error:u,refetch:p}=i,f=q(()=>Ye.debounce(()=>{nn.info("fetching more albums",{nextToken:s}),s&&c({variables:{nextToken:s}})},300,{leading:!0}),[s,c]);return{bucketAlbums:l,loading:a,error:u,refetch:p,fetchMore:f,nextToken:s}}function Ge(e){return{paddingLeft:"".concat(xo(e),"px")}}function Tn({depth:e}){return _("div",{style:Ge(e),className:"text-muted-foreground flex h-36 items-center gap-8 pr-8",children:[m(br,{size:"small",className:"animate-spin"}),m("span",{className:"sr-only",children:"Loading"})]})}function Rn({depth:e,label:t}){return m("div",{style:Ge(e),className:"text-muted-foreground font-text flex h-36 items-center pr-8 text-sm whitespace-nowrap",children:t})}function Nn({depth:e,onRetry:t}){return _("div",{style:Ge(e),className:"text-muted-foreground font-text flex h-36 items-center gap-8 pr-8 text-sm whitespace-nowrap",children:[m("span",{children:"Couldn't load"}),m("button",{type:"button",onClick:t,className:"text-brand-600 underline outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-4",children:"Retry"})]})}function ko({depth:e,onClick:t}){return m("div",{style:Ge(e),className:"flex h-36 items-center pr-8",children:m("button",{type:"button",onClick:t,className:"text-brand-600 font-display text-sm font-semibold whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-4",children:"Show more"})})}function Lo(){const{mutation:e,loading:t}=vr(),{settings:n}=Zn(),r=j(n);return r.current=n,{moveMediaToAlbum:W((i,l,s)=>{if(!i||l.length===0)return;const a=r.current.sortBy?M({},r.current.sortBy):null,c=r.current.filterBy?M({},r.current.filterBy):null,u=Ye.isEmpty(a)?null:a,p=Ye.isEmpty(c)?null:c;return e({variables:{bucketId:i,mediaIds:l,data:{destinationAlbumId:s}},update:(f,{data:b})=>{b!=null&&b.bucketMediaMove&&b.bucketMediaMove.forEach(y=>{const h=f.readFragment({id:"BucketMedia:".concat(y),fragment:Ke});h&&(f.updateQuery({query:Dt,variables:{bucketId:i,albumId:h.albumId,filterBy:p,sortBy:u}},g=>{var x;if(!g)return null;const{bucketMediaByAlbumId:d}=g,v=(x=d==null?void 0:d.items)!=null?x:[];return{bucketMediaByAlbumId:I(M({},d),{items:v.filter(w=>w.id!==h.id)})}}),f.updateQuery({query:Dt,variables:{bucketId:i,albumId:s,filterBy:p,sortBy:u}},g=>{var x;if(!g)return null;const{bucketMediaByAlbumId:d}=g,v=(x=d==null?void 0:d.items)!=null?x:[];return{bucketMediaByAlbumId:I(M({},d),{items:[h,...v]})}}),f.updateFragment({id:"BucketMedia:".concat(y),fragment:Ke},g=>g?I(M({},g),{albumId:s}):null),f.updateFragment({id:"BucketAlbum:".concat(h.albumId),fragment:Pt},g=>{var v,x;if(!g)return null;const d=Math.max(((x=(v=g==null?void 0:g.counters)==null?void 0:v.totalMedia)!=null?x:0)-1,0);return I(M({},g),{counters:I(M({},g.counters),{totalMedia:d})})}),f.updateFragment({id:"BucketAlbum:".concat(s),fragment:Pt},g=>{var v,x;if(!g)return null;const d=((x=(v=g==null?void 0:g.counters)==null?void 0:v.totalMedia)!=null?x:0)+1;return I(M({},g),{counters:I(M({},g.counters),{totalMedia:d})})}))})}})},[e]),loading:t}}const An=Ae(()=>{});function Eo({children:e}){const{moveMediaToAlbum:t}=Lo();return m(An.Provider,{value:t,children:e})}function Mo(){return _e(An)}function pt(e,t){const n=Ie(Pe),r=an(),o=Mo(),[i,l]=K(!1),s=!!n&&n.sourceBucketId===e;return{onDragOver:p=>
1{if(!s)return;p.preventDefault();const{dataTransfer:f}=p;f.dropEffect="move",i||l(!0)},onDragLeave:p=>{p.relatedTarget instanceof Node&&p.currentTarget.contains(p.relatedTarget)||i&&l(!1)},onDrop:p=>{if(l(!1),!n||n.sourceBucketId!==e)return;p.preventDefault();const f=t!=null?t:null,b=n.mediaIds.filter(y=>{var g;const h=r.readFragment({id:"BucketMedia:".concat(y),fragment:Ke});return((g=h==null?void 0:h.albumId)!=null?g:null)!==f});Pe(null),b.length!==0&&o(e,b,f)},isDropTarget:s&&i,isDropBlocked:!!n&&!!e&&!s}}const To=600;function $e(e,t,n){const{isExpanded:r,expand:o}=n,i=Ie(Pe)!==null,l=j(void 0),s=W(()=>{l.current&&(clearTimeout(l.current),l.current=void 0)},[]),a=W(u=>{!i||!t||r(e)||l.current||(l.current=setTimeout(()=>{l.current=void 0,o(e)},To))},[i,t,r,e,o]),c=W(u=>{u.relatedTarget instanceof Node&&u.currentTarget.contains(u.relatedTarget)||s()},[s]);return H(()=>(i||s(),s),[i,s]),{onDragOver:a,onDragLeave:c}}function Ro({album:e,bucketId:t,depth:n,isSubalbum:r=!1,getAlbumHref:o,ancestorKeys:i=[],rebrand:l}){var G,U,P;const s=Le(),{pathname:a}=ye(),c=ft(),{isExpanded:u,toggle:p}=c,{isOnSelectionPath:f,publishSelectionPath:b}=Oe(),y="album:".concat(t,":").concat(e.id),h="album-".concat(t,"-").concat(e.id,"-region"),g=(P=(U=e.subAlbumCount)!=null?U:(G=e.counters)==null?void 0:G.totalSubalbums)!=null?P:0,d=g>0,v=u(y),x=o?o(t,e.id):"/bucket/".concat(t,"/album/").concat(e.id),w=pt(t,e.id),S=$e(y,d,c);let z=m(Xe,{size:"base","data-testid":"sidebar-album-icon"});r?z=m("span",{className:"size-4 shrink-0 rounded-full bg-muted-foreground","data-testid":"sidebar-album-bullet","aria-hidden":!0}):v&&d&&(z=m(Do,{size:"base","data-testid":"sidebar-album-open-icon"}));const C=k=>{w.onDragOver(k),S.onDragOver(k)},D=k=>{w.onDragLeave(k),S.onDragLeave(k)},L=a===x,E=q(()=>[...i,y],[i,y]);return Ze(function(){L&&b(E)},[L,E,b]),_(De,{children:[m(Be,{depth:n,label:e.title,count:d?g:void 0,isExpandable:d,isExpanded:v,isActive:L,isOnSelectionPath:f(y),rebrand:l,onNavigate:()=>s(x),onToggle:()=>p(y),regionId:h,onDragOver:C,onDragLeave:D,onDrop:w.onDrop,isDropTarget:w.isDropTarget,isDropBlocked:w.isDropBlocked,leading:z}),d&&v&&m(gt,{bucketId:t,albumId:e.id,depth:n+1,regionId:h,isSubalbum:!0,getAlbumHref:o,ancestorKeys:E,rebrand:l})]})}function gt({bucketId:e,albumId:t,depth:n,regionId:r,isSubalbum:o=!1,getAlbumHref:i,ancestorKeys:l=[],rebrand:s}){var v;const{reveal:a}=ft(),{bucketAlbums:c,loading:u,error:p,refetch:f,fetchMore:b,nextToken:y}=Po(t,e),h=(v=c==null?void 0:c.items)!=null?v:[],g=po(a,e,t),d=!!g&&!u&&!p&&!h.some(x=>x.id===g);return H(function(){d&&y&&b()},[d,y,b]),_("div",{id:r,children:[u&&m(Tn,{depth:n}),!u&&p&&m(Nn,{depth:n,onRetry:()=>f==null?void 0:f()}),!u&&!p&&h.length===0&&m(Rn,{depth:n,label:"No albums"}),h.map(x=>m(Ro,{album:x,bucketId:e,depth:n,isSubalbum:o,getAlbumHref:i,ancestorKeys:l,rebrand:s},x.id)),!u&&y&&m(ko,{depth:n,onClick:()=>b()})]})}function No(e,t){if(e===t)return!0;if(!e.startsWith("".concat(t,"/")))return!1;const[n,r]=e.slice(t.length+1).split("/");return!((n.toLowerCase()==="albums"||n.toLowerCase()==="album")&&r)}function Ao({bucket:e,depth:t,ancestorKeys:n=[],rebrand:r}){const o=Le(),{pathname:i}=ye(),l=ft(),{isExpanded:s,toggle:a}=l,{isOnSelectionPath:c,publishSelectionPath:u}=Oe(),p="bucket:".concat(e.id),f="bucket-".concat(e.id,"-region"),{albumCount:b}=hr(e.id),y=(b!=null?b:0)>0,h=s(p)&&y,g=pt(e.id,null),d=$e(p,y,l),v=D=>{g.onDragOver(D),d.onDragOver(D)},x=D=>{g.onDragLeave(D),d.onDragLeave(D)},w="/groups/".concat(e.id),S="/bucket/".concat(e.id),z=No(i,w)||i===S,C=q(()=>[...n,p],[n,p]);return Ze(function(){z&&u(C)},[z,C,u]),_(De,{children:[m(Be,{depth:t,label:e.title,count:y&&b!=null?b:void 0,isExpandable:y,isExpanded:h,isActive:z,isOnSelectionPath:c(p),rebrand:r,leading:m(qe,{size:"base","data-testid":"sidebar-group-icon"}),onNavigate:()=>o(w),onToggle:()=>a(p),regionId:f,onDragOver:v,onDragLeave:x,onDrop:g.onDrop,isDropTarget:g.isDropTarget,isDropBlocked:g.isDropBlocked}),h&&m(gt,{bucketId:e.id,depth:t+1,regionId:f,isSubalbum:!0,getAlbumHref:(D,L)=>"/groups/".concat(D,"/albums/").concat(L),ancestorKeys:C,rebrand:r})]})}function _o({buckets:e,loading:t,error:n,depth:r,refetch:o,limit:i,ancestorKeys:l=[],rebrand:s}){if(t&&e.length===0)return m(Tn,{depth:r});if(n&&e.length===0)return m(Nn,{depth:r,onRetry:o});if(e.length===0)return m(Rn,{depth:r,label:"No groups yet"});const a=i===void 0?e:e.slice(0,i);return m(De,{children:a.map(c=>m(Ao,{bucket:c,depth:r,ancestorKeys:l,rebrand:s},c.id))})}function We(e){return{target:e,chain:[],cursor:e,status:"walking"}}function _n(e,t,n=!1){var b,y;const{cache:r}=an(),[o,i]=K(()=>We(t)),l=o.target===t?o:We(t);H(function(){o.target!==t&&i(We(t))},[t,o.target]);
1const s=l.status==="walking"&&!!e&&!!l.cursor&&!n,a=s&&l.cursor?yr(r,l.cursor):null,{data:c,error:u}=tt(er,{skip:!s||!!a,fetchPolicy:"cache-first",variables:{bucketId:e!=null?e:"",albumId:(b=l.cursor)!=null?b:""}}),p=a!=null?a:c==null?void 0:c.bucketAlbum,f=p&&p.id===l.cursor?(y=xr(p))!=null?y:null:void 0;return H(function(){if(s){if(u){i(g=>I(M({},g),{status:"stopped"}));return}if(f!==void 0){if(f===null){i(g=>I(M({},g),{status:"resolved"}));return}i(g=>g.chain.includes(f)?I(M({},g),{status:"stopped"}):I(M({},g),{chain:[f,...g.chain],cursor:f}))}}},[f,u,s]),q(()=>({ancestorIds:l.chain,resolved:l.status==="resolved"}),[l])}const ie="groups",Kt="sidebar-groups-region",Io=[ie],qt=5;function Oo({isCollapsed:e,isDropBlocked:t=!1}){var T,O;const n=Le(),{pathname:r}=ye(),o=(O=(T=on().currentUser)==null?void 0:T.uid)!=null?O:"",{open:i}=dr(),l=nt("isGroupsyRebrandEnabled"),{isOnSelectionPath:s}=Oe(),a=r.startsWith("/groups/")&&r.slice(8).split("/")[0]||void 0,c=a?"/groups/".concat(a,"/albums/"):void 0,u=c&&r.startsWith(c)&&r.slice(c.length).split("/")[0]||void 0,p=!!u&&s("album:".concat(a,":").concat(u)),{ancestorIds:f,resolved:b}=_n(a,u,p),y=q(()=>b&&a&&u?{bucketId:a,albumIds:[...f,u]}:void 0,[b,a,u,f]),[h,g]=K(!1),[d,v]=K(()=>new Set),x=W(A=>d.has(A),[d]),w=W(A=>{v(B=>{const $=new Set(B);return $.has(A)?$.delete(A):$.add(A),$})},[]),S=W(A=>{v(B=>B.has(A)?B:new Set(B).add(A))},[]),z=q(()=>({isExpanded:x,toggle:w,expand:S,reveal:y}),[x,w,S,y]),C=$e(ie,!0,z),D=x(ie),L=or(),{buckets:E,loading:G,error:U,refetch:P}=fo(o,D,h),k=!!a&&D&&!G&&!E.some(A=>A.id===a);H(function(){a&&(k&&g(!0),v(B=>{const $="bucket:".concat(a);return B.has(ie)&&B.has($)?B:new Set(B).add(ie).add($)}))},[a,k]),H(function(){!a||f.length===0||v(B=>kn(B,f.map($=>"album:".concat(a,":").concat($))))},[f,a]);const N=r==="/groups";return e?m("button",{type:"button","aria-label":"Groups","aria-current":N?"page":void 0,onClick:()=>n("/groups"),className:Y("flex h-40 w-full items-center justify-center outline-none focus-visible:bg-muted",N?"bg-brand-200 text-brand-700":"text-foreground hover:bg-muted"),children:m(qe,{size:"base"})}):_(dt.Provider,{value:z,children:[m(Be,{depth:0,label:"Groups",count:L,isExpandable:!0,isExpanded:D,isActive:N,isOnSelectionPath:s(ie),rebrand:l,onNavigate:()=>n("/groups"),onToggle:()=>w(ie),regionId:Kt,onDragOver:C.onDragOver,onDragLeave:C.onDragLeave,isDropBlocked:t,leading:m(qe,{size:"base"}),action:m(ln,{size:"xs","aria-label":"Create a group",icon:m(un,{size:"base"}),onClick:()=>i(),className:"bg-brand-700 text-white hover:bg-brand-700/90"})}),D&&_("div",{id:Kt,children:[m(_o,{buckets:E,loading:G,error:U,depth:1,refetch:P,limit:h?void 0:qt,ancestorKeys:Io,rebrand:l}),!U&&!h&&Math.max(L!=null?L:0,E.length)>qt&&m("div",{style:{paddingLeft:"40px"},className:"py-4",children:_("button",{type:"button",onClick:()=>g(!0),className:"text-brand-700 font-display inline-flex items-center gap-4 text-xs font-bold uppercase whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-4",children:["Expand all groups",m(zr,{size:"xsmall"})]})})]})]})}function Bo(e){return m(En,{children:m(Oo,{isCollapsed:e.isCollapsed,isDropBlocked:e.isDropBlocked})})}const ae="albums",Ue="sidebar-albums-region",Go=[ae];function $o({isCollapsed:e,isDropBlocked:t=!1}){const n=Le(),{pathname:r}=ye(),o=sn(),i=nt("isGroupsyRebrandEnabled"),{isOnSelectionPath:l}=Oe(),{open:s}=Sr(),a=r==="/library/albums",c=ir(o),u="/library/albums/",p=r.startsWith(u)?r.slice(u.length).split("/")[0]:void 0,f=!!p&&l("album:".concat(o,":").concat(p)),{ancestorIds:b,resolved:y}=_n(o,p,f),h=q(()=>y&&o&&p?{bucketId:o,albumIds:[...b,p]}:void 0,[y,o,p,b]),[g,d]=K(()=>new Set),v=W(D=>g.has(D),[g]),x=W(D=>{d(L=>{const E=new Set(L);return E.has(D)?E.delete(D):E.add(D),E})},[]),w=W(D=>{d(L=>L.has(D)?L:new Set(L).add(D))},[]),S=q(()=>({isExpanded:v,toggle:x,expand:w,reveal:h}),[v,x,w,h]),z=$e(ae,!0,S);if(H(function(){p&&d(L=>{if(L.has(ae))return L;const E=new Set(L);return E.add(ae),E})},[p]),H(function(){!o||b.length===0||d(L=>kn(L,b.map(E=>"album:".concat(o,":").concat(E))))},[b,o]),e)return m("button",{type:"button","aria-label":"Albums","aria-current":a?"page":void 0,onClick:()=>n("/library/albums"),className:Y("flex h-40 w-full items-center justify-center outline-none focus-visible:bg-muted",a?"bg-brand-200 text-brand-700":"text-foreground hover:bg-muted"),children:m(Xe,{size:"base"})});const C=v(ae);return _(dt.Provider,{value:S,children:[m(Be,{depth:0,label:"Albums",count:c,isExpandable:!0,isExpanded:C,isActive:a,isOnSelectionPath:l(ae),rebrand:i,onNavigate:()=>n("/library/albums"),onToggle:()=>x(ae),regionId:Ue,onDragOver:z.onDragOver,onDragLeave:z.onDragLeave,isDropBlocked:t,leading:m(Xe,{size:"base"}),action:m(ln,{size:"xs","aria-label":"Create an album",icon:m(un,{size:"base"}),onClick:()=>s(),className:"bg-brand-700 text-white hover:bg-brand-700/90"})}),C&&o&&m("div",{id:Ue,children:m(gt,{bucketId:o,depth:1,regionId:Ue,getAlbumHref:(D,L)=>"/library/albums/".concat(L),ancestorKeys:Go,rebrand:i})})]})}function Fo(e){return m(En,{children:m($o,{isCollapsed:e.isCollapsed,isDropBlocked:e.isDropBlocked})})}function jo(){var t;const e=Ie(Pe);return{isDragging:e!==null,sourceBucketId:(t=e==null?void 0:e.sourceBucketId)!=null?t:null}}const ge=48,Xt=18;function Wo(){const e=Ie(Pe)!==null,t=j(null),n=j(0),r=j(void 0),o=W(()=>{n.current=0,r.current!==void 0&&(cancelAnimationFrame(r.current),r.current=void 0)},[]),i=W(()=>{const a=t.current;if(!a||n.current===0){r.current=void 0;return}a.scrollTop+=n.current,r.current=requestAnimationFrame(i)},[]),l=W(a=>{const c=t.current;if(!c||!e)return;const u=c.getBoundingClientRect(),{clientY:p}=a;let f=0;p<u.top+ge?f=-Math.ceil((u.top+ge-p)/ge*Xt):p>u.bottom-ge&&(f=Math.ceil((p-(u.bottom-ge))/ge*Xt)),n.current=f,f!==0&&r.current===void 0&&(r.current=requestAnimationFrame(i))},[e,i]),s=W(a=>{a.relatedTarget instanceof Node&&a.currentTarget.contains(a.relatedTarget)||o()},[o]);return H(()=>(e||o(),o),[e,o]),{scrollRef:t,onDragOver:l,onDragLeave:s}}function Uo({isCollapsed:e,onClick:t}){return m("div",{className:Y("flex w-full items-center",e?"justify-center":"justify-end pr-16"),children:m("button",{type:"button",onClick:t,"aria-label":e?"Expand navigation":"Collapse navigation","aria-expanded":!e,className:"text-foreground hover:bg-muted focus-visible:ring-ring inline-flex size-32 items-center justify-center rounded-8 outline-none focus-visible:ring-3",children:m(Dr,{size:"base",className:Y(e&&"scale-x-[-1]")})})})}const Jt=rn("flex h-40 items-center text-base outline-none focus-visible:bg-muted",{variants:{isActive:{true:"bg-brand-200 text-brand-700 font-display font-bold",false:"text-foreground font-text hover:bg-muted"},isCollapsed:{true:"w-full justify-center px-0",false:"w-full gap-8 pr-8 pl-24"}},compoundVariants:[{isActive:!0,isCollapsed:!1,className:"border-brand-700 border-r-2"}],defaultVariants:{isActive:!1,isCollapsed:!1}});function Qt(e,t,n){return!e||!n?!1:Y("bg-gradient-sidebar-selected",!t&&"border-accent")}function ze({icon:e,label:t,count:n,isActive:r=!1,isCollapsed:o,onClick:i,rebrand:l,onDragOver:s,onDragLeave:a,onDrop:c,isDropTarget:u=!1,isBlocked:p=!1}){const f=Y(u&&"bg-brand-100 ring-2 ring-inset ring-brand-500",p&&"opacity-40");return o?m("button",{type:"button","aria-label":t,"aria-current":r?"page":void 0,onClick:i,onDragOver:s,onDragLeave:a,onDrop:c,className:Y(Jt({isActive:r,isCollapsed:!0}),Qt(r,!0,l),f),children:m(e,{size:"base"})}):_("button",{type:"button","aria-current":r?"page":void 0,onClick:i,onDragOver:s,onDragLeave:a,onDrop:c,className:Y(Jt({isActive:r,isCollapsed:!1}),Qt(r,!1,l),f),children:[m(e,{size:"base"}),_("span",{className:"flex-1 truncate text-left",children:[t,n!==void 0&&" (".concat(n,")")]})]})}function Vo({libraryId:e,isActive:t,isCollapsed:n,onNavigate:r,rebrand:o}){const i=pt(e!=null?e:"",null);return m(ze,{icon:sr,label:"My Uploads",isActive:t,isCollapsed:n,onClick:r,rebrand:o,onDragOver:i.onDragOver,onDragLeave:i.onDragLeave,onDrop:i.onDrop,isDropTarget:i.isDropTarget,isBlocked:i.isDropBlocked})}function Zt({label:e,isBlocked:t=!1}){return m("div",{className:Y("text-foreground font-text pt-16 pr-0 pb-0 pl-24 text-sm font-bold tracking-wide uppercase",t&&"opacity-40"),children:e})}function Ve(){return m("div",{className:"bg-border h-px w-full shrink-0",role:"separator"})}const en="text-foreground font-text hover:bg-muted focus-visible:ring-ring py-4 pr-24 pl-24 text-base no-underline outline-none focus-visible:ring-2";function He({to:e,href:t,target:n,children:r}){return e!==void 0?m(Yn,{to:e,className:en,children:r}):m("a",{href:t,target:n,rel:n==="_blank"?"noopener noreferrer":void 0,className:en,children:r})}function Ho({isCollapsed:e,onToggleCollapse:t}){const{pathname:n}=ye(),r=Le(),o=nt("isGroupsyRebrandEnabled"),i=n.startsWith("/groups"),l=n==="/library/albums"||n.startsWith("/library/albums/"),s=n.startsWith("/library/trash"),a=n.startsWith("/library/links"),c=n.startsWith("/library/favorites"),u=(n==="/library"||n.startsWith("/library/"))&&!l&&!s&&!a&&!c,p=sn(),{scrollRef:f,onDragOver:b,onDragLeave:y}=Wo(),{isDragging:h,sourceBucketId:g}=jo(),d=h&&!!p&&g===p,v=h&&!!p&&g!==p;return _("nav",{"aria-label":o?"Groupsy navigation":"Photobucket navigation",className:"flex h-full flex-col pt-32 pb-24",children:[m(Uo,{isCollapsed:e,onClick:t}),m("div",{ref:f,onDragOver:b,onDragLeave:y,className:"flex-1 overflow-y-auto overflow-x-hidden",children:_(Eo,{children:[m(ze,{icon:ar,label:"Home",isActive:!i&&!u&&!l&&!a&&!s&&!c,isCollapsed:e,onClick:()=>r("/home"),rebrand:o,isBlocked:h}),m(Ve,{}),!e&&m(Zt,{label:"Library",isBlocked:v}
1),m(Vo,{libraryId:p,isActive:u,isCollapsed:e,onNavigate:()=>r("/library"),rebrand:o}),m(Fo,{isCollapsed:e,isDropBlocked:v}),m(ze,{icon:lr,label:"Public Links",isActive:a,isCollapsed:e,onClick:()=>r("/library/links"),rebrand:o}),m(ze,{icon:ur,label:"Favorites",isActive:c,isCollapsed:e,onClick:()=>r("/library/favorites"),rebrand:o,isBlocked:h}),m(ze,{icon:cr,label:"Recently Deleted",isActive:s,isCollapsed:e,onClick:()=>r("/library/trash"),rebrand:o,isBlocked:h}),m(Ve,{}),!e&&m(Zt,{label:"Groups",isBlocked:d}),m(Bo,{isCollapsed:e,isDropBlocked:d}),m(Ve,{}),!e&&_("div",{className:"flex flex-col gap-8 py-8",children:[m(He,{href:tr.CONTACT_US,target:"_blank",children:"Submit Feedback"}),m(He,{to:kt.PRIVACY_POLICY,children:"Privacy Policy"}),m(He,{to:kt.TERMS_OF_SERVICE,children:"Terms of Use"})]})]})}),!e&&m(uo,{})]})}const Yo="(min-width: 1200px)";function Ui(){const e=oo(),[t,n]=K(!1),r=()=>{const i=e.current;i&&(i.isCollapsed()?i.expand():i.collapse())};return nr(Yo)?_(De,{children:[_(ao,{orientation:"horizontal",className:"h-full",children:[m(Ht,{panelRef:e,defaultSize:"236px",minSize:"200px",maxSize:"400px",collapsible:!0,collapsedSize:"64px",onResize:()=>{var l,s;const i=(s=(l=e.current)==null?void 0:l.isCollapsed())!=null?s:!1;n(a=>a===i?a:i)},children:m(Ho,{isCollapsed:t,onToggleCollapse:r})}),m(so,{}),m(Ht,{className:"pt-16",children:m("main",{className:"h-full overflow-y-auto",children:m(Ct,{})})})]}),m(Et,{})]}):_(De,{children:[m(Ct,{}),m(Et,{})]})}export{Ui as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.