| 213 | | `,Er=16,Mu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=du(r,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Lu(p,m);return h.createElement(Ru,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Iu:"",style:g},u.type==="custom"?Cr(u.message,u):o?o(u):h.createElement(Ou,{toast:u,position:p}))}))},q=ne;const $a={carousel:"carousel",grid:"grid"},zu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:$a.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Du=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Ba=[{label:"Horizontal",value:"horizontal"}],Fu=[{label:"Vertical",value:"vertical"}],$u=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],Bu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Ua={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ha=y.createContext&&y.createContext(Ua),Uu=["attr","size","title"];function Hu(e,t){if(e==null)return{};var r=Vu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Vu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tr.apply(this,arguments)}function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){Wu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wu(e,t,r){return t=Gu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gu(e){var t=qu(e,"string");return typeof t=="symbol"?t:t+""}function qu(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wa(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),Wa(t.child)))}function V(e){return t=>y.createElement(Ku,Tr({attr:Ar({},e.attr)},t),Wa(e.child))}function Ku(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Hu(e,Uu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return Ha!==void 0?y.createElement(Ha.Consumer,null,r=>t(r)):t(Ua)}function Yu(e){return V({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function bt(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function _t(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Kt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Yt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function Xu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function Ju(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function tt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function Zu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function Ga(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function Qu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function Xt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function qa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=qa(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():qa(e[o],null)}}}}function Y(...e){return h.useCallback(Bn(...e),e)}function rt(e){const t=tp(e),r=h.forwardRef((n,o)=>{const{children:i,...s}=n,l=h.Children.toArray(i),c=l.find(np);if(c){const d=c.props.children,u=l.map(p=>p===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var ep=rt("Slot");function tp(e){const t=h.forwardRef((r,n)=>{const{children:o,...i}=r;if(h.isValidElement(o)){const s=ap(o),l=op(i,o.props);return o.type!==h.Fragment&&(l.ref=n?Bn(n,s):s),h.cloneElement(o,l)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rp=Symbol("radix.slottable");function np(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rp}function op(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function ap(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ka(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Ka(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ip(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ka(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return ip(e)}const sp="ecr-button",lp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},cp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function oe({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?ep:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:D(sp,lp[t],cp[r],e),...o})}function dp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(oe,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(oe,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:l=>o(l.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(oe,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Xt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(Ga,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(oe,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(_t,{})," ","Create Group"]}):null]})]})}function up(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function pp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function nt(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function mp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function fp({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const Ya=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),yt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function Un(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Hn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Vn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Wn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const hp="Left",gp="Right",xp="Up",vp="Down",wt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Gn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Xa="mousemove",Ja="mouseup",bp="touchend",_p="touchmove",yp="touchstart";function Sp(e,t,r,n){return e>t?r>0?gp:hp:n>0?vp:xp}function Za(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function jp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(Xa,n),document.addEventListener(Ja,s));const{clientX:v,clientY:f}=p?u.touches[0]:u,x=Za([v,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Gn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:v,clientY:f}=g?u.touches[0]:u,[x,_]=Za([v,f],m.rotationAngle),b=x-p.xy[0],w=_-p.xy[1],S=Math.abs(b),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(S*S+C*C)/(N||1),E=[b/(N||1),w/(N||1)],T=Sp(S,C,b,w),R=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||wt.delta;if(S<R&&C<R&&!p.swiping)return p;const I={absX:S,absY:C,deltaX:b,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};I.first&&m.onSwipeStart&&m.onSwipeStart(I),m.onSwiping&&m.onSwiping(I);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:I,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const v=m[`onSwiped${g.dir}`];v&&v(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Gn),{eventData:g})})},i=()=>{document.removeEventListener(Xa,n),document.removeEventListener(Ja,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},wt.touchEventOptions),p.touchEventOptions),v=[[yp,r,g],[_p,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[bp,o,g]];v.forEach(([f,x,_])=>u.addEventListener(f,x,_)),m=()=>v.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Cp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function kp(e){const{trackMouse:t}=e,r=h.useRef(Object.assign({},Gn)),n=h.useRef(Object.assign({},wt)),o=h.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},wt),e);let i;for(i in wt)n.current[i]===void 0&&(n.current[i]=wt[i]);const[s,l]=h.useMemo(()=>jp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Cp(r.current,n.current,o.current,l),s}const Np=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},Qa=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const _=p.current[x];_&&(i?_.play():_.pause(),s(b=>!b))},g=x=>{const _=p.current[x];_&&(_.muted=!d,u(b=>!b))},v=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=kp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{v&&c()},onSwipedDown:()=>{if(v){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((x,_)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Np,{videoRefs:p,file:x,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Un,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Hn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)}):a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)})]})]})},_))})},Ep=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(yt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Kt,{size:24})}):null,r.index<u-1?a.jsx(yt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Yt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(Ya,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Xt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(Qa,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Tp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ap(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Pp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Op(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ei(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Rp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Lp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Ip(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Mp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}function ti(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function zp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Dp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function Fp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function $p(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}const Bp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Up=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Bp(r?.[e.id]??e.view_count)}),a.jsx(Ju,{size:14})]})]})},qn=y.memo(Up);function Hp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(qn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(oe,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx($p,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(oe,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(oe,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(ti,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:D("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(oe,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Rp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Lp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Vp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Hp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const Jt=({cb:e})=>{const t=je(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(up,{size:24})})};function Wp(e){return V({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const Zt=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Wp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(Qu,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),St=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),jt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Gp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Gp,{}),"ReelsWP"]});function ri(e,t){return function(){return e.apply(t,arguments)}}const{toString:qp}=Object.prototype,{getPrototypeOf:Kn}=Object,{iterator:Mr,toStringTag:ni}=Symbol,zr=(e=>t=>{const r=qp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ve=e=>(e=e.toLowerCase(),t=>zr(t)===e),Dr=e=>t=>typeof t===e,{isArray:Ct}=Array,kt=Dr("undefined");function Qt(e){return e!==null&&!kt(e)&&e.constructor!==null&&!kt(e.constructor)&&ce(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const oi=ve("ArrayBuffer");function Kp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&oi(e.buffer),t}const Yp=Dr("string"),ce=Dr("function"),ai=Dr("number"),er=e=>e!==null&&typeof e=="object",Xp=e=>e===!0||e===!1,Fr=e=>{if(zr(e)!=="object")return!1;const t=Kn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ni in e)&&!(Mr in e)},Jp=e=>{if(!er(e)||Qt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Zp=ve("Date"),Qp=ve("File"),em=ve("Blob"),tm=ve("FileList"),rm=e=>er(e)&&ce(e.pipe),nm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ce(e.append)&&((t=zr(e))==="formdata"||t==="object"&&ce(e.toString)&&e.toString()==="[object FormData]"))},om=ve("URLSearchParams"),[am,im,sm,lm]=["ReadableStream","Request","Response","Headers"].map(ve),cm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tr(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Qt(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function ii(e,t){if(Qt(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,si=e=>!kt(e)&&e!==ot;function Yn(){const{caseless:e,skipUndefined:t}=si(this)&&this||{},r={},n=(o,i)=>{const s=e&&ii(r,i)||i;Fr(r[s])&&Fr(o)?r[s]=Yn(r[s],o):Fr(o)?r[s]=Yn({},o):Ct(o)?r[s]=o.slice():(!t||!kt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&tr(arguments[o],n);return r}const dm=(e,t,r,{allOwnKeys:n}={})=>(tr(t,(o,i)=>{r&&ce(o)?e[i]=ri(o,r):e[i]=o},{allOwnKeys:n}),e),um=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},mm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Kn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},fm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},hm=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!ai(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},gm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Kn(Uint8Array)),xm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},vm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},bm=ve("HTMLFormElement"),_m=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),li=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ym=ve("RegExp"),ci=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};tr(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},wm=e=>{ci(e,(t,r)=>{if(ce(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ce(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},jm=()=>{},Cm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function km(e){return!!(e&&ce(e.append)&&e[ni]==="FormData"&&e[Mr])}const Nm=e=>{const t=new Array(10),r=(n,o)=>{if(er(n)){if(t.indexOf(n)>=0)return;if(Qt(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return tr(n,(s,l)=>{const c=r(s,o+1);!kt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},Em=ve("AsyncFunction"),Tm=e=>e&&(er(e)||ce(e))&&ce(e.then)&&ce(e.catch),di=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:i})=>{o===ot&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ce(ot.postMessage)),Am=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||di,j={isArray:Ct,isArrayBuffer:oi,isBuffer:Qt,isFormData:nm,isArrayBufferView:Kp,isString:Yp,isNumber:ai,isBoolean:Xp,isObject:er,isPlainObject:Fr,isEmptyObject:Jp,isReadableStream:am,isRequest:im,isResponse:sm,isHeaders:lm,isUndefined:kt,isDate:Zp,isFile:Qp,isBlob:em,isRegExp:ym,isFunction:ce,isStream:rm,isURLSearchParams:om,isTypedArray:gm,isFileList:tm,forEach:tr,merge:Yn,extend:dm,trim:cm,stripBOM:um,inherits:pm,toFlatObject:mm,kindOf:zr,kindOfTest:ve,endsWith:fm,toArray:hm,forEachEntry:xm,matchAll:vm,isHTMLForm:bm,hasOwnProperty:li,hasOwnProp:li,reduceDescriptors:ci,freezeMethods:wm,toObjectSet:Sm,toCamelCase:_m,noop:jm,toFiniteNumber:Cm,findKey:ii,global:ot,isContextDefined:si,isSpecCompliantForm:km,toJSONObject:Nm,isAsyncFn:Em,isThenable:Tm,setImmediate:di,asap:Am,isIterable:e=>e!=null&&ce(e[Mr])};function B(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}j.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}});const ui=B.prototype,pi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{pi[e]={value:e}}),Object.defineProperties(B,pi),Object.defineProperty(ui,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,i)=>{const s=Object.create(ui);j.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return B.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Pm=null;function Xn(e){return j.isPlainObject(e)||j.isArray(e)}function mi(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function fi(e,t,r){return e?e.concat(t).map(function(o,i){return o=mi(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Om(e){return j.isArray(e)&&!e.some(Xn)}const Rm=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,r){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=j.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,x){return!j.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(o))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(j.isDate(v))return v.toISOString();if(j.isBoolean(v))return v.toString();if(!c&&j.isBlob(v))throw new B("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(v)||j.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function u(v,f,x){let _=v;if(v&&!x&&typeof v=="object"){if(j.endsWith(f,"{}"))f=n?f:f.slice(0,-2),v=JSON.stringify(v);else if(j.isArray(v)&&Om(v)||(j.isFileList(v)||j.endsWith(f,"[]"))&&(_=j.toArray(v)))return f=mi(f),_.forEach(function(w,S){!(j.isUndefined(w)||w===null)&&t.append(s===!0?fi([f],S,i):s===null?f:f+"[]",d(w))}),!1}return Xn(v)?!0:(t.append(fi(x,f,i),d(v)),!1)}const p=[],m=Object.assign(Rm,{defaultVisitor:u,convertValue:d,isVisitable:Xn});function g(v,f){if(!j.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(v),j.forEach(v,function(_,b){(!(j.isUndefined(_)||_===null)&&o.call(t,_,j.isString(b)?b.trim():b,f,m))===!0&&g(_,f?f.concat(b):[b])}),p.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return g(e),t}function hi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Jn(e,t){this._pairs=[],e&&$r(e,this,t)}const gi=Jn.prototype;gi.append=function(t,r){this._pairs.push([t,r])},gi.toString=function(t){const r=t?function(n){return t.call(this,n,hi)}:hi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Lm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xi(e,t,r){if(!t)return e;const n=r&&r.encode||Lm;j.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=j.isURLSearchParams(t)?t.toString():new Jn(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class vi{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(n){n!==null&&t(n)})}}const bi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Im={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Jn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Zn=typeof window<"u"&&typeof document<"u",Qn=typeof navigator=="object"&&navigator||void 0,Mm=Zn&&(!Qn||["ReactNative","NativeScript","NS"].indexOf(Qn.product)<0),zm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dm=Zn&&window.location.href||"http://localhost",se={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zn,hasStandardBrowserEnv:Mm,hasStandardBrowserWebWorkerEnv:zm,navigator:Qn,origin:Dm},Symbol.toStringTag,{value:"Module"})),...Im};function Fm(e,t){return $r(e,new se.classes.URLSearchParams,{visitor:function(r,n,o,i){return se.isNode&&j.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function $m(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Bm(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function _i(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&j.isArray(o)?o.length:s,c?(j.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!j.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&j.isArray(o[s])&&(o[s]=Bm(o[s])),!l)}if(j.isFormData(e)&&j.isFunction(e.entries)){const r={};return j.forEachEntry(e,(n,o)=>{t($m(n),o,r,0)}),r}return null}function Um(e,t,r){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const rr={transitional:bi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=j.isObject(t);if(i&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return o?JSON.stringify(_i(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Fm(t,this.formSerializer).toString();if((l=j.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $r(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Um(t)):t}],transformResponse:[function(t){const r=this.transitional||rr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?B.from(l,B.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:se.classes.FormData,Blob:se.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{rr.headers[e]={}});const Hm=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vm=e=>{const t={};let r,n,o;return e&&e.split(` |
| 214 | | `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Hm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},yi=Symbol("internals");function nr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:j.isArray(e)?e.map(Br):String(e)}function Wm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Gm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eo(e,t,r,n,o){if(j.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!j.isString(t)){if(j.isString(n))return t.indexOf(n)!==-1;if(j.isRegExp(n))return n.test(t)}}function qm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Km(e,t){const r=j.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=nr(c);if(!u)throw new Error("header name must be a non-empty string");const p=j.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const s=(l,c)=>j.forEach(l,(d,u)=>i(d,u,c));if(j.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(j.isString(t)&&(t=t.trim())&&!Gm(t))s(Vm(t),r);else if(j.isObject(t)&&j.isIterable(t)){let l={},c,d;for(const u of t){if(!j.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?j.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=nr(t),t){const n=j.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Wm(o);if(j.isFunction(r))return r.call(this,o,n);if(j.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=nr(t),t){const n=j.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||eo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=nr(s),s){const l=j.findKey(n,s);l&&(!r||eo(n,n[l],l,r))&&(delete n[l],o=!0)}}return j.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||eo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return j.forEach(this,(o,i)=>{const s=j.findKey(n,i);if(s){r[s]=Br(o),delete r[i];return}const l=t?qm(i):String(i).trim();l!==i&&delete r[i],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return j.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&j.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` |
| 215 | | `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[yi]=this[yi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=nr(s);n[l]||(Km(o,s),n[l]=!0)}return j.isArray(t)?t.forEach(i):i(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),j.freezeMethods(de);function to(e,t){const r=this||rr,n=t||r,o=de.from(n.headers);let i=n.data;return j.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function wi(e){return!!(e&&e.__CANCEL__)}function Nt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}j.inherits(Nt,B,{__CANCEL__:!0});function Si(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ym(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xm(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Jm(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=Xm(50,250);return Jm(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},ji=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ci=e=>(...t)=>j.asap(()=>e(...t)),Zm=se.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,se.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(se.origin),se.navigator&&/(msie|trident)/i.test(se.navigator.userAgent)):()=>!0,Qm=se.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];j.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),j.isString(n)&&l.push(`path=${n}`),j.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),j.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ef(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ki(e,t,r){let n=!ef(t);return e&&(n||r==!1)?tf(e,t):t}const Ni=e=>e instanceof de?{...e}:e;function at(e,t){t=t||{};const r={};function n(d,u,p,m){return j.isPlainObject(d)&&j.isPlainObject(u)?j.merge.call({caseless:m},d,u):j.isPlainObject(u)?j.merge({},u):j.isArray(u)?u.slice():u}function o(d,u,p,m){if(j.isUndefined(u)){if(!j.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!j.isUndefined(u))return n(void 0,u)}function s(d,u){if(j.isUndefined(u)){if(!j.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Ni(d),Ni(u),p,!0)};return j.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);j.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Ei=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=de.from(s),t.url=xi(ki(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),j.isFormData(r)){if(se.hasStandardBrowserEnv||se.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(j.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(se.hasStandardBrowserEnv&&(n&&j.isFunction(n)&&(n=n(t)),n||n!==!1&&Zm(t.url))){const c=o&&i&&Qm.read(i);c&&s.set(o,c)}return t},rf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ei(e);let i=o.data;const s=de.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,v;function f(){g&&g(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function _(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Si(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=_:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(_)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(S){const C=S&&S.message?S.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=S||null,n(N),x=null},x.ontimeout=function(){let S=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||bi;o.timeoutErrorMessage&&(S=o.timeoutErrorMessage),n(new B(S,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},i===void 0&&s.setContentType(null),"setRequestHeader"in x&&j.forEach(s.toJSON(),function(S,C){x.setRequestHeader(C,S)}),j.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),l&&l!=="json"&&(x.responseType=o.responseType),d&&([m,v]=Ur(d,!0),x.addEventListener("progress",m)),c&&x.upload&&([p,g]=Ur(c),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new Nt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const b=Ym(o.url);if(b&&se.protocols.indexOf(b)===-1){n(new B("Unsupported protocol "+b+":",B.ERR_BAD_REQUEST,e));return}x.send(i||null)})},nf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new Nt(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>j.asap(l),c}},of=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},af=async function*(e,t){for await(const r of sf(e))yield*of(r,t)},sf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ti=(e,t,r,n)=>{const o=af(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Ai=64*1024,{isFunction:Hr}=j,lf=(({Request:e,Response:t})=>({Request:e,Response:t}))(j.global),{ReadableStream:Pi,TextEncoder:Oi}=j.global,Ri=(e,...t)=>{try{return!!e(...t)}catch{return!1}},cf=e=>{e=j.merge.call({skipUndefined:!0},lf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",i=Hr(r),s=Hr(n);if(!o)return!1;const l=o&&Hr(Pi),c=o&&(typeof Oi=="function"?(v=>f=>v.encode(f))(new Oi):async v=>new Uint8Array(await new r(v).arrayBuffer())),d=i&&l&&Ri(()=>{let v=!1;const f=new r(se.origin,{body:new Pi,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!f}),u=s&&l&&Ri(()=>j.isReadableStream(new n("").body)),p={stream:u&&(v=>v.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!p[v]&&(p[v]=(f,x)=>{let _=f&&f[v];if(_)return _.call(f);throw new B(`Response type '${v}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async v=>{if(v==null)return 0;if(j.isBlob(v))return v.size;if(j.isSpecCompliantForm(v))return(await new r(se.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(j.isArrayBufferView(v)||j.isArrayBuffer(v))return v.byteLength;if(j.isURLSearchParams(v)&&(v=v+""),j.isString(v))return(await c(v)).byteLength},g=async(v,f)=>{const x=j.toFiniteNumber(v.getContentLength());return x??m(f)};return async v=>{let{url:f,method:x,data:_,signal:b,cancelToken:w,timeout:S,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:R}=Ei(v),I=t||fetch;k=k?(k+"").toLowerCase():"text";let A=nf([b,w&&w.toAbortSignal()],S),L=null;const M=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await g(E,_))!==0){let Z=new r(f,{method:"POST",body:_,duplex:"half"}),pe;if(j.isFormData(_)&&(pe=Z.headers.get("content-type"))&&E.setContentType(pe),Z.body){const[Fe,he]=ji($,Ur(Ci(N)));_=Ti(Z.body,Ai,Fe,he)}}j.isString(T)||(T=T?"include":"omit");const O=i&&"credentials"in r.prototype,U={...R,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:O?T:void 0};L=i&&new r(f,U);let P=await(i?I(L,R):I(f,U));const G=u&&(k==="stream"||k==="response");if(u&&(C||G&&M)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const pe=j.toFiniteNumber(P.headers.get("content-length")),[Fe,he]=C&&ji(pe,Ur(Ci(C),!0))||[];P=new n(Ti(P.body,Ai,Fe,()=>{he&&he(),M&&M()}),Z)}k=k||"text";let X=await p[j.findKey(p,k)||"text"](P,v);return!G&&M&&M(),await new Promise((Z,pe)=>{Si(Z,pe,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:v,request:L})})}catch(O){throw M&&M(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,v,L),{cause:O.cause||O}):B.from(O,O&&O.code,v,L)}}},df=new Map,Li=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=df;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:cf(t)),u=d;return d};Li();const ro={http:Pm,xhr:rf,fetch:{get:Li}};j.forEach(ro,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ii=e=>`- ${e}`,uf=e=>j.isFunction(e)||e===null||e===!1;function pf(e,t){e=j.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!uf(n)&&(o=ro[(l=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${l}'`);if(o&&(j.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since : |
| 216 | | `+s.map(Ii).join(` |
| 217 | | `):" "+Ii(s[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Mi={getAdapter:pf,adapters:ro};function no(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function zi(e){return no(e),e.headers=de.from(e.headers),e.data=to.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Mi.getAdapter(e.adapter||rr.adapter,e)(e).then(function(n){return no(e),n.data=to.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return wi(n)||(no(e),n&&n.response&&(n.response.data=to.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const Di="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Fi={};Vr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Di+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new B(o(s," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Fi[s]&&(Fi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function mf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new B("option "+i+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+i,B.ERR_BAD_OPTION)}}const Wr={assertOptions:mf,validators:Vr},ke=Wr.validators;let it=class{constructor(t){this.defaults=t||{},this.interceptors={request:new vi,response:new vi}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` |
| 218 | | `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(j.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&j.merge(i.common,i[r.method]);i&&j.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),r.headers=de.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const v=[zi.bind(this),void 0];for(v.unshift(...l),v.push(...d),m=v.length,u=Promise.resolve(r);p<m;)u=u.then(v[p++],v[p++]);return u}m=l.length;let g=r;for(;p<m;){const v=l[p++],f=l[p++];try{g=v(g)}catch(x){f.call(this,x);break}}try{u=zi.call(this,g)}catch(v){return Promise.reject(v)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=at(this.defaults,t);const r=ki(t.baseURL,t.url,t.allowAbsoluteUrls);return xi(r,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){it.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),j.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}it.prototype[t]=r(),it.prototype[t+"Form"]=r(!0)});let ff=class xd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Nt(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new xd(function(o){t=o}),cancel:t}}};function hf(e){return function(r){return e.apply(null,r)}}function gf(e){return j.isObject(e)&&e.isAxiosError===!0}const oo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(oo).forEach(([e,t])=>{oo[t]=e});function $i(e){const t=new it(e),r=ri(it.prototype.request,t);return j.extend(r,it.prototype,t,{allOwnKeys:!0}),j.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return $i(at(e,o))},r}const te=$i(rr);te.Axios=it,te.CanceledError=Nt,te.CancelToken=ff,te.isCancel=wi,te.VERSION=Di,te.toFormData=$r,te.AxiosError=B,te.Cancel=te.CanceledError,te.all=function(t){return Promise.all(t)},te.spread=hf,te.isAxiosError=gf,te.mergeConfig=at,te.AxiosHeaders=de,te.formToJSON=e=>_i(j.isHTMLForm(e)?new FormData(e):e),te.getAdapter=Mi.getAdapter,te.HttpStatusCode=oo,te.default=te;const{Axios:i_,AxiosError:s_,CanceledError:l_,isCancel:c_,CancelToken:d_,VERSION:u_,all:p_,Cancel:m_,isAxiosError:f_,spread:h_,toFormData:g_,AxiosHeaders:x_,HttpStatusCode:v_,formToJSON:b_,getAdapter:__,mergeConfig:y_}=te,Bi=ecommreelsInfo,ue=te.create({baseURL:`${Bi.apiBase}`,headers:{"X-WP-Nonce":Bi.nonce,"Content-Type":"application/json"}}),xf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:et,story_ids:s},c=await ue.post("stories/manage-group-stories",l);return q.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?q.error(l.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l)=>{try{n(!0),await ue.delete(`story/${s}`),l(c=>c.filter(d=>d.id!==s)),q.success("Reel deleted successfully!")}catch(c){c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function Ui(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Hi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=Ui(p,500),v=y.useRef(!0),f=y.useCallback(async b=>{b===1&&v.current?u(!0):c(!0);try{const w={page:b,per_page:20};e&&(w.group_id=e),g&&(w.search=g);const S=await ue.get("stories",{params:w}),C=S.data,N=parseInt(S.headers["x-wp-totalpages"]);r(k=>b===1?C:[...k,...C]),o(b+1),s(b<N)}catch(w){w instanceof Error?q.error(w.message):q.error("Something went wrong. Try again later!")}finally{v.current&&(v.current=!1),c(!1),u(!1)}},[e,g]);y.useEffect(()=>{o(1),r([]),f(1)},[g,f]);const x=y.useRef(null),_=y.useCallback(b=>{l||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&i&&f(n)}),b&&x.current.observe(b))},[l,i,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_}};function vf(){const e=je(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Hi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=xf(),[g,v]=y.useState(null),[f,x]=y.useState(null),[_,b]=y.useState([]),w=async()=>{const k=await p(_);k&&e(`?view=${K.mg}&gid=${k}`)},S=()=>{b(t.map(k=>k.id))},C=k=>{b(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{g&&(await m(g,r),v(null))},[m,g,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[g&&a.jsx(Or,{onReject:()=>v(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(St,{left:[a.jsx(jt,{name:"All Reels",Icon:Yu},"page"),a.jsx(Jt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:_t},"add-reel-all-reel")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(dp,{selectedReelIds:_,handleSelectAll:S,clearSelection:()=>b([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Vp,{reels:t,styles:c,selectedReelIds:_,onSelectReel:C,onDeleteReel:v,onPreviewReel:x,lastStoryElementRef:o}):!n&&!l?a.jsx(mp,{}):null,n&&a.jsx(fp,{isFullScreen:!t.length})]}),!!f&&a.jsx(Ep,{previewReel:f,setPreviewReel:x})]})}const bf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,links:s};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await ue.post("files",c);return q.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},ao=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(oe,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(Zu,{className:"ecr-admin-save-button__icon"})," ",r]}),Vi=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),_f=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=je(),[s]=Gt(),l=s.get("sid"),c=s.get("from")||K.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=bf(),m=async()=>{if(u)return;const g=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});g&&i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0,...l?{}:{state:{storyId:g}}})};return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(jt,{name:l?"Update Reel":"Add Reel",Icon:_t},"page"),a.jsx(Jt,{},"back")],center:[a.jsx(Vi,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(ao,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function yf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let io;const wf=new Uint8Array(16);function Sf(){if(!io){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");io=crypto.getRandomValues.bind(crypto)}return io(wf)}const Wi={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function jf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Sf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,yf(n)}function Gi(e,t,r){return Wi.randomUUID&&!e?Wi.randomUUID():jf(e)}const qi="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ki=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:Gi()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:qi,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/** |
| 219 | | * @license lucide-react v0.552.0 - ISC |
| 220 | | * |
| 221 | | * This source code is licensed under the ISC license. |
| 222 | | * See the LICENSE file in the root directory of this source tree. |
| 223 | | */const Cf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Yi=e=>{const t=kf(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xi=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Nf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** |
| 224 | | * @license lucide-react v0.552.0 - ISC |
| 225 | | * |
| 226 | | * This source code is licensed under the ISC license. |
| 227 | | * See the LICENSE file in the root directory of this source tree. |
| 228 | | */var Ef={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** |
| 229 | | * @license lucide-react v0.552.0 - ISC |
| 230 | | * |
| 231 | | * This source code is licensed under the ISC license. |
| 232 | | * See the LICENSE file in the root directory of this source tree. |
| 233 | | */const Tf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>y.createElement("svg",{ref:c,...Ef,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Xi("lucide",o),...!i&&!Nf(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>y.createElement(d,u)),...Array.isArray(i)?i:[i]]));/** |
| 234 | | * @license lucide-react v0.552.0 - ISC |
| 235 | | * |
| 236 | | * This source code is licensed under the ISC license. |
| 237 | | * See the LICENSE file in the root directory of this source tree. |
| 238 | | */const be=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(Tf,{ref:i,iconNode:t,className:Xi(`lucide-${Cf(Yi(e))}`,`lucide-${e}`,n),...o}));return r.displayName=Yi(e),r};/** |
| 239 | | * @license lucide-react v0.552.0 - ISC |
| 240 | | * |
| 241 | | * This source code is licensed under the ISC license. |
| 242 | | * See the LICENSE file in the root directory of this source tree. |
| 243 | | */const Af=be("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** |
| 244 | | * @license lucide-react v0.552.0 - ISC |
| 245 | | * |
| 246 | | * This source code is licensed under the ISC license. |
| 247 | | * See the LICENSE file in the root directory of this source tree. |
| 248 | | */const so=be("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** |
| 249 | | * @license lucide-react v0.552.0 - ISC |
| 250 | | * |
| 251 | | * This source code is licensed under the ISC license. |
| 252 | | * See the LICENSE file in the root directory of this source tree. |
| 253 | | */const Pf=be("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** |
| 254 | | * @license lucide-react v0.552.0 - ISC |
| 255 | | * |
| 256 | | * This source code is licensed under the ISC license. |
| 257 | | * See the LICENSE file in the root directory of this source tree. |
| 258 | | */const Of=be("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** |
| 259 | | * @license lucide-react v0.552.0 - ISC |
| 260 | | * |
| 261 | | * This source code is licensed under the ISC license. |
| 262 | | * See the LICENSE file in the root directory of this source tree. |
| 263 | | */const Rf=be("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** |
| 264 | | * @license lucide-react v0.552.0 - ISC |
| 265 | | * |
| 266 | | * This source code is licensed under the ISC license. |
| 267 | | * See the LICENSE file in the root directory of this source tree. |
| 268 | | */const Lf=be("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** |
| 269 | | * @license lucide-react v0.552.0 - ISC |
| 270 | | * |
| 271 | | * This source code is licensed under the ISC license. |
| 272 | | * See the LICENSE file in the root directory of this source tree. |
| 273 | | */const If=be("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** |
| 274 | | * @license lucide-react v0.552.0 - ISC |
| 275 | | * |
| 276 | | * This source code is licensed under the ISC license. |
| 277 | | * See the LICENSE file in the root directory of this source tree. |
| 278 | | */const Mf=be("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/** |
| 279 | | * @license lucide-react v0.552.0 - ISC |
| 280 | | * |
| 281 | | * This source code is licensed under the ISC license. |
| 282 | | * See the LICENSE file in the root directory of this source tree. |
| 283 | | */const zf=be("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** |
| 284 | | * @license lucide-react v0.552.0 - ISC |
| 285 | | * |
| 286 | | * This source code is licensed under the ISC license. |
| 287 | | * See the LICENSE file in the root directory of this source tree. |
| 288 | | */const Df=be("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/** |
| 289 | | * @license lucide-react v0.552.0 - ISC |
| 290 | | * |
| 291 | | * This source code is licensed under the ISC license. |
| 292 | | * See the LICENSE file in the root directory of this source tree. |
| 293 | | */const Ff=be("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var $f=Symbol.for("react.lazy"),Gr=h[" use ".trim().toString()];function Bf(e){return typeof e=="object"&&e!==null&&"then"in e}function Ji(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$f&&"_payload"in e&&Bf(e._payload)}function Uf(e){const t=Hf(e),r=h.forwardRef((n,o)=>{let{children:i,...s}=n;Ji(i)&&typeof Gr=="function"&&(i=Gr(i._payload));const l=h.Children.toArray(i),c=l.find(Wf);if(c){const d=c.props.children,u=l.map(p=>p===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Hf(e){const t=h.forwardRef((r,n)=>{let{children:o,...i}=r;if(Ji(o)&&typeof Gr=="function"&&(o=Gr(o._payload)),h.isValidElement(o)){const s=qf(o),l=Gf(i,o.props);return o.type!==h.Fragment&&(l.ref=n?Bn(n,s):s),h.cloneElement(o,l)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vf=Symbol("radix.slottable");function Wf(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vf}function Gf(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function qf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Kf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yf=Kf.reduce((e,t)=>{const r=Uf(`Primitive.${t}`),n=h.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xf="Separator",Zi="horizontal",Jf=["horizontal","vertical"],Qi=h.forwardRef((e,t)=>{const{decorative:r,orientation:n=Zi,...o}=e,i=Zf(n)?n:Zi,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Yf.div,{"data-orientation":i,...l,...o,ref:t})});Qi.displayName=Xf;function Zf(e){return Jf.includes(e)}var Qf=Qi;function lo({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(Qf,{"data-slot":"separator",decorative:r,orientation:t,className:D("ecr-separator",e),...n})}const Et=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(lo,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(lo,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(oe,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eh(e,t){const r=h.createContext(t),n=i=>{const{children:s,...l}=i,c=h.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=h.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(i,s){const l=h.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...v}=p,f=m?.[e]?.[c]||l,x=h.useMemo(()=>v,Object.values(v));return a.jsx(f.Provider,{value:x,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,v=h.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>h.createContext(s));return function(l){const c=l?.[e]||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,th(o,...t)]}function th(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var rh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=rh.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=h.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nh(e,t){e&&br.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...r)=>t.current?.(...r),[])}function oh(e,t=globalThis?.document){const r=Ve(e);h.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ah="DismissableLayer",co="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",es,ts=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=h.useContext(ts),[u,p]=h.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=h.useState({}),v=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(x),b=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=_,C=dh(k=>{const E=k.target,T=[...d.branches].some(R=>R.contains(E));!S||T||(o?.(k),s?.(k),k.defaultPrevented||l?.())},m),N=uh(k=>{const E=k.target;[...d.branches].some(R=>R.contains(E))||(i?.(k),s?.(k),k.defaultPrevented||l?.())},m);return oh(k=>{b===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),h.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(es=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),rs(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=es)}},[u,m,r,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),rs())},[u,d]),h.useEffect(()=>{const k=()=>g({});return document.addEventListener(co,k),()=>document.removeEventListener(co,k)},[]),a.jsx(W.div,{...c,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=ah;var lh="DismissableLayerBranch",ch=h.forwardRef((e,t)=>{const r=h.useContext(ts),n=h.useRef(null),o=Y(t,n);return h.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ch.displayName=lh;function dh(e,t=globalThis?.document){const r=Ve(e),n=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ns(ih,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function uh(e,t=globalThis?.document){const r=Ve(e),n=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!n.current&&ns(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function rs(){const e=new CustomEvent(co);document.dispatchEvent(e)}function ns(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?nh(o,i):o.dispatchEvent(i)}var uo=0;function po(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??os()),document.body.insertAdjacentElement("beforeend",e[1]??os()),uo++,()=>{uo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),uo--}},[])}function os(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mo="focusScope.autoFocusOnMount",fo="focusScope.autoFocusOnUnmount",as={bubbles:!1,cancelable:!0},ph="FocusScope",Kr=h.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=h.useState(null),d=Ve(o),u=Ve(i),p=h.useRef(null),m=Y(t,f=>c(f)),g=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const S=w.target;l.contains(S)?p.current=S:We(p.current,{select:!0})},x=function(w){if(g.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||We(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const b=new MutationObserver(_);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),b.disconnect()}}},[n,l,g.paused]),h.useEffect(()=>{if(l){ls.add(g);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(mo,as);l.addEventListener(mo,d),l.dispatchEvent(_),_.defaultPrevented||(mh(vh(is(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(mo,d),setTimeout(()=>{const _=new CustomEvent(fo,as);l.addEventListener(fo,u),l.dispatchEvent(_),_.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(fo,u),ls.remove(g)},0)}}},[l,d,u,g]);const v=h.useCallback(f=>{if(!r&&!n||g.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(x&&_){const b=f.currentTarget,[w,S]=fh(b);w&&S?!f.shiftKey&&_===S?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&We(S,{select:!0})):_===b&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});Kr.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function fh(e){const t=is(e),r=ss(t,e),n=ss(t.reverse(),e);return[r,n]}function is(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ss(e,t){for(const r of e)if(!hh(r,{upTo:t}))return r}function hh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gh(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gh(e)&&t&&e.select()}}var ls=xh();function xh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=cs(e,t),e.unshift(t)},remove(t){e=cs(e,t),e[0]?.resume()}}}function cs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function vh(e){return e.filter(t=>t.tagName!=="A")}var ie=globalThis?.document?h.useLayoutEffect:()=>{},bh=h[" useId ".trim().toString()]||(()=>{}),_h=0;function Ne(e){const[t,r]=h.useState(bh());return ie(()=>{r(n=>n??String(_h++))},[e]),e||(t?`radix-${t}`:"")}const yh=["top","right","bottom","left"],Ge=Math.min,me=Math.max,Yr=Math.round,Xr=Math.floor,Ee=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function ho(e,t,r){return me(e,Ge(t,r))}function Me(e,t){return typeof e=="function"?e(t):e}function ze(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function go(e){return e==="x"?"y":"x"}function xo(e){return e==="y"?"height":"width"}const jh=new Set(["top","bottom"]);function Te(e){return jh.has(ze(e))?"y":"x"}function vo(e){return go(Te(e))}function Ch(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=vo(e),i=xo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function kh(e){const t=Jr(e);return[bo(e),t,bo(t)]}function bo(e){return e.replace(/start|end/g,t=>Sh[t])}const ds=["left","right"],us=["right","left"],Nh=["top","bottom"],Eh=["bottom","top"];function Th(e,t,r){switch(e){case"top":case"bottom":return r?t?us:ds:t?ds:us;case"left":case"right":return t?Nh:Eh;default:return[]}}function Ah(e,t,r,n){const o=Tt(e);let i=Th(ze(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(bo)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>wh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function ps(e){return typeof e!="number"?Ph(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ms(e,t,r){let{reference:n,floating:o}=e;const i=Te(t),s=vo(t),l=xo(s),c=ze(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=ms(d,n,c),m=n,g={},v=0;for(let f=0;f<l.length;f++){const{name:x,fn:_}=l[f],{x:b,y:w,data:S,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=b??u,p=w??p,g={...g,[x]:{...g[x],...S}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=ms(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function or(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Me(t,e),v=ps(g),x=l[m?p==="floating"?"reference":"floating":p],_=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(x)))==null||r?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),b=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(_.top-C.top+v.top)/S.y,bottom:(C.bottom-_.bottom+v.bottom)/S.y,left:(_.left-C.left+v.left)/S.x,right:(C.right-_.right+v.right)/S.x}}const Rh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Me(e,t)||{};if(d==null)return{};const p=ps(u),m={x:r,y:n},g=vo(o),v=xo(g),f=await s.getDimensions(d),x=g==="y",_=x?"top":"left",b=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[g]-m[g]-i.floating[v],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(N)))&&(k=l.floating[w]||i.floating[v]);const E=S/2-C/2,T=k/2-f[v]/2-1,R=Ge(p[_],T),I=Ge(p[b],T),A=R,L=k-f[v]-I,M=k/2-f[v]/2+E,$=ho(A,M,L),O=!c.arrow&&Tt(o)!=null&&M!==$&&i.reference[v]/2-(M<A?R:I)-f[v]/2<0,U=O?M<A?M-A:M-L:0;return{[g]:m[g]+U,data:{[g]:$,centerOffset:M-$-U,...O&&{alignmentOffset:U}},reset:O}}}),Lh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...x}=Me(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const _=ze(o),b=Te(l),w=ze(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Jr(l)]:kh(l)),N=v!=="none";!m&&N&&C.push(...Ah(l,f,v,S));const k=[l,...C],E=await or(t,x),T=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const M=Ch(o,s,S);T.push(E[M[0]],E[M[1]])}if(R=[...R,{placement:o,overflows:T}],!T.every(M=>M<=0)){var I,A;const M=(((I=i.flip)==null?void 0:I.index)||0)+1,$=k[M];if($&&(!(p==="alignment"?b!==Te($):!1)||R.every(P=>Te(P.placement)===b?P.overflows[0]>0:!0)))return{data:{index:M,overflows:R},reset:{placement:$}};let O=(A=R.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!O)switch(g){case"bestFit":{var L;const U=(L=R.filter(P=>{if(N){const G=Te(P.placement);return G===b||G==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(G=>G>0).reduce((G,X)=>G+X,0)]).sort((P,G)=>P[1]-G[1])[0])==null?void 0:L[0];U&&(O=U);break}case"initialPlacement":O=l;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function fs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hs(e){return yh.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Me(e,t);switch(n){case"referenceHidden":{const i=await or(t,{...o,elementContext:"reference"}),s=fs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:hs(s)}}}case"escaped":{const i=await or(t,{...o,altBoundary:!0}),s=fs(i,r.floating);return{data:{escapedOffsets:s,escaped:hs(s)}}}default:return{}}}}},gs=new Set(["left","top"]);async function Mh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ze(r),l=Tt(r),c=Te(r)==="y",d=gs.has(s)?-1:1,u=i&&c?-1:1,p=Me(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const zh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Mh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:_,y:b}=x;return{x:_,y:b}}},...c}=Me(e,t),d={x:r,y:n},u=await or(t,c),p=Te(ze(o)),m=go(p);let g=d[m],v=d[p];if(i){const x=m==="y"?"top":"left",_=m==="y"?"bottom":"right",b=g+u[x],w=g-u[_];g=ho(b,g,w)}if(s){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",b=v+u[x],w=v-u[_];v=ho(b,v,w)}const f=l.fn({...t,[m]:g,[p]:v});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Fh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Me(e,t),u={x:r,y:n},p=Te(o),m=go(p);let g=u[m],v=u[p];const f=Me(l,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",S=i.reference[m]-i.floating[w]+x.mainAxis,C=i.reference[m]+i.reference[w]-x.mainAxis;g<S?g=S:g>C&&(g=C)}if(d){var _,b;const w=m==="y"?"width":"height",S=gs.has(ze(o)),C=i.reference[p]-i.floating[w]+(S&&((_=s.offset)==null?void 0:_[p])||0)+(S?0:x.crossAxis),N=i.reference[p]+i.reference[w]+(S?0:((b=s.offset)==null?void 0:b[p])||0)-(S?x.crossAxis:0);v<C?v=C:v>N&&(v=N)}return{[m]:g,[p]:v}}}},$h=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Me(e,t),u=await or(t,d),p=ze(o),m=Tt(o),g=Te(o)==="y",{width:v,height:f}=i.floating;let x,_;p==="top"||p==="bottom"?(x=p,_=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,x=m==="end"?"top":"bottom");const b=f-u.top-u.bottom,w=v-u.left-u.right,S=Ge(f-u[x],b),C=Ge(v-u[_],w),N=!t.middlewareData.shift;let k=S,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=b),N&&!m){const R=me(u.left,0),I=me(u.right,0),A=me(u.top,0),L=me(u.bottom,0);g?E=v-2*(R!==0||I!==0?R+I:me(u.left,u.right)):k=f-2*(A!==0||L!==0?A+L:me(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const T=await s.getDimensions(l.floating);return v!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function At(e){return xs(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(xs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xs(e){return Qr()?e instanceof Node||e instanceof fe(e).Node:!1}function _e(e){return Qr()?e instanceof Element||e instanceof fe(e).Element:!1}function Pe(e){return Qr()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function vs(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}const Bh=new Set(["inline","contents"]);function ar(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Bh.has(o)}const Uh=new Set(["table","td","th"]);function Hh(e){return Uh.has(At(e))}const Vh=[":popover-open",":modal"];function en(e){return Vh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wh=["transform","translate","scale","rotate","perspective"],Gh=["transform","translate","scale","rotate","perspective","filter"],qh=["paint","layout","strict","content"];function _o(e){const t=yo(),r=_e(e)?ye(e):e;return Wh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Gh.some(n=>(r.willChange||"").includes(n))||qh.some(n=>(r.contain||"").includes(n))}function Kh(e){let t=qe(e);for(;Pe(t)&&!Pt(t);){if(_o(t))return t;if(en(t))return null;t=qe(t)}return null}function yo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function Pt(e){return Yh.has(At(e))}function ye(e){return fe(e).getComputedStyle(e)}function tn(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vs(e)&&e.host||Ae(e);return vs(t)?t.host:t}function bs(e){const t=qe(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&ar(t)?t:bs(t)}function ir(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=bs(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=fe(o);if(i){const l=wo(s);return t.concat(s,s.visualViewport||[],ar(o)?o:[],l&&r?ir(l):[])}return t.concat(o,ir(o,[],r))}function wo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _s(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Pe(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function So(e){return _e(e)?e:e.contextElement}function Ot(e){const t=So(e);if(!Pe(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=_s(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xh=Ee(0);function ys(e){const t=fe(e);return!yo()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==fe(e)?!1:t}function st(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=So(e);let s=Ee(1);t&&(n?_e(n)&&(s=Ot(n)):s=Ot(e));const l=Jh(i,r,n)?ys(i):Ee(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=fe(i),g=n&&_e(n)?fe(n):n;let v=m,f=wo(v);for(;f&&n&&g!==v;){const x=Ot(f),_=f.getBoundingClientRect(),b=ye(f),w=_.left+(f.clientLeft+parseFloat(b.paddingLeft))*x.x,S=_.top+(f.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,p*=x.y,c+=w,d+=S,v=fe(f),f=wo(v)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:st(Ae(e)).left+r}function ws(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Zh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Ae(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Ee(1);const u=Ee(0),p=Pe(n);if((p||!p&&!i)&&((At(n)!=="body"||ar(s))&&(c=tn(n)),Pe(n))){const g=st(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?ws(s,c):Ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function eg(e){const t=Ae(e),r=tn(e),n=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return ye(n).direction==="rtl"&&(s+=me(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ss=25;function tg(e,t){const r=fe(e),n=Ae(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=yo();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(n.clientWidth-p.clientWidth-g);v<=Ss&&(i-=v)}else d<=Ss&&(i+=d);return{width:i,height:s,x:l,y:c}}const rg=new Set(["absolute","fixed"]);function ng(e,t){const r=st(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Pe(e)?Ot(e):Ee(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function js(e,t,r){let n;if(t==="viewport")n=tg(e,r);else if(t==="document")n=eg(Ae(e));else if(_e(t))n=ng(t,r);else{const o=ys(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function Cs(e,t){const r=qe(e);return r===t||!_e(r)||Pt(r)?!1:ye(r).position==="fixed"||Cs(r,t)}function og(e,t){const r=t.get(e);if(r)return r;let n=ir(e,[],!1).filter(l=>_e(l)&&At(l)!=="body"),o=null;const i=ye(e).position==="fixed";let s=i?qe(e):e;for(;_e(s)&&!Pt(s);){const l=ye(s),c=_o(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&rg.has(o.position)||ar(s)&&!c&&Cs(e,s))?n=n.filter(u=>u!==s):o=l,s=qe(s)}return t.set(e,n),n}function ag(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:og(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=js(t,u,o);return d.top=me(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=me(p.left,d.left),d},js(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ig(e){const{width:t,height:r}=_s(e);return{width:t,height:r}}function sg(e,t,r){const n=Pe(t),o=Ae(t),i=r==="fixed",s=st(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ee(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((At(t)!=="body"||ar(o))&&(l=tn(t)),n){const g=st(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?ws(o,l):Ee(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function jo(e){return ye(e).position==="static"}function ks(e,t){if(!Pe(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Ns(e,t){const r=fe(e);if(en(e))return r;if(!Pe(e)){let o=qe(e);for(;o&&!Pt(o);){if(_e(o)&&!jo(o))return o;o=qe(o)}return r}let n=ks(e,t);for(;n&&Hh(n)&&jo(n);)n=ks(n,t);return n&&Pt(n)&&jo(n)&&!_o(n)?r:n||Kh(e)||r}const lg=async function(e){const t=this.getOffsetParent||Ns,r=this.getDimensions,n=await r(e.floating);return{reference:sg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cg(e){return ye(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Zh,getDocumentElement:Ae,getClippingRect:ag,getOffsetParent:Ns,getElementRects:lg,getClientRects:Qh,getDimensions:ig,getScale:Ot,isElement:_e,isRTL:cg};function Es(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ug(e,t){let r=null,n;const o=Ae(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const v=Xr(p),f=Xr(o.clientWidth-(u+m)),x=Xr(o.clientHeight-(p+g)),_=Xr(u),w={rootMargin:-v+"px "+-f+"px "+-x+"px "+-_+"px",threshold:me(0,Ge(1,c))||1};let S=!0;function C(N){const k=N[0].intersectionRatio;if(k!==c){if(!S)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Es(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=So(e),u=o||i?[...d?ir(d):[],...ir(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=d&&l?ug(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(_=>{let[b]=_;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let v,f=c?st(e):null;c&&x();function x(){const _=st(e);f&&!Es(f,_)&&r(),f=_,v=requestAnimationFrame(x)}return r(),()=>{var _;u.forEach(b=>{o&&b.removeEventListener("scroll",r),i&&b.removeEventListener("resize",r)}),p?.(),(_=g)==null||_.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const mg=zh,fg=Dh,hg=Lh,gg=$h,xg=Ih,Ts=Rh,vg=Fh,bg=(e,t,r)=>{const n=new Map,o={platform:dg,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var _g=typeof document<"u",yg=function(){},nn=_g?y.useLayoutEffect:yg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function As(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ps(e,t){const r=As(e);return Math.round(t*r)/r}function Co(e){const t=h.useRef(e);return nn(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=h.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=h.useState(n);on(m,n)||g(n);const[v,f]=h.useState(null),[x,_]=h.useState(null),b=h.useCallback(P=>{P!==N.current&&(N.current=P,f(P))},[]),w=h.useCallback(P=>{P!==k.current&&(k.current=P,_(P))},[]),S=i||v,C=s||x,N=h.useRef(null),k=h.useRef(null),E=h.useRef(u),T=c!=null,R=Co(c),I=Co(o),A=Co(d),L=h.useCallback(()=>{if(!N.current||!k.current)return;const P={placement:t,strategy:r,middleware:m};I.current&&(P.platform=I.current),bg(N.current,k.current,P).then(G=>{const X={...G,isPositioned:A.current!==!1};M.current&&!on(E.current,X)&&(E.current=X,br.flushSync(()=>{p(X)}))})},[m,t,r,I,A]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[d]);const M=h.useRef(!1);nn(()=>(M.current=!0,()=>{M.current=!1}),[]),nn(()=>{if(S&&(N.current=S),C&&(k.current=C),S&&C){if(R.current)return R.current(S,C,L);L()}},[S,C,L,R,T]);const $=h.useMemo(()=>({reference:N,floating:k,setReference:b,setFloating:w}),[b,w]),O=h.useMemo(()=>({reference:S,floating:C}),[S,C]),U=h.useMemo(()=>{const P={position:r,left:0,top:0};if(!O.floating)return P;const G=Ps(O.floating,u.x),X=Ps(O.floating,u.y);return l?{...P,transform:"translate("+G+"px, "+X+"px)",...As(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:X}},[r,l,O.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:L,refs:$,elements:O,floatingStyles:U}),[u,L,$,O,U])}const Sg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ts({element:n.current,padding:o}).fn(r):{}:n?Ts({element:n,padding:o}).fn(r):{}}}},jg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),kg=(e,t)=>({...vg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...gg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...Sg(e),options:[e,t]});var Pg="Arrow",Os=h.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Os.displayName=Pg;var Og=Os;function Rg(e){const[t,r]=h.useState(void 0);return ie(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var ko="Popper",[Rs,an]=He(ko),[Lg,Ls]=Rs(ko),Is=e=>{const{__scopePopper:t,children:r}=e,[n,o]=h.useState(null);return a.jsx(Lg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Is.displayName=ko;var Ms="PopperAnchor",zs=h.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ls(Ms,r),s=h.useRef(null),l=Y(t,s),c=h.useRef(null);return h.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});zs.displayName=Ms;var No="PopperContent",[Ig,Mg]=Rs(No),Ds=h.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...f}=e,x=Ls(No,r),[_,b]=h.useState(null),w=Y(t,F=>b(F)),[S,C]=h.useState(null),N=Rg(S),k=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(d)?d:[d],A=I.length>0,L={padding:R,boundary:I.filter(Dg),altBoundary:A},{refs:M,floatingStyles:$,placement:O,isPositioned:U,middlewareData:P}=wg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>pg(...F,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[jg({mainAxis:o+E,alignmentAxis:s}),c&&Cg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?kg():void 0,...L}),c&&Ng({...L}),Eg({...L,apply:({elements:F,rects:ee,availableWidth:le,availableHeight:J})=>{const{width:Q,height:re}=ee.reference,ge=F.floating.style;ge.setProperty("--radix-popper-available-width",`${le}px`),ge.setProperty("--radix-popper-available-height",`${J}px`),ge.setProperty("--radix-popper-anchor-width",`${Q}px`),ge.setProperty("--radix-popper-anchor-height",`${re}px`)}}),S&&Ag({element:S,padding:l}),Fg({arrowWidth:k,arrowHeight:E}),m&&Tg({strategy:"referenceHidden",...L})]}),[G,X]=Bs(O),Z=Ve(v);ie(()=>{U&&Z?.()},[U,Z]);const pe=P.arrow?.x,Fe=P.arrow?.y,he=P.arrow?.centerOffset!==0,[$e,ht]=h.useState();return ie(()=>{_&&ht(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Ig,{scope:r,placedSide:G,onArrowChange:C,arrowX:pe,arrowY:Fe,shouldHideArrow:he,children:a.jsx(W.div,{"data-side":G,"data-align":X,...f,ref:w,style:{...f.style,animation:U?void 0:"none"}})})})});Ds.displayName=No;var Fs="PopperArrow",zg={top:"bottom",right:"left",bottom:"top",left:"right"},$s=h.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Mg(Fs,n),s=zg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Og,{...o,ref:r,style:{...o.style,display:"block"}})})});$s.displayName=Fs;function Dg(e){return e!==null}var Fg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Bs(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let v="",f="";return d==="bottom"?(v=s?p:`${m}px`,f=`${-c}px`):d==="top"?(v=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(v=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(v=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:v,y:f}}}});function Bs(e){const[t,r="center"]=e.split("-");return[t,r]}var Us=Is,Eo=zs,Hs=Ds,Vs=$s,$g="Portal",sn=h.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=h.useState(!1);ie(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ca.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=$g;function Bg(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=Ug(t),o=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),i=Y(n.ref,Hg(o));return typeof r=="function"||n.isPresent?h.cloneElement(o,{ref:i}):null};Ke.displayName="Presence";function Ug(e){const[t,r]=h.useState(),n=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Bg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),ie(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ie(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function Hg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vg=h[" useInsertionEffect ".trim().toString()]||ie;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=h.useCallback(u=>{if(l){const p=Gg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Wg({defaultProp:e,onChange:t}){const[r,n]=h.useState(e),o=h.useRef(r),i=h.useRef(t);return Vg(()=>{i.current=t},[t]),h.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Gg(e){return typeof e=="function"}var qg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,cn=new WeakMap,dn={},To=0,Ws=function(e){return e&&(e.host||Ws(e.parentNode))},Kg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ws(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Yg=function(e,t,r,n){var o=Kg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),v=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,x=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,x),s.push(m),f===1&&v&&cn.set(m,!0),x===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),To++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),To--,To||(Rt=new WeakMap,Rt=new WeakMap,cn=new WeakMap,dn={})}},Ao=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=qg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Yg(n,o,r,"aria-hidden")):function(){return null}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Oe.apply(this,arguments)};function Gs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Xg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Jg="with-scroll-bars-hidden",Zg="--removed-body-scroll-bar-size";function Po(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var ex=typeof window<"u"?h.useLayoutEffect:h.useEffect,qs=new WeakMap;function tx(e,t){var r=Qg(null,function(n){return e.forEach(function(o){return Po(o,n)})});return ex(function(){var n=qs.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||Po(l,null)}),i.forEach(function(l){o.has(l)||Po(l,s)})}qs.set(r,e)},[e]),r}function rx(e){return e}function nx(e,t){t===void 0&&(t=rx);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ox(e){e===void 0&&(e={});var t=nx(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Ks=function(e){var t=e.sideCar,r=Gs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,Oe({},r))};Ks.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),Ks}var Ys=ox(),Oo=function(){},mn=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:Oo,onWheelCapture:Oo,onTouchMoveCapture:Oo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,v=e.noIsolation,f=e.inert,x=e.allowPinchZoom,_=e.as,b=_===void 0?"div":_,w=e.gapMode,S=Gs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=tx([r,t]),k=Oe(Oe({},S),o);return h.createElement(h.Fragment,null,u&&h.createElement(C,{sideCar:Ys,removeScrollBar:d,shards:p,noRelative:g,noIsolation:v,inert:f,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:w}),s?h.cloneElement(h.Children.only(l),Oe(Oe({},k),{ref:N})):h.createElement(b,Oe({},k,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ix=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ix();return t&&e.setAttribute("nonce",t),e}function lx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sx())&&(lx(t,r),cx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ux=function(){var e=dx();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Xs=function(){var e=ux(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},px={left:0,top:0,right:0,gap:0},Ro=function(e){return parseInt(e||"",10)||0},mx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ro(r),Ro(n),Ro(o)]},fx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return px;var t=mx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},hx=Xs(),Lt="data-scroll-locked",gx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),` |
| 294 | | .`.concat(Jg,` { |
| | 213 | `,Er=16,Bu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:i,containerClassName:l})=>{let{toasts:c,handlers:d}=hu(r,s);return g.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...i},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),h=Fu(p,m);return g.createElement(Du,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?$u:"",style:h},u.type==="custom"?Cr(u.message,u):o?o(u):g.createElement(Mu,{toast:u,position:p}))}))},G=oe;const Ka={carousel:"carousel",grid:"grid"},Uu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ka.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Hu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Ya=[{label:"Horizontal",value:"horizontal"}],Vu=[{label:"Vertical",value:"vertical"}],Wu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],qu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Xa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ja=y.createContext&&y.createContext(Xa),Gu=["attr","size","title"];function Ku(e,t){if(e==null)return{};var r=Yu(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tr.apply(this,arguments)}function Za(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Za(Object(r),!0).forEach(function(n){Xu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Za(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xu(e,t,r){return t=Ju(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ju(e){var t=Zu(e,"string");return typeof t=="symbol"?t:t+""}function Zu(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qa(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),Qa(t.child)))}function H(e){return t=>y.createElement(Qu,Tr({attr:Ar({},e.attr)},t),Qa(e.child))}function Qu(e){var t=r=>{var{attr:n,size:o,title:s}=e,i=Ku(e,Gu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:c,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&y.createElement("title",null,s),e.children)};return Ja!==void 0?y.createElement(Ja.Consumer,null,r=>t(r)):t(Xa)}function ep(e){return H({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function qt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function gt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Gt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Kt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function tp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function rp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function tt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function np(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function es(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function op(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function Yt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function ts(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Hn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=ts(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():ts(e[o],null)}}}}function Y(...e){return g.useCallback(Hn(...e),e)}function rt(e){const t=sp(e),r=g.forwardRef((n,o)=>{const{children:s,...i}=n,l=g.Children.toArray(s),c=l.find(lp);if(c){const d=c.props.children,u=l.map(p=>p===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var ap=rt("Slot");function sp(e){const t=g.forwardRef((r,n)=>{const{children:o,...s}=r;if(g.isValidElement(o)){const i=dp(o),l=cp(s,o.props);return o.type!==g.Fragment&&(l.ref=n?Hn(n,i):i),g.cloneElement(o,l)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ip=Symbol("radix.slottable");function lp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ip}function cp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function dp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function rs(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=rs(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function up(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=rs(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return up(e)}const pp="ecr-button",mp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},fp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function re({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?ap:"button";return a.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:D(pp,mp[t],fp[r],e),...o})}function hp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:s,handleCreateGroup:i}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(re,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(re,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:l=>o(l.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(re,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(es,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(re,{disabled:s,onClick:i,className:"ecr-admin-reels-header__create",children:[s?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Group"]}):null]})]})}function gp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function xp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function nt(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function bp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function vp({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const ns=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,s)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",s===r?.index?"ecr-player__progress-fill--active":s<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},s))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function Vn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Wn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Gn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const _p="Left",yp="Right",jp="Up",Sp="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Kn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},os="mousemove",as="mouseup",Cp="touchend",kp="touchmove",Np="touchstart";function Ep(e,t,r,n){return e>t?r>0?yp:_p:n>0?Sp:jp}function ss(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Tp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,h)=>{h.trackMouse&&!p&&(document.addEventListener(os,n),document.addEventListener(as,i));const{clientX:b,clientY:f}=p?u.touches[0]:u,x=ss([b,f],h.rotationAngle);return h.onTouchStartOrOnMouseDown&&h.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Kn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const h="touches"in u;if(h&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=h?u.touches[0]:u,[x,_]=ss([b,f],m.rotationAngle),v=x-p.xy[0],w=_-p.xy[1],j=Math.abs(v),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[v/(N||1),w/(N||1)],T=Ep(j,C,v,w),O=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||bt.delta;if(j<O&&C<O&&!p.swiping)return p;const L={absX:j,absY:C,deltaX:v,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};L.first&&m.onSwipeStart&&m.onSwipeStart(L),m.onSwiping&&m.onSwiping(L);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:L,swiping:!0})})},o=u=>{e((p,m)=>{let h;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){h=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(h);const b=m[`onSwiped${h.dir}`];b&&b(h)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Kn),{eventData:h})})},s=()=>{document.removeEventListener(os,n),document.removeEventListener(as,i)},i=u=>{s(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const h=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Np,r,h],[kp,n,Object.assign(Object.assign({},h),p.preventScrollOnSwipe?{passive:!1}:{})],[Cp,o,h]];b.forEach(([f,x,_])=>u.addEventListener(f,x,_)),m=()=>b.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const h={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),h.cleanUpTouch=void 0),m.trackTouch&&u&&(h.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),h)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Ap(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Pp(e){const{trackMouse:t}=e,r=g.useRef(Object.assign({},Kn)),n=g.useRef(Object.assign({},bt)),o=g.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let s;for(s in bt)n.current[s]===void 0&&(n.current[s]=bt[s]);const[i,l]=g.useMemo(()=>Tp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Ap(r.current,n.current,o.current,l),i}const Op=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:s,handleNextFile:i,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>s(o),onEnded:i,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,h=p.videoHeight;d(h>m),l(p.duration)}})})},is=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:s,setIsPaused:i,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const _=p.current[x];_&&(s?_.play():_.pause(),i(v=>!v))},h=x=>{const _=p.current[x];_&&(_.muted=!d,u(v=>!v))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Pp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((x,_)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Op,{videoRefs:p,file:x,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:s},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[s?a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(_)}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(_)})]})]})},_))})},Rp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,s]=y.useState(!1),[i,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(h=>({index:h.index-1,story_uuid:m[h.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(h=>({index:h.index+1,story_uuid:m[h.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(xt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ns,{playingStory:e,duration:i,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(is,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:s,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ip(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function zp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Mp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ls(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Dp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Fp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function $p(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Bp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}function cs(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Hp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function Vp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function Wp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}const qp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Gp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(i=>({...i,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),s=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:s}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:qp(r?.[e.id]??e.view_count)}),a.jsx(rp,{size:14})]})]})},Yn=y.memo(Gp);function Kp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:i}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Yn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",i?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(re,{onClick:()=>s(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(re,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(re,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(cs,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:D("ecr-admin-reel-card__corner",i?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(re,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Dp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Fp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Yp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:s,lastStoryElementRef:i}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?i:null,children:a.jsx(Kp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:r.length>0})},l.id))})}const Xt=({cb:e})=>{const t=Se(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(gp,{size:24})})};function Xp(e){return H({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const Jt=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:s=>{if(!t)return;const i=r.href;i&&(s.preventDefault(),t(i))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Xp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(op,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:s})=>a.jsxs(ht,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:i=>{s&&(i.preventDefault(),s(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),vt=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),_t=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Jp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Jp,{}),"ReelsWP"]});function ds(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zp}=Object.prototype,{getPrototypeOf:Xn}=Object,{iterator:zr,toStringTag:us}=Symbol,Mr=(e=>t=>{const r=Zp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ve=e=>(e=e.toLowerCase(),t=>Mr(t)===e),Dr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Dr("undefined");function Zt(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&ce(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ps=ve("ArrayBuffer");function Qp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ps(e.buffer),t}const em=Dr("string"),ce=Dr("function"),ms=Dr("number"),Qt=e=>e!==null&&typeof e=="object",tm=e=>e===!0||e===!1,Fr=e=>{if(Mr(e)!=="object")return!1;const t=Xn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(us in e)&&!(zr in e)},rm=e=>{if(!Qt(e)||Zt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},nm=ve("Date"),om=ve("File"),am=ve("Blob"),sm=ve("FileList"),im=e=>Qt(e)&&ce(e.pipe),lm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ce(e.append)&&((t=Mr(e))==="formdata"||t==="object"&&ce(e.toString)&&e.toString()==="[object FormData]"))},cm=ve("URLSearchParams"),[dm,um,pm,mm]=["ReadableStream","Request","Response","Headers"].map(ve),fm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function er(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Zt(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let l;for(n=0;n<i;n++)l=s[n],t.call(null,e[l],l,e)}}function fs(e,t){if(Zt(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hs=e=>!wt(e)&&e!==ot;function Jn(){const{caseless:e,skipUndefined:t}=hs(this)&&this||{},r={},n=(o,s)=>{const i=e&&fs(r,s)||s;Fr(r[i])&&Fr(o)?r[i]=Jn(r[i],o):Fr(o)?r[i]=Jn({},o):yt(o)?r[i]=o.slice():(!t||!wt(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&er(arguments[o],n);return r}const hm=(e,t,r,{allOwnKeys:n}={})=>(er(t,(o,s)=>{r&&ce(o)?e[s]=ds(o,r):e[s]=o},{allOwnKeys:n}),e),gm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},bm=(e,t,r,n)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=r!==!1&&Xn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},vm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},_m=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!ms(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ym=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xn(Uint8Array)),wm=(e,t)=>{const n=(e&&e[zr]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},jm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Sm=ve("HTMLFormElement"),Cm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),gs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),km=ve("RegExp"),xs=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};er(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Nm=e=>{xs(e,(t,r)=>{if(ce(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ce(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Em=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Tm=()=>{},Am=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Pm(e){return!!(e&&ce(e.append)&&e[us]==="FormData"&&e[zr])}const Om=e=>{const t=new Array(10),r=(n,o)=>{if(Qt(n)){if(t.indexOf(n)>=0)return;if(Zt(n))return n;if(!("toJSON"in n)){t[o]=n;const s=yt(n)?[]:{};return er(n,(i,l)=>{const c=r(i,o+1);!wt(c)&&(s[l]=c)}),t[o]=void 0,s}}return n};return r(e,0)},Rm=ve("AsyncFunction"),Lm=e=>e&&(Qt(e)||ce(e))&&ce(e.then)&&ce(e.catch),bs=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:s})=>{o===ot&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ce(ot.postMessage)),Im=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||bs,S={isArray:yt,isArrayBuffer:ps,isBuffer:Zt,isFormData:lm,isArrayBufferView:Qp,isString:em,isNumber:ms,isBoolean:tm,isObject:Qt,isPlainObject:Fr,isEmptyObject:rm,isReadableStream:dm,isRequest:um,isResponse:pm,isHeaders:mm,isUndefined:wt,isDate:nm,isFile:om,isBlob:am,isRegExp:km,isFunction:ce,isStream:im,isURLSearchParams:cm,isTypedArray:ym,isFileList:sm,forEach:er,merge:Jn,extend:hm,trim:fm,stripBOM:gm,inherits:xm,toFlatObject:bm,kindOf:Mr,kindOfTest:ve,endsWith:vm,toArray:_m,forEachEntry:wm,matchAll:jm,isHTMLForm:Sm,hasOwnProperty:gs,hasOwnProp:gs,reduceDescriptors:xs,freezeMethods:Nm,toObjectSet:Em,toCamelCase:Cm,noop:Tm,toFiniteNumber:Am,findKey:fs,global:ot,isContextDefined:hs,isSpecCompliantForm:Pm,toJSONObject:Om,isAsyncFn:Rm,isThenable:Lm,setImmediate:bs,asap:Im,isIterable:e=>e!=null&&ce(e[zr])};function B(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const vs=B.prototype,_s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{_s[e]={value:e}}),Object.defineProperties(B,_s),Object.defineProperty(vs,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,s)=>{const i=Object.create(vs);S.toFlatObject(e,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return B.call(i,l,c,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const zm=null;function Zn(e){return S.isPlainObject(e)||S.isArray(e)}function ys(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function ws(e,t,r){return e?e.concat(t).map(function(o,s){return o=ys(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Mm(e){return S.isArray(e)&&!e.some(Zn)}const Dm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,x){return!S.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,s=r.dots,i=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new B("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,x){let _=b;if(b&&!x&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Mm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(_=S.toArray(b)))return f=ys(f),_.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(i===!0?ws([f],j,s):i===null?f:f+"[]",d(w))}),!1}return Zn(b)?!0:(t.append(ws(x,f,s),d(b)),!1)}const p=[],m=Object.assign(Dm,{defaultVisitor:u,convertValue:d,isVisitable:Zn});function h(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(_,v){(!(S.isUndefined(_)||_===null)&&o.call(t,_,S.isString(v)?v.trim():v,f,m))===!0&&h(_,f?f.concat(v):[v])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return h(e),t}function js(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Qn(e,t){this._pairs=[],e&&$r(e,this,t)}const Ss=Qn.prototype;Ss.append=function(t,r){this._pairs.push([t,r])},Ss.toString=function(t){const r=t?function(n){return t.call(this,n,js)}:js;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Fm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Cs(e,t,r){if(!t)return e;const n=r&&r.encode||Fm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(t,r):s=S.isURLSearchParams(t)?t.toString():new Qn(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ks{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ns={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$m={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Qn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},eo=typeof window<"u"&&typeof document<"u",to=typeof navigator=="object"&&navigator||void 0,Bm=eo&&(!to||["ReactNative","NativeScript","NS"].indexOf(to.product)<0),Um=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hm=eo&&window.location.href||"http://localhost",ie={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:eo,hasStandardBrowserEnv:Bm,hasStandardBrowserWebWorkerEnv:Um,navigator:to,origin:Hm},Symbol.toStringTag,{value:"Module"})),...$m};function Vm(e,t){return $r(e,new ie.classes.URLSearchParams,{visitor:function(r,n,o,s){return ie.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Wm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qm(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Es(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),c=s>=r.length;return i=!i&&S.isArray(o)?o.length:i,c?(S.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!l):((!o[i]||!S.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&S.isArray(o[i])&&(o[i]=qm(o[i])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Wm(n),o,r,0)}),r}return null}function Gm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const tr={transitional:Ns,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=S.isObject(t);if(s&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Es(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Vm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $r(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Gm(t)):t}],transformResponse:[function(t){const r=this.transitional||tr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?B.from(l,B.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{tr.headers[e]={}});const Km=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ym=e=>{const t={};let r,n,o;return e&&e.split(` |
| | 214 | `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Km[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Ts=Symbol("internals");function rr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:S.isArray(e)?e.map(Br):String(e)}function Xm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Jm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ro(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function Zm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Qm(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(l,c,d){const u=rr(c);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const i=(l,c)=>S.forEach(l,(d,u)=>s(d,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(S.isString(t)&&(t=t.trim())&&!Jm(t))i(Ym(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},c,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=rr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Xm(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=rr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ro(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=rr(i),i){const l=S.findKey(n,i);l&&(!r||ro(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||ro(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,s)=>{const i=S.findKey(n,s);if(i){r[i]=Br(o),delete r[s];return}const l=t?Zm(s):String(s).trim();l!==s&&delete r[s],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` |
| | 215 | `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Ts]=this[Ts]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=rr(i);n[l]||(Qm(o,i),n[l]=!0)}return S.isArray(t)?t.forEach(s):s(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(de);function no(e,t){const r=this||tr,n=t||r,o=de.from(n.headers);let s=n.data;return S.forEach(e,function(l){s=l.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function As(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,B,{__CANCEL__:!0});function Ps(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ef(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[s];i||(i=d),r[o]=c,n[o]=d;let p=s,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-i<t)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function rf(e,t){let r=0,n=1e3/t,o,s;const i=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?i(d,u):(o=d,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=tf(50,250);return rf(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,c=i-n,d=o(c),u=i<=l;n=i;const p={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Os=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Rs=e=>(...t)=>S.asap(()=>e(...t)),nf=ie.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ie.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,of=ie.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),s===!0&&l.push("secure"),S.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function af(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ls(e,t,r){let n=!af(t);return e&&(n||r==!1)?sf(e,t):t}const Is=e=>e instanceof de?{...e}:e;function at(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function s(d,u){if(!S.isUndefined(u))return n(void 0,u)}function i(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,u,p)=>o(Is(d),Is(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const zs=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:l}=t;if(t.headers=i=de.from(i),t.url=Cs(Ls(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&i.set(u,p)})}}if(ie.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&nf(t.url))){const c=o&&s&&of.read(s);c&&i.set(o,c)}return t},lf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=zs(e);let s=o.data;const i=de.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,h,b;function f(){h&&h(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function _(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Ps(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=_:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(_)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=j||null,n(N),x=null},x.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ns;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new B(j,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},s===void 0&&i.setContentType(null),"setRequestHeader"in x&&S.forEach(i.toJSON(),function(j,C){x.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),l&&l!=="json"&&(x.responseType=o.responseType),d&&([m,b]=Ur(d,!0),x.addEventListener("progress",m)),c&&x.upload&&([p,h]=Ur(c),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new jt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=ef(o.url);if(v&&ie.protocols.indexOf(v)===-1){n(new B("Unsupported protocol "+v+":",B.ERR_BAD_REQUEST,e));return}x.send(s||null)})},cf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new jt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},df=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},uf=async function*(e,t){for await(const r of pf(e))yield*df(r,t)},pf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ms=(e,t,r,n)=>{const o=uf(e,t);let s=0,i,l=c=>{i||(i=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=s+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Ds=64*1024,{isFunction:Hr}=S,mf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Fs,TextEncoder:$s}=S.global,Bs=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ff=e=>{e=S.merge.call({skipUndefined:!0},mf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",s=Hr(r),i=Hr(n);if(!o)return!1;const l=o&&Hr(Fs),c=o&&(typeof $s=="function"?(b=>f=>b.encode(f))(new $s):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=s&&l&&Bs(()=>{let b=!1;const f=new r(ie.origin,{body:new Fs,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=i&&l&&Bs(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,x)=>{let _=f&&f[b];if(_)return _.call(f);throw new B(`Response type '${b}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ie.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},h=async(b,f)=>{const x=S.toFiniteNumber(b.getContentLength());return x??m(f)};return async b=>{let{url:f,method:x,data:_,signal:v,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:O}=zs(b),L=t||fetch;k=k?(k+"").toLowerCase():"text";let A=cf([v,w&&w.toAbortSignal()],j),I=null;const z=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await h(E,_))!==0){let Z=new r(f,{method:"POST",body:_,duplex:"half"}),pe;if(S.isFormData(_)&&(pe=Z.headers.get("content-type"))&&E.setContentType(pe),Z.body){const[Fe,ge]=Os($,Ur(Rs(N)));_=Ms(Z.body,Ds,Fe,ge)}}S.isString(T)||(T=T?"include":"omit");const R=s&&"credentials"in r.prototype,U={...O,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:R?T:void 0};I=s&&new r(f,U);let P=await(s?L(I,O):L(f,U));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&z)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const pe=S.toFiniteNumber(P.headers.get("content-length")),[Fe,ge]=C&&Os(pe,Ur(Rs(C),!0))||[];P=new n(Ms(P.body,Ds,Fe,()=>{ge&&ge(),z&&z()}),Z)}k=k||"text";let X=await p[S.findKey(p,k)||"text"](P,b);return!q&&z&&z(),await new Promise((Z,pe)=>{Ps(Z,pe,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:b,request:I})})}catch(R){throw z&&z(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,b,I),{cause:R.cause||R}):B.from(R,R&&R.code,b,I)}}},hf=new Map,Us=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i=s.length,l=i,c,d,u=hf;for(;l--;)c=s[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:ff(t)),u=d;return d};Us();const oo={http:zm,xhr:lf,fetch:{get:Us}};S.forEach(oo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Hs=e=>`- ${e}`,gf=e=>S.isFunction(e)||e===null||e===!1;function xf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){n=e[i];let l;if(o=n,!gf(n)&&(o=oo[(l=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;s[l||"#"+i]=o}if(!o){const i=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since : |
| | 216 | `+i.map(Hs).join(` |
| | 217 | `):" "+Hs(i[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Vs={getAdapter:xf,adapters:oo};function ao(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function Ws(e){return ao(e),e.headers=de.from(e.headers),e.data=no.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Vs.getAdapter(e.adapter||tr.adapter,e)(e).then(function(n){return ao(e),n.data=no.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return As(n)||(ao(e),n&&n.response&&(n.response.data=no.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const qs="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Gs={};Vr.transitional=function(t,r,n){function o(s,i){return"[Axios v"+qs+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,l)=>{if(t===!1)throw new B(o(i," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Gs[i]&&(Gs[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function bf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const l=e[s],c=l===void 0||i(l,s,e);if(c!==!0)throw new B("option "+s+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+s,B.ERR_BAD_OPTION)}}const Wr={assertOptions:bf,validators:Vr},ke=Wr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ks,response:new ks}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` |
| | 218 | `+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&S.merge(s.common,s[r.method]);s&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=de.concat(i,s);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Ws.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let h=r;for(;p<m;){const b=l[p++],f=l[p++];try{h=b(h)}catch(x){f.call(this,x);break}}try{u=Ws.call(this,h)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=at(this.defaults,t);const r=Ls(t.baseURL,t.url,t.allowAbsoluteUrls);return Cs(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let vf=class wd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{n.subscribe(l),s=l}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,l){n.reason||(n.reason=new jt(s,i,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new wd(function(o){t=o}),cancel:t}}};function _f(e){return function(r){return e.apply(null,r)}}function yf(e){return S.isObject(e)&&e.isAxiosError===!0}const so={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(so).forEach(([e,t])=>{so[t]=e});function Ks(e){const t=new st(e),r=ds(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ks(at(e,o))},r}const ee=Ks(tr);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=vf,ee.isCancel=As,ee.VERSION=qs,ee.toFormData=$r,ee.AxiosError=B,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=_f,ee.isAxiosError=yf,ee.mergeConfig=at,ee.AxiosHeaders=de,ee.formToJSON=e=>Es(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Vs.getAdapter,ee.HttpStatusCode=so,ee.default=ee;const{Axios:x_,AxiosError:b_,CanceledError:v_,isCancel:__,CancelToken:y_,VERSION:w_,all:j_,Cancel:S_,isAxiosError:C_,spread:k_,toFormData:N_,AxiosHeaders:E_,HttpStatusCode:T_,formToJSON:A_,getAdapter:P_,mergeConfig:O_}=ee,Ys=ecommreelsInfo,ue=ee.create({baseURL:`${Ys.apiBase}`,headers:{"X-WP-Nonce":Ys.nonce,"Content-Type":"application/json"}}),wf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async i=>{try{t(!0);const l={styles:et,story_ids:i},c=await ue.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),s=y.useCallback(async(i,l)=>{try{n(!0),await ue.delete(`story/${i}`),l(c=>c.filter(d=>d.id!==i)),G.success("Reel deleted successfully!")}catch(c){c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:s}};function io(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Xs=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[s,i]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),h=io(p,500),b=y.useRef(!0),f=y.useCallback(async v=>{v===1&&b.current?u(!0):c(!0);try{const w={page:v,per_page:20};e&&(w.group_id=e),h&&(w.search=h);const j=await ue.get("stories",{params:w}),C=j.data,N=parseInt(j.headers["x-wp-totalpages"]);r(k=>v===1?C:[...k,...C]),o(v+1),i(v<N)}catch(w){w instanceof Error?G.error(w.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,h]);y.useEffect(()=>{o(1),r([]),f(1)},[h,f]);const x=y.useRef(null),_=y.useCallback(v=>{l||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&s&&f(n)}),v&&x.current.observe(v))},[l,s,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_}};function jf(){const e=Se(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:s,setSearchTerm:i,isLoading:l}=Xs(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=wf(),[h,b]=y.useState(null),[f,x]=y.useState(null),[_,v]=y.useState([]),w=async()=>{const k=await p(_);k&&e(`?view=${K.mg}&gid=${k}`)},j=()=>{v(t.map(k=>k.id))},C=k=>{v(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{h&&(await m(h,r),b(null))},[m,h,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[h&&a.jsx(Or,{onReject:()=>b(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(vt,{left:[a.jsx(_t,{name:"All Reels",Icon:ep},"page"),a.jsx(Xt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(hp,{selectedReelIds:_,handleSelectAll:j,clearSelection:()=>v([]),searchTerm:s,setSearchTerm:i,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Yp,{reels:t,styles:c,selectedReelIds:_,onSelectReel:C,onDeleteReel:b,onPreviewReel:x,lastStoryElementRef:o}):!n&&!l?a.jsx(bp,{}):null,n&&a.jsx(vp,{isFullScreen:!t.length})]}),!!f&&a.jsx(Rp,{previewReel:f,setPreviewReel:x})]})}const Sf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:s,links:i,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:s,links:i};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await ue.post("files",c);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},lo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(re,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(np,{className:"ecr-admin-save-button__icon"})," ",r]}),Js=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:s=>{e&&e(!0),r(s.target.value)}})}),Cf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const s=Se(),[i]=Vt(),l=i.get("sid"),c=i.get("from")||K.ag,d=i.get("gid"),{isSaving:u,saveStory:p}=Sf(),m=async()=>{if(u)return;const h=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});h&&s(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0,...l?{}:{state:{storyId:h}}})};return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:l?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(Xt,{},"back")],center:[a.jsx(Js,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(lo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function kf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let co;const Nf=new Uint8Array(16);function Ef(){if(!co){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");co=crypto.getRandomValues.bind(crypto)}return co(Nf)}const Zs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Tf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Ef();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,kf(n)}function uo(e,t,r){return Zs.randomUUID&&!e?Zs.randomUUID():Tf(e)}const Qs="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ei=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:s})=>{const[i,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:uo()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",i?"ecr-admin-upload--active":"ecr-admin-upload--idle",s),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Qs,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:i?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/** |
| | 219 | * @license lucide-react v0.552.0 - ISC |
| | 220 | * |
| | 221 | * This source code is licensed under the ISC license. |
| | 222 | * See the LICENSE file in the root directory of this source tree. |
| | 223 | */const Af=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ti=e=>{const t=Pf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ri=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Of=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** |
| | 224 | * @license lucide-react v0.552.0 - ISC |
| | 225 | * |
| | 226 | * This source code is licensed under the ISC license. |
| | 227 | * See the LICENSE file in the root directory of this source tree. |
| | 228 | */var Rf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** |
| | 229 | * @license lucide-react v0.552.0 - ISC |
| | 230 | * |
| | 231 | * This source code is licensed under the ISC license. |
| | 232 | * See the LICENSE file in the root directory of this source tree. |
| | 233 | */const Lf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...l},c)=>y.createElement("svg",{ref:c,...Rf,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ri("lucide",o),...!s&&!Of(l)&&{"aria-hidden":"true"},...l},[...i.map(([d,u])=>y.createElement(d,u)),...Array.isArray(s)?s:[s]]));/** |
| | 234 | * @license lucide-react v0.552.0 - ISC |
| | 235 | * |
| | 236 | * This source code is licensed under the ISC license. |
| | 237 | * See the LICENSE file in the root directory of this source tree. |
| | 238 | */const me=(e,t)=>{const r=y.forwardRef(({className:n,...o},s)=>y.createElement(Lf,{ref:s,iconNode:t,className:ri(`lucide-${Af(ti(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ti(e),r};/** |
| | 239 | * @license lucide-react v0.552.0 - ISC |
| | 240 | * |
| | 241 | * This source code is licensed under the ISC license. |
| | 242 | * See the LICENSE file in the root directory of this source tree. |
| | 243 | */const If=me("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** |
| | 244 | * @license lucide-react v0.552.0 - ISC |
| | 245 | * |
| | 246 | * This source code is licensed under the ISC license. |
| | 247 | * See the LICENSE file in the root directory of this source tree. |
| | 248 | */const po=me("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** |
| | 249 | * @license lucide-react v0.552.0 - ISC |
| | 250 | * |
| | 251 | * This source code is licensed under the ISC license. |
| | 252 | * See the LICENSE file in the root directory of this source tree. |
| | 253 | */const zf=me("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** |
| | 254 | * @license lucide-react v0.552.0 - ISC |
| | 255 | * |
| | 256 | * This source code is licensed under the ISC license. |
| | 257 | * See the LICENSE file in the root directory of this source tree. |
| | 258 | */const Mf=me("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** |
| | 259 | * @license lucide-react v0.552.0 - ISC |
| | 260 | * |
| | 261 | * This source code is licensed under the ISC license. |
| | 262 | * See the LICENSE file in the root directory of this source tree. |
| | 263 | */const Df=me("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** |
| | 264 | * @license lucide-react v0.552.0 - ISC |
| | 265 | * |
| | 266 | * This source code is licensed under the ISC license. |
| | 267 | * See the LICENSE file in the root directory of this source tree. |
| | 268 | */const Ff=me("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** |
| | 269 | * @license lucide-react v0.552.0 - ISC |
| | 270 | * |
| | 271 | * This source code is licensed under the ISC license. |
| | 272 | * See the LICENSE file in the root directory of this source tree. |
| | 273 | */const $f=me("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** |
| | 274 | * @license lucide-react v0.552.0 - ISC |
| | 275 | * |
| | 276 | * This source code is licensed under the ISC license. |
| | 277 | * See the LICENSE file in the root directory of this source tree. |
| | 278 | */const Bf=me("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/** |
| | 279 | * @license lucide-react v0.552.0 - ISC |
| | 280 | * |
| | 281 | * This source code is licensed under the ISC license. |
| | 282 | * See the LICENSE file in the root directory of this source tree. |
| | 283 | */const Uf=me("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** |
| | 284 | * @license lucide-react v0.552.0 - ISC |
| | 285 | * |
| | 286 | * This source code is licensed under the ISC license. |
| | 287 | * See the LICENSE file in the root directory of this source tree. |
| | 288 | */const Hf=me("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** |
| | 289 | * @license lucide-react v0.552.0 - ISC |
| | 290 | * |
| | 291 | * This source code is licensed under the ISC license. |
| | 292 | * See the LICENSE file in the root directory of this source tree. |
| | 293 | */const Vf=me("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** |
| | 294 | * @license lucide-react v0.552.0 - ISC |
| | 295 | * |
| | 296 | * This source code is licensed under the ISC license. |
| | 297 | * See the LICENSE file in the root directory of this source tree. |
| | 298 | */const Wf=me("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/** |
| | 299 | * @license lucide-react v0.552.0 - ISC |
| | 300 | * |
| | 301 | * This source code is licensed under the ISC license. |
| | 302 | * See the LICENSE file in the root directory of this source tree. |
| | 303 | */const qf=me("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Gf(e,t){const r=g.createContext(t),n=s=>{const{children:i,...l}=s,c=g.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:i})};n.displayName=e+"Provider";function o(s){const i=g.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(s,i){const l=g.createContext(i),c=r.length;r=[...r,i];const d=p=>{const{scope:m,children:h,...b}=p,f=m?.[e]?.[c]||l,x=g.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:x,children:h})};d.displayName=s+"Provider";function u(p,m){const h=m?.[e]?.[c]||l,b=g.useContext(h);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,u]}const o=()=>{const s=r.map(i=>g.createContext(i));return function(l){const c=l?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,Kf(o,...t)]}function Kf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(s)[`__scope${d}`];return{...l,...p}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Yf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Yf.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Xf(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>t.current?.(...r),[])}function Jf(e,t=globalThis?.document){const r=Ve(e);g.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Zf="DismissableLayer",mo="dismissableLayer.update",Qf="dismissableLayer.pointerDownOutside",eh="dismissableLayer.focusOutside",ni,oi=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,d=g.useContext(oi),[u,p]=g.useState(null),m=u?.ownerDocument??globalThis?.document,[,h]=g.useState({}),b=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(x),v=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=_,C=nh(k=>{const E=k.target,T=[...d.branches].some(O=>O.contains(E));!j||T||(o?.(k),i?.(k),k.defaultPrevented||l?.())},m),N=oh(k=>{const E=k.target;[...d.branches].some(O=>O.contains(E))||(s?.(k),i?.(k),k.defaultPrevented||l?.())},m);return Jf(k=>{v===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ni=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ai(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ni)}},[u,m,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ai())},[u,d]),g.useEffect(()=>{const k=()=>h({});return document.addEventListener(mo,k),()=>document.removeEventListener(mo,k)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=Zf;var th="DismissableLayerBranch",rh=g.forwardRef((e,t)=>{const r=g.useContext(oi),n=g.useRef(null),o=Y(t,n);return g.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});rh.displayName=th;function nh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let c=function(){si(Qf,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function oh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!n.current&&si(eh,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ai(){const e=new CustomEvent(mo);document.dispatchEvent(e)}function si(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Xf(o,s):o.dispatchEvent(s)}var fo=0;function ho(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ii()),document.body.insertAdjacentElement("beforeend",e[1]??ii()),fo++,()=>{fo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fo--}},[])}function ii(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var go="focusScope.autoFocusOnMount",xo="focusScope.autoFocusOnUnmount",li={bubbles:!1,cancelable:!0},ah="FocusScope",Gr=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,c]=g.useState(null),d=Ve(o),u=Ve(s),p=g.useRef(null),m=Y(t,f=>c(f)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let f=function(w){if(h.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:We(p.current,{select:!0})},x=function(w){if(h.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||We(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const v=new MutationObserver(_);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),v.disconnect()}}},[n,l,h.paused]),g.useEffect(()=>{if(l){ui.add(h);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(go,li);l.addEventListener(go,d),l.dispatchEvent(_),_.defaultPrevented||(sh(uh(ci(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(go,d),setTimeout(()=>{const _=new CustomEvent(xo,li);l.addEventListener(xo,u),l.dispatchEvent(_),_.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(xo,u),ui.remove(h)},0)}}},[l,d,u,h]);const b=g.useCallback(f=>{if(!r&&!n||h.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(x&&_){const v=f.currentTarget,[w,j]=ih(v);w&&j?!f.shiftKey&&_===j?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&We(j,{select:!0})):_===v&&f.preventDefault()}},[r,n,h.paused]);return a.jsx(W.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});Gr.displayName=ah;function sh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function ih(e){const t=ci(e),r=di(t,e),n=di(t.reverse(),e);return[r,n]}function ci(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function di(e,t){for(const r of e)if(!lh(r,{upTo:t}))return r}function lh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ch(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ch(e)&&t&&e.select()}}var ui=dh();function dh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=pi(e,t),e.unshift(t)},remove(t){e=pi(e,t),e[0]?.resume()}}}function pi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function uh(e){return e.filter(t=>t.tagName!=="A")}var se=globalThis?.document?g.useLayoutEffect:()=>{},ph=g[" useId ".trim().toString()]||(()=>{}),mh=0;function Ne(e){const[t,r]=g.useState(ph());return se(()=>{r(n=>n??String(mh++))},[e]),e||(t?`radix-${t}`:"")}const fh=["top","right","bottom","left"],qe=Math.min,fe=Math.max,Kr=Math.round,Yr=Math.floor,Ee=e=>({x:e,y:e}),hh={left:"right",right:"left",bottom:"top",top:"bottom"},gh={start:"end",end:"start"};function bo(e,t,r){return fe(e,qe(t,r))}function ze(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function vo(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}const xh=new Set(["top","bottom"]);function Te(e){return xh.has(Me(e))?"y":"x"}function yo(e){return vo(Te(e))}function bh(e,t,r){r===void 0&&(r=!1);const n=St(e),o=yo(e),s=_o(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xr(i)),[i,Xr(i)]}function vh(e){const t=Xr(e);return[wo(e),t,wo(t)]}function wo(e){return e.replace(/start|end/g,t=>gh[t])}const mi=["left","right"],fi=["right","left"],_h=["top","bottom"],yh=["bottom","top"];function wh(e,t,r){switch(e){case"top":case"bottom":return r?t?fi:mi:t?mi:fi;case"left":case"right":return t?_h:yh;default:return[]}}function jh(e,t,r,n){const o=St(e);let s=wh(Me(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(wo)))),s}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>hh[t])}function Sh(e){return{top:0,right:0,bottom:0,left:0,...e}}function hi(e){return typeof e!="number"?Sh(e):{top:e,right:e,bottom:e,left:e}}function Jr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function gi(e,t,r){let{reference:n,floating:o}=e;const s=Te(t),i=yo(t),l=_o(i),c=Me(t),d=s==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let h;switch(c){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:p};break;case"left":h={x:n.x-o.width,y:p};break;default:h={x:n.x,y:n.y}}switch(St(t)){case"start":h[i]-=m*(r&&d?-1:1);break;case"end":h[i]+=m*(r&&d?-1:1);break}return h}const Ch=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=gi(d,n,c),m=n,h={},b=0;for(let f=0;f<l.length;f++){const{name:x,fn:_}=l[f],{x:v,y:w,data:j,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:h,rects:d,platform:i,elements:{reference:e,floating:t}});u=v??u,p=w??p,h={...h,[x]:{...h[x],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=gi(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:h}};async function nr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:h=0}=ze(t,e),b=hi(h),x=l[m?p==="floating"?"reference":"floating":p],_=Jr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(_.top-C.top+b.top)/j.y,bottom:(C.bottom-_.bottom+b.bottom)/j.y,left:(_.left-C.left+b.left)/j.x,ri |