Файловый менеджер - Редактировать - /home/adiggxhn/it-latam.com/wp-content/plugins/uicore-elements/assets/design-cloud/design-cloud.js
Ðазад
(()=>{var e={940:(e,t,r)=>{var n;self,n=(e,t)=>(()=>{"use strict";var r={391:(e,t,r)=>{var n=r(33);n.createRoot,n.hydrateRoot},153:(e,t,r)=>{var n=r(12),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,i={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,n)&&!l.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},579:(e,t,r)=>{e.exports=r(153)},330:(e,t,r)=>{var n=r(12),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=n.useState,s=n.useEffect,a=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=i({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return a((function(){o.value=r,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,r,t]),s((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},461:(e,t,r)=>{e.exports=r(330)},12:t=>{t.exports=e},33:e=>{e.exports=t}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;o.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&r;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>r[e]));return s.default=()=>r,o.d(i,s),i}})(),o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};o.r(i),o.d(i,{DesignCloud:()=>tf});var s=o(12),a=o.t(s,2),l=o.n(s),c=(o(391),"undefined"==typeof window||"Deno"in globalThis);function u(){}function d(e){return"number"==typeof e&&e>=0&&e!==1/0}function f(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return"function"==typeof e?e(t):e}function p(e,t){return"function"==typeof e?e(t):e}function m(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s)if(n){if(t.queryHash!==v(s,t.options))return!1}else if(!x(t.queryKey,s))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function g(e,t){const{exact:r,status:n,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(y(t.options.mutationKey)!==y(i))return!1}else if(!x(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function v(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,((e,t)=>C(t)?Object.keys(t).sort().reduce(((e,r)=>(e[r]=t[r],e)),{}):t))}function x(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((r=>!x(e[r],t[r])))}function b(e,t){if(e===t)return e;const r=j(e)&&j(t);if(r||C(e)&&C(t)){const n=r?e:Object.keys(e),o=n.length,i=r?t:Object.keys(t),s=i.length,a=r?[]:{};let l=0;for(let o=0;o<s;o++){const s=r?o:i[o];(!r&&n.includes(s)||r)&&void 0===e[s]&&void 0===t[s]?(a[s]=void 0,l++):(a[s]=b(e[s],t[s]),a[s]===e[s]&&void 0!==e[s]&&l++)}return o===s&&l===o?e:a}return t}function w(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function j(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C(e){if(!E(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!E(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function E(e){return"[object Object]"===Object.prototype.toString.call(e)}function M(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?b(e,t):t}function N(e){return e}function D(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=[...e,t];return r&&n.length>r?n.slice(1):n}function k(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var R=Symbol();function S(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==R?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var O=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},o=e=>setTimeout(e,0);const i=n=>{t?e.push(n):o((()=>{r(n)}))};return{batch:i=>{let s;t++;try{s=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o((()=>{n((()=>{t.forEach((e=>{r(e)}))}))}))})()}return s},batchCalls:e=>function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];i((()=>{e(...r)}))},schedule:i,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{o=e}}}(),P=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_=new class extends P{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!c&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach((t=>{t(e)}))}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},T=new class extends P{#n=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!c&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach((t=>{t(e)})))}isOnline(){return this.#n}};function A(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n}));function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch((()=>{})),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function I(e){return Math.min(1e3*2**e,3e4)}function L(e){return"online"!==(e??"online")||T.isOnline()}var F=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function z(e){return e instanceof F}function B(e){let t,r=!1,n=0,o=!1;const i=A(),s=()=>_.isFocused()&&("always"===e.networkMode||T.isOnline())&&e.canRun(),a=()=>L(e.networkMode)&&e.canRun(),l=r=>{o||(o=!0,e.onSuccess?.(r),t?.(),i.resolve(r))},u=r=>{o||(o=!0,e.onError?.(r),t?.(),i.reject(r))},d=()=>new Promise((r=>{t=e=>{(o||s())&&r(e)},e.onPause?.()})).then((()=>{t=void 0,o||e.onContinue?.()})),f=()=>{if(o)return;let t;const i=0===n?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(l).catch((t=>{if(o)return;const i=e.retry??(c?0:3),a=e.retryDelay??I,l="function"==typeof a?a(n,t):a,h=!0===i||"number"==typeof i&&n<i||"function"==typeof i&&i(n,t);var p;!r&&h?(n++,e.onFail?.(n,t),(p=l,new Promise((e=>{setTimeout(e,p)}))).then((()=>s()?void 0:d())).then((()=>{r?u(t):f()}))):u(t)}))};return{promise:i,cancel:t=>{o||(u(new F(t)),e.abort?.())},continue:()=>(t?.(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?f():d().then(f),i)}}var U=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#o=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(c?1/0:3e5))}clearGcTimeout(){this.#o&&(clearTimeout(this.#o),this.#o=void 0)}},q=class extends U{#i;#s;#a;#l;#c;#u;#d;constructor(e){super(),this.#d=!1,this.#u=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#l=e.client,this.#a=this.#l.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#i=function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#i,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#c?.promise}setOptions(e){this.options={...this.#u,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#a.remove(this)}setData(e,t){const r=M(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#c?.promise;return this.#c?.cancel(e),t?t.then(u).catch(u):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#i)}isActive(){return this.observers.some((e=>!1!==p(e.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===R||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((e=>e.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.state.isInvalidated||void 0===this.state.data||!f(this.state.dataUpdatedAt,e)}onFocus(){const e=this.observers.find((e=>e.shouldFetchOnWindowFocus()));e?.refetch({cancelRefetch:!1}),this.#c?.continue()}onOnline(){const e=this.observers.find((e=>e.shouldFetchOnReconnect()));e?.refetch({cancelRefetch:!1}),this.#c?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.#c&&(this.#d?this.#c.cancel({revert:!0}):this.#c.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#c)return this.#c.continueRetry(),this.#c.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,r.signal)})},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:()=>{const e=S(this.options,t),r={client:this.#l,queryKey:this.queryKey,meta:this.meta};return n(r),this.#d=!1,this.options.persister?this.options.persister(e,r,this):e(r)}};n(o),this.options.behavior?.onFetch(o,this),this.#s=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#f({type:"fetch",meta:o.fetchOptions?.meta});const i=e=>{z(e)&&e.silent||this.#f({type:"error",error:e}),z(e)||(this.#a.config.onError?.(e,this),this.#a.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#c=B({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{if(void 0!==e){try{this.setData(e)}catch(e){return void i(e)}this.#a.config.onSuccess?.(e,this),this.#a.config.onSettled?.(e,this.state.error,this),this.scheduleGc()}else i(new Error(`${this.queryHash} data is undefined`))},onError:i,onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#c.start()}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...K(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return z(r)&&r.revert&&this.#s?{...this.#s,fetchStatus:"idle"}:{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),O.batch((()=>{this.observers.forEach((e=>{e.onQueryUpdate()})),this.#a.notify({query:this,type:"updated",action:e})}))}};function K(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:L(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var $=class extends P{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.config=e,this.#h=new Map}#h;build(e,t,r){const n=t.queryKey,o=t.queryHash??v(n,t);let i=this.get(o);return i||(i=new q({client:e,queryKey:n,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){this.#h.has(e.queryHash)||(this.#h.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#h.get(e.queryHash);t&&(e.destroy(),t===e&&this.#h.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){O.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#h.get(e)}getAll(){return[...this.#h.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>m(t,e)))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>m(e,t))):t}notify(e){O.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){O.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){O.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},Q=class extends U{#p;#m;#c;constructor(e){super(),this.mutationId=e.mutationId,this.#m=e.mutationCache,this.#p=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#p.includes(e)||(this.#p.push(e),this.clearGcTimeout(),this.#m.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#p=this.#p.filter((t=>t!==e)),this.scheduleGc(),this.#m.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#p.length||("pending"===this.state.status?this.scheduleGc():this.#m.remove(this))}continue(){return this.#c?.continue()??this.execute(this.state.variables)}async execute(e){this.#c=B({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#m.canRun(this)});const t="pending"===this.state.status,r=!this.#c.canStart();try{if(!t){this.#f({type:"pending",variables:e,isPaused:r}),await(this.#m.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:r})}const n=await this.#c.start();return await(this.#m.config.onSuccess?.(n,e,this.state.context,this)),await(this.options.onSuccess?.(n,e,this.state.context)),await(this.#m.config.onSettled?.(n,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(n,null,e,this.state.context)),this.#f({type:"success",data:n}),n}catch(t){try{throw await(this.#m.config.onError?.(t,e,this.state.context,this)),await(this.options.onError?.(t,e,this.state.context)),await(this.#m.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,t,e,this.state.context)),t}finally{this.#f({type:"error",error:t})}}finally{this.#m.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),O.batch((()=>{this.#p.forEach((t=>{t.onMutationUpdate(e)})),this.#m.notify({mutation:this,type:"updated",action:e})}))}},W=class extends P{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.config=e,this.#g=new Set,this.#v=new Map,this.#y=0}#g;#v;#y;build(e,t,r){const n=new Q({mutationCache:this,mutationId:++this.#y,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#g.add(e);const t=H(e);if("string"==typeof t){const r=this.#v.get(t);r?r.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#g.delete(e)){const t=H(e);if("string"==typeof t){const r=this.#v.get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=H(e);if("string"==typeof t){const r=this.#v.get(t),n=r?.find((e=>"pending"===e.state.status));return!n||n===e}return!0}runNext(e){const t=H(e);if("string"==typeof t){const r=this.#v.get(t)?.find((t=>t!==e&&t.state.isPaused));return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){O.batch((()=>{this.#g.forEach((e=>{this.notify({type:"removed",mutation:e})})),this.#g.clear(),this.#v.clear()}))}getAll(){return Array.from(this.#g)}find(e){const t={exact:!0,...e};return this.getAll().find((e=>g(t,e)))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter((t=>g(e,t)))}notify(e){O.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return O.batch((()=>Promise.all(e.map((e=>e.continue().catch(u))))))}};function H(e){return e.options.scope?.id}function G(e){return{onFetch:(t,r)=>{const n=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let r=!1;const c=S(t.options,t.fetchOptions),u=async(e,n,o)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const i={client:t.client,queryKey:t.queryKey,pageParam:n,direction:o?"backward":"forward",meta:t.options.meta};var s;s=i,Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",(()=>{r=!0})),t.signal)});const a=await c(i),{maxPages:l}=t.options,u=o?k:D;return{pages:u(e.pages,a,l),pageParams:u(e.pageParams,n,l)}};if(o&&i.length){const e="backward"===o,t={pages:i,pageParams:s},r=(e?Z:V)(n,t);a=await u(t,r,e)}else{const t=e??i.length;do{const e=0===l?s[0]??n.initialPageParam:V(n,a);if(l>0&&null==e)break;a=await u(a,e),l++}while(l<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function V(e,t){let{pages:r,pageParams:n}=t;const o=r.length-1;return r.length>0?e.getNextPageParam(r[o],r,n[o],n):void 0}function Z(e,t){let{pages:r,pageParams:n}=t;return r.length>0?e.getPreviousPageParam?.(r[0],r,n[0],n):void 0}var Y=o(579),X=s.createContext(void 0),J=e=>{const t=s.useContext(X);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ee=e=>{let{client:t,children:r}=e;return s.useEffect((()=>(t.mount(),()=>{t.unmount()})),[t]),(0,Y.jsx)(X.Provider,{value:t,children:r})};function te(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function re(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>{let r=!1;const n=t.map((t=>{const n=te(t,e);return r||"function"!=typeof n||(r=!0),n}));if(r)return()=>{for(let e=0;e<n.length;e++){const r=n[e];"function"==typeof r?r():te(t[e],null)}}}}function ne(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s.useCallback(re(...t),t)}var oe=s.forwardRef(((e,t)=>{const{children:r,...n}=e,o=s.Children.toArray(r),i=o.find(ae);if(i){const e=i.props.children,r=o.map((t=>t===i?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t));return(0,Y.jsx)(ie,{...n,ref:t,children:s.isValidElement(e)?s.cloneElement(e,void 0,r):null})}return(0,Y.jsx)(ie,{...n,ref:t,children:r})}));oe.displayName="Slot";var ie=s.forwardRef(((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(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)}(r),o=function(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]=function(){i(...arguments),o(...arguments)}:o&&(r[n]=o):"style"===n?r[n]={...o,...i}:"className"===n&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(o.ref=t?re(t,e):e),s.cloneElement(r,o)}return s.Children.count(r)>1?s.Children.only(null):null}));ie.displayName="SlotClone";var se=e=>{let{children:t}=e;return(0,Y.jsx)(Y.Fragment,{children:t})};function ae(e){return s.isValidElement(e)&&e.type===se}function le(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=le(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ce(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=le(e))&&(n&&(n+=" "),n+=t);return n}const ue=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,de=ce,fe=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return de(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map((e=>{const t=null==r?void 0:r[e],n=null==i?void 0:i[e];if(null===t)return null;const s=ue(t)||ue(n);return o[e][s]})),a=r&&Object.entries(r).reduce(((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e}),{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce(((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every((e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...a}[t]):{...i,...a}[t]===r}))?[...e,r,n]:e}),[]);return de(e,s,l,null==r?void 0:r.class,null==r?void 0:r.className)},he=e=>{const t=ve(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),pe(r,t)||ge(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},pe=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?pe(e.slice(1),n):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find((e=>{let{validator:t}=e;return t(i)}))?.classGroupId},me=/^\[(.+)\]$/,ge=e=>{if(me.test(e)){const t=me.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},ve=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return we(Object.entries(e.classGroups),r).forEach((e=>{let[r,o]=e;ye(o,n,r,t)})),n},ye=(e,t,r,n)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return be(e)?void ye(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach((e=>{let[o,i]=e;ye(i,xe(t,o),r,n)}))}else(""===e?t:xe(t,e)).classGroupId=r}))},xe=(e,t)=>{let r=e;return t.split("-").forEach((e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)})),r},be=e=>e.isThemeGetter,we=(e,t)=>t?e.map((e=>{let[r,n]=e;return[r,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((e=>{let[r,n]=e;return[t+r,n]}))):e))]})):e,je=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,i)=>{r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},Ce=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],i=t.length,s=e=>{const r=[];let s,a=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===a){if(u===o&&(n||e.slice(c,c+i)===t)){r.push(e.slice(l,c)),l=c+i;continue}if("/"===u){s=c;continue}}"["===u?a++:"]"===u&&a--}const c=0===r.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:r,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:s&&s>l?s-l:void 0}};return r?e=>r({className:e,parseClassName:s}):s},Ee=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach((e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)})),t.push(...r.sort()),t},Me=/\s+/;function Ne(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=De(e))&&(n&&(n+=" "),n+=t);return n}const De=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=De(e[n]))&&(r&&(r+=" "),r+=t);return r},ke=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Re=/^\[(?:([a-z-]+):)?(.+)\]$/i,Se=/^\d+\/\d+$/,Oe=new Set(["px","full","screen"]),Pe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_e=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Le=e=>ze(e)||Oe.has(e)||Se.test(e),Fe=e=>Xe(e,"length",Je),ze=e=>Boolean(e)&&!Number.isNaN(Number(e)),Be=e=>Xe(e,"number",ze),Ue=e=>Boolean(e)&&Number.isInteger(Number(e)),qe=e=>e.endsWith("%")&&ze(e.slice(0,-1)),Ke=e=>Re.test(e),$e=e=>Pe.test(e),Qe=new Set(["length","size","percentage"]),We=e=>Xe(e,Qe,et),He=e=>Xe(e,"position",et),Ge=new Set(["image","url"]),Ve=e=>Xe(e,Ge,rt),Ze=e=>Xe(e,"",tt),Ye=()=>!0,Xe=(e,t,r)=>{const n=Re.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},Je=e=>_e.test(e)&&!Te.test(e),et=()=>!1,tt=e=>Ae.test(e),rt=e=>Ie.test(e),nt=(Symbol.toStringTag,()=>{const e=ke("colors"),t=ke("spacing"),r=ke("blur"),n=ke("brightness"),o=ke("borderColor"),i=ke("borderRadius"),s=ke("borderSpacing"),a=ke("borderWidth"),l=ke("contrast"),c=ke("grayscale"),u=ke("hueRotate"),d=ke("invert"),f=ke("gap"),h=ke("gradientColorStops"),p=ke("gradientColorStopPositions"),m=ke("inset"),g=ke("margin"),v=ke("opacity"),y=ke("padding"),x=ke("saturate"),b=ke("scale"),w=ke("sepia"),j=ke("skew"),C=ke("space"),E=ke("translate"),M=()=>["auto",Ke,t],N=()=>[Ke,t],D=()=>["",Le,Fe],k=()=>["auto",ze,Ke],R=()=>["","0",Ke],S=()=>[ze,Ke];return{cacheSize:500,separator:":",theme:{colors:[Ye],spacing:[Le,Fe],blur:["none","",$e,Ke],brightness:S(),borderColor:[e],borderRadius:["none","","full",$e,Ke],borderSpacing:N(),borderWidth:D(),contrast:S(),grayscale:R(),hueRotate:S(),invert:R(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[qe,Fe],inset:M(),margin:M(),opacity:S(),padding:N(),saturate:S(),scale:S(),sepia:R(),skew:S(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",Ke]}],container:["container"],columns:[{columns:[$e]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",Ke]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ue,Ke]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ke]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",Ue,Ke]}],"grid-cols":[{"grid-cols":[Ye]}],"col-start-end":[{col:["auto",{span:["full",Ue,Ke]},Ke]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Ye]}],"row-start-end":[{row:["auto",{span:[Ue,Ke]},Ke]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ke]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ke,t]}],"min-w":[{"min-w":[Ke,t,"min","max","fit"]}],"max-w":[{"max-w":[Ke,t,"none","full","min","max","fit","prose",{screen:[$e]},$e]}],h:[{h:[Ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$e,Fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Be]}],"font-family":[{font:[Ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ke]}],"line-clamp":[{"line-clamp":["none",ze,Be]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Le,Ke]}],"list-image":[{"list-image":["none",Ke]}],"list-style-type":[{list:["none","disc","decimal",Ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Le,Fe]}],"underline-offset":[{"underline-offset":["auto",Le,Ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",He]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",We]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ve]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[Le,Ke]}],"outline-w":[{outline:[Le,Fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Le,Fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$e,Ze]}],"shadow-color":[{shadow:[Ye]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",$e,Ke]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ke]}],duration:[{duration:S()}],ease:[{ease:["linear","in","out","in-out",Ke]}],delay:[{delay:S()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ue,Ke]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ke]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Le,Fe,Be]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),ot=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];let o,i,s,a=function(t){const n=r.reduce(((e,t)=>t(e)),e());return o=(e=>({cache:je(e.cacheSize),parseClassName:Ce(e),...he(e)}))(n),i=o.cache.get,s=o.cache.set,a=l,l(t)};function l(e){const t=i(e);if(t)return t;const r=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Me);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t);let f=Boolean(d),h=n(f?u.substring(0,d):u);if(!h){if(!f){a=t+(a.length>0?" "+a:a);continue}if(h=n(u),!h){a=t+(a.length>0?" "+a:a);continue}f=!1}const p=Ee(l).join(":"),m=c?p+"!":p,g=m+h;if(i.includes(g))continue;i.push(g);const v=o(h,f);for(let e=0;e<v.length;++e){const t=v[e];i.push(m+t)}a=t+(a.length>0?" "+a:a)}return a})(e,o);return s(e,r),r}return function(){return a(Ne.apply(null,arguments))}}(nt),it=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ot(ce(t))},st=fe("cursor-pointer inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),at=s.forwardRef(((e,t)=>{let{className:r,variant:n,size:o,asChild:i=!1,...s}=e;const a=i?oe:"button";return(0,Y.jsx)(a,{className:it(st({variant:n,size:o,className:r})),ref:t,...s})}));at.displayName="Button";const lt=s.forwardRef(((e,t)=>{let{className:r,type:n,...o}=e;return(0,Y.jsx)("input",{type:n,className:it("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm hover:bg-accent transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...o})}));lt.displayName="Input";const ct=fe("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ut(e){let{className:t,variant:r,...n}=e;return(0,Y.jsx)("div",{className:it(ct({variant:r}),t),...n})}var dt=.999,ft=/[\\\/_+.#"@\[\(\{&]/,ht=/[\\\/_+.#"@\[\(\{&]/g,pt=/[\s-]/,mt=/[\s-]/g;function gt(e,t,r,n,o,i,s){if(i===t.length)return o===e.length?1:.99;var a=`${o},${i}`;if(void 0!==s[a])return s[a];for(var l,c,u,d,f=n.charAt(i),h=r.indexOf(f,o),p=0;h>=0;)(l=gt(e,t,r,n,h+1,i+1,s))>p&&(h===o?l*=1:ft.test(e.charAt(h-1))?(l*=.8,(u=e.slice(o,h-1).match(ht))&&o>0&&(l*=Math.pow(dt,u.length))):pt.test(e.charAt(h-1))?(l*=.9,(d=e.slice(o,h-1).match(mt))&&o>0&&(l*=Math.pow(dt,d.length))):(l*=.17,o>0&&(l*=Math.pow(dt,h-o))),e.charAt(h)!==t.charAt(i)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(h-1)!==n.charAt(i))&&.1*(c=gt(e,t,r,n,h+1,i+2,s))>l&&(l=.1*c),l>p&&(p=l),h=r.indexOf(f,h+1);return s[a]=p,p}function vt(e){return e.toLowerCase().replace(mt," ")}function yt(e,t,r){return gt(e=r&&r.length>0?e+" "+r.join(" "):e,t,vt(e),vt(t),0,0,{})}function xt(e,t){let{checkForDefaultPrevented:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];const n=()=>{const t=r.map((e=>s.createContext(e)));return function(r){const n=r?.[e]||t;return s.useMemo((()=>({[`__scope${e}`]:{...r,[e]:n}})),[r,n])}};return n.scopeName=e,[function(t,n){const o=s.createContext(n),i=r.length;r=[...r,n];const a=t=>{const{scope:r,children:n,...a}=t,l=r?.[e]?.[i]||o,c=s.useMemo((()=>a),Object.values(a));return(0,Y.jsx)(l.Provider,{value:c,children:n})};return a.displayName=t+"Provider",[a,function(r,a){const l=a?.[e]?.[i]||o,c=s.useContext(l);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},wt(n,...t)]}function wt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=t[0];if(1===t.length)return n;const o=()=>{const e=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const r=e.reduce(((e,r)=>{let{useScope:n,scopeName:o}=r;return{...e,...n(t)[`__scope${o}`]}}),{});return s.useMemo((()=>({[`__scope${n.scopeName}`]:r})),[r])}};return o.scopeName=n.scopeName,o}var jt=Boolean(globalThis?.document)?s.useLayoutEffect:()=>{},Ct=a["useId".toString()]||(()=>{}),Et=0;function Mt(e){const[t,r]=s.useState(Ct());return jt((()=>{e||r((e=>e??String(Et++)))}),[e]),e||(t?`radix-${t}`:"")}function Nt(e){const t=s.useRef(e);return s.useEffect((()=>{t.current=e})),s.useMemo((()=>function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current?.(...r)}),[])}function Dt(e){let{prop:t,defaultProp:r,onChange:n=()=>{}}=e;const[o,i]=function(e){let{defaultProp:t,onChange:r}=e;const n=s.useState(t),[o]=n,i=s.useRef(o),a=Nt(r);return s.useEffect((()=>{i.current!==o&&(a(o),i.current=o)}),[o,i,a]),n}({defaultProp:r,onChange:n}),a=void 0!==t,l=a?t:o,c=Nt(n);return[l,s.useCallback((e=>{if(a){const r="function"==typeof e?e(t):e;r!==t&&c(r)}else i(e)}),[a,t,i,c])]}var kt=o(33),Rt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const r=s.forwardRef(((e,r)=>{const{asChild:n,...o}=e,i=n?oe:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,Y.jsx)(i,{...o,ref:r})}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function St(e,t){e&&kt.flushSync((()=>e.dispatchEvent(t)))}var Ot,Pt="dismissableLayer.update",_t=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tt=s.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,u=s.useContext(_t),[d,f]=s.useState(null),h=d?.ownerDocument??globalThis?.document,[,p]=s.useState({}),m=ne(t,(e=>f(e))),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),x=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,w=x>=y,j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis?.document;const r=Nt(e),n=s.useRef(!1),o=s.useRef((()=>{}));return s.useEffect((()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Lt("dismissableLayer.pointerDownOutside",r,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,r]),{onPointerDownCapture:()=>n.current=!0}}((e=>{const t=e.target,r=[...u.branches].some((e=>e.contains(t)));w&&!r&&(o?.(e),a?.(e),e.defaultPrevented||l?.())}),h),C=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis?.document;const r=Nt(e),n=s.useRef(!1);return s.useEffect((()=>{const e=e=>{e.target&&!n.current&&Lt("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}((e=>{const t=e.target;[...u.branches].some((e=>e.contains(t)))||(i?.(e),a?.(e),e.defaultPrevented||l?.())}),h);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis?.document;const r=Nt(e);s.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[r,t])}((e=>{x===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))}),h),s.useEffect((()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Ot=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),It(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Ot)}}),[d,h,r,u]),s.useEffect((()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),It())}),[d,u]),s.useEffect((()=>{const e=()=>p({});return document.addEventListener(Pt,e),()=>document.removeEventListener(Pt,e)}),[]),(0,Y.jsx)(Rt.div,{...c,ref:m,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:xt(e.onFocusCapture,C.onFocusCapture),onBlurCapture:xt(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:xt(e.onPointerDownCapture,j.onPointerDownCapture)})}));Tt.displayName="DismissableLayer";var At=s.forwardRef(((e,t)=>{const r=s.useContext(_t),n=s.useRef(null),o=ne(t,n);return s.useEffect((()=>{const e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),(0,Y.jsx)(Rt.div,{...e,ref:o})}));function It(){const e=new CustomEvent(Pt);document.dispatchEvent(e)}function Lt(e,t,r,n){let{discrete:o}=n;const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),o?St(i,s):i.dispatchEvent(s)}At.displayName="DismissableLayerBranch";var Ft="focusScope.autoFocusOnMount",zt="focusScope.autoFocusOnUnmount",Bt={bubbles:!1,cancelable:!0},Ut=s.forwardRef(((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,c]=s.useState(null),u=Nt(o),d=Nt(i),f=s.useRef(null),h=ne(t,(e=>c(e))),p=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect((()=>{if(n){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:Qt(f.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Qt(f.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Qt(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}}),[n,l,p.paused]),s.useEffect((()=>{if(l){Wt.add(p);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(Ft,Bt);l.addEventListener(Ft,u),l.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=document.activeElement;for(const n of e)if(Qt(n,{select:t}),document.activeElement!==r)return}(qt(l).filter((e=>"A"!==e.tagName)),{select:!0}),document.activeElement===e&&Qt(l))}return()=>{l.removeEventListener(Ft,u),setTimeout((()=>{const t=new CustomEvent(zt,Bt);l.addEventListener(zt,d),l.dispatchEvent(t),t.defaultPrevented||Qt(e??document.body,{select:!0}),l.removeEventListener(zt,d),Wt.remove(p)}),0)}}}),[l,u,d,p]);const m=s.useCallback((e=>{if(!r&&!n)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[n,i]=function(e){const t=qt(e);return[Kt(t,e),Kt(t.reverse(),e)]}(t);n&&i?e.shiftKey||o!==i?e.shiftKey&&o===n&&(e.preventDefault(),r&&Qt(i,{select:!0})):(e.preventDefault(),r&&Qt(n,{select:!0})):o===t&&e.preventDefault()}}),[r,n,p.paused]);return(0,Y.jsx)(Rt.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})}));function qt(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Kt(e,t){for(const r of e)if(!$t(r,{upTo:t}))return r}function $t(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==r&&e===r)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Qt(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Ut.displayName="FocusScope";var Wt=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Ht(e,t),e.unshift(t)},remove(t){e=Ht(e,t),e[0]?.resume()}}}();function Ht(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Gt=s.forwardRef(((e,t)=>{const{container:r,...n}=e,[o,i]=s.useState(!1);jt((()=>i(!0)),[]);const a=r||o&&globalThis?.document?.body;return a?kt.createPortal((0,Y.jsx)(Rt.div,{...n,ref:t}),a):null}));Gt.displayName="Portal";var Vt=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=s.useState(),n=s.useRef({}),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[l,c]=function(e,t){return s.useReducer(((e,r)=>t[e][r]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect((()=>{const e=Zt(n.current);i.current="mounted"===l?e:"none"}),[l]),jt((()=>{const t=n.current,r=o.current;if(r!==e){const n=i.current,s=Zt(t);c(e?"MOUNT":"none"===s||"none"===t?.display?"UNMOUNT":r&&n!==s?"ANIMATION_OUT":"UNMOUNT"),o.current=e}}),[e,c]),jt((()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,s=i=>{const s=Zt(n.current).includes(i.animationName);if(i.target===t&&s&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)}))}},a=e=>{e.target===t&&(i.current=Zt(n.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:s.useCallback((e=>{e&&(n.current=getComputedStyle(e)),r(e)}),[])}}(t),o="function"==typeof r?r({present:n.isPresent}):s.Children.only(r),i=ne(n.ref,function(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)}(o));return"function"==typeof r||n.isPresent?s.cloneElement(o,{ref:i}):null};function Zt(e){return e?.animationName||"none"}Vt.displayName="Presence";var Yt=0;function Xt(){s.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jt()),document.body.insertAdjacentElement("beforeend",e[1]??Jt()),Yt++,()=>{1===Yt&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Yt--}}),[])}function Jt(){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 er=function(){return er=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},er.apply(this,arguments)};function tr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(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}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var rr="right-scroll-bar-position",nr="width-before-scroll-bar";function or(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ir="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,sr=new WeakMap;function ar(e){return e}var lr=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=ar);var r=[],n=!1;return{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]:null},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var i=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),r={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),r}}}}}();return t.options=er({async:!0,ssr:!1},e),t}(),cr=function(){},ur=s.forwardRef((function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:cr,onWheelCapture:cr,onTouchMoveCapture:cr}),o=n[0],i=n[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,x=e.gapMode,b=tr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,j=function(e){var t=function(e,t){var r=(0,s.useState)((function(){return{value:null,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}}))[0];return r.callback=t,r.facade}(0,(function(t){return e.forEach((function(e){return or(e,t)}))}));return ir((function(){var r=sr.get(t);if(r){var n=new Set(r),o=new Set(e),i=t.current;n.forEach((function(e){o.has(e)||or(e,null)})),o.forEach((function(e){n.has(e)||or(e,i)}))}sr.set(t,e)}),[e]),t}([r,t]),C=er(er({},b),o);return s.createElement(s.Fragment,null,d&&s.createElement(w,{sideCar:lr,removeScrollBar:u,shards:f,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:x}),a?s.cloneElement(s.Children.only(l),er(er({},C),{ref:j})):s.createElement(y,er({},C,{className:c,ref:j}),l))}));ur.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ur.classNames={fullWidth:nr,zeroRight:rr};var dr=function(e){var t=e.sideCar,r=tr(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 s.createElement(n,er({},r))};function fr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=o.nc;return t&&e.setAttribute("nonce",t),e}dr.isSideCarExport=!0;var hr=function(){var e=function(){var e=function(){var e=0,t=null;return{add:function(r){var n,o;0==e&&(t=fr())&&(o=r,(n=t).styleSheet?n.styleSheet.cssText=o:n.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}}();return function(t,r){s.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&r])}}();return function(t){var r=t.styles,n=t.dynamic;return e(r,n),null}},pr={left:0,top:0,right:0,gap:0},mr=function(e){return parseInt(e||"",10)||0},gr=hr(),vr="data-scroll-locked",yr=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(a,"px ").concat(n,";\n }\n body[").concat(vr,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(rr," {\n right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(nr," {\n margin-right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(rr," .").concat(rr," {\n right: 0 ").concat(n,";\n }\n \n .").concat(nr," .").concat(nr," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(vr,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},xr=function(){var e=parseInt(document.body.getAttribute(vr)||"0",10);return isFinite(e)?e:0},br=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;s.useEffect((function(){return document.body.setAttribute(vr,(xr()+1).toString()),function(){var e=xr()-1;e<=0?document.body.removeAttribute(vr):document.body.setAttribute(vr,e.toString())}}),[]);var i=s.useMemo((function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return pr;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[mr(r),mr(n),mr(o)]}(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])}}(o)}),[o]);return s.createElement(gr,{styles:yr(i,!t,o,r?"":"!important")})},wr=!1;if("undefined"!=typeof window)try{var jr=Object.defineProperty({},"passive",{get:function(){return wr=!0,!0}});window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch(e){wr=!1}var Cr=!!wr&&{passive:!1},Er=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Mr=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Nr(e,n)){var o=Dr(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Nr=function(e,t){return"v"===e?function(e){return Er(e,"overflowY")}(t):function(e){return Er(e,"overflowX")}(t)},Dr=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},kr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rr=function(e){return[e.deltaX,e.deltaY]},Sr=function(e){return e&&"current"in e?e.current:e},Or=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Pr=0,_r=[];function Tr(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ar=(Ir=function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(Pr++)[0],i=s.useState(hr)[0],a=s.useRef(e);s.useEffect((function(){a.current=e}),[e]),s.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Sr),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=kr(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Mr(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Mr(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*n,s=r.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var f=Dr(e,s),h=f[0],p=f[1]-f[2]-o*h;(h||p)&&Nr(e,s)&&(u+=p,d+=h),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&(Math.abs(u)<1||!1)||!c&&(Math.abs(d)<1||!1))&&(l=!0),l}(h,t,e,"h"===h?l:c)}),[]),c=s.useCallback((function(e){var r=e;if(_r.length&&_r[_r.length-1]===i){var n="deltaY"in r?Rr(r):kr(r),o=t.current.filter((function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,o=n,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)r.cancelable&&r.preventDefault();else if(!o){var s=(a.current.shards||[]).map(Sr).filter(Boolean).filter((function(e){return e.contains(r.target)}));(s.length>0?l(r,s[0]):!a.current.noIsolation)&&r.cancelable&&r.preventDefault()}}}),[]),u=s.useCallback((function(e,r,n,o){var i={name:e,delta:r,target:n,should:o,shadowParent:Tr(n)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=s.useCallback((function(e){r.current=kr(e),n.current=void 0}),[]),f=s.useCallback((function(t){u(t.type,Rr(t),t.target,l(t,e.lockRef.current))}),[]),h=s.useCallback((function(t){u(t.type,kr(t),t.target,l(t,e.lockRef.current))}),[]);s.useEffect((function(){return _r.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Cr),document.addEventListener("touchmove",c,Cr),document.addEventListener("touchstart",d,Cr),function(){_r=_r.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,Cr),document.removeEventListener("touchmove",c,Cr),document.removeEventListener("touchstart",d,Cr)}}),[]);var p=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(i,{styles:Or(o)}):null,p?s.createElement(br,{gapMode:e.gapMode}):null)},lr.useMedium(Ir),dr);var Ir,Lr=s.forwardRef((function(e,t){return s.createElement(ur,er({},e,{ref:t,sideCar:Ar}))}));Lr.classNames=ur.classNames;const Fr=Lr;var zr=new WeakMap,Br=new WeakMap,Ur={},qr=0,Kr=function(e){return e&&(e.host||Kr(e.parentNode))},$r=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),function(e,t,r,n){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var r=Kr(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Ur[r]||(Ur[r]=new WeakMap);var i=Ur[r],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(zr.get(e)||0)+1,c=(i.get(e)||0)+1;zr.set(e,l),i.set(e,c),s.push(e),1===l&&o&&Br.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return u(t),a.clear(),qr++,function(){s.forEach((function(e){var t=zr.get(e)-1,o=i.get(e)-1;zr.set(e,t),i.set(e,o),t||(Br.has(e)||e.removeAttribute(n),Br.delete(e)),o||e.removeAttribute(r)})),--qr||(zr=new WeakMap,zr=new WeakMap,Br=new WeakMap,Ur={})}}(n,o,r,"aria-hidden")):function(){return null}},Qr="Dialog",[Wr,Hr]=bt(Qr),[Gr,Vr]=Wr(Qr),Zr=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=s.useRef(null),c=s.useRef(null),[u=!1,d]=Dt({prop:n,defaultProp:o,onChange:i});return(0,Y.jsx)(Gr,{scope:t,triggerRef:l,contentRef:c,contentId:Mt(),titleId:Mt(),descriptionId:Mt(),open:u,onOpenChange:d,onOpenToggle:s.useCallback((()=>d((e=>!e))),[d]),modal:a,children:r})};Zr.displayName=Qr;var Yr="DialogTrigger",Xr=s.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,o=Vr(Yr,r),i=ne(t,o.triggerRef);return(0,Y.jsx)(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":yn(o.open),...n,ref:i,onClick:xt(e.onClick,o.onOpenToggle)})}));Xr.displayName=Yr;var Jr="DialogPortal",[en,tn]=Wr(Jr,{forceMount:void 0}),rn=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Vr(Jr,t);return(0,Y.jsx)(en,{scope:t,forceMount:r,children:s.Children.map(n,(e=>(0,Y.jsx)(Vt,{present:r||i.open,children:(0,Y.jsx)(Gt,{asChild:!0,container:o,children:e})})))})};rn.displayName=Jr;var nn="DialogOverlay",on=s.forwardRef(((e,t)=>{const r=tn(nn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Vr(nn,e.__scopeDialog);return i.modal?(0,Y.jsx)(Vt,{present:n||i.open,children:(0,Y.jsx)(sn,{...o,ref:t})}):null}));on.displayName=nn;var sn=s.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,o=Vr(nn,r);return(0,Y.jsx)(Fr,{as:oe,allowPinchZoom:!0,shards:[o.contentRef],children:(0,Y.jsx)(Rt.div,{"data-state":yn(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})})),an="DialogContent",ln=s.forwardRef(((e,t)=>{const r=tn(an,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Vr(an,e.__scopeDialog);return(0,Y.jsx)(Vt,{present:n||i.open,children:i.modal?(0,Y.jsx)(cn,{...o,ref:t}):(0,Y.jsx)(un,{...o,ref:t})})}));ln.displayName=an;var cn=s.forwardRef(((e,t)=>{const r=Vr(an,e.__scopeDialog),n=s.useRef(null),o=ne(t,r.contentRef,n);return s.useEffect((()=>{const e=n.current;if(e)return $r(e)}),[]),(0,Y.jsx)(dn,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xt(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:xt(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()})),onFocusOutside:xt(e.onFocusOutside,(e=>e.preventDefault()))})})),un=s.forwardRef(((e,t)=>{const r=Vr(an,e.__scopeDialog),n=s.useRef(!1),o=s.useRef(!1);return(0,Y.jsx)(dn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,s=r.triggerRef.current?.contains(i);s&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})})),dn=s.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=Vr(an,r),c=s.useRef(null),u=ne(t,c);return Xt(),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ut,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,Y.jsx)(Tt,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":yn(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(_n,{titleId:l.titleId}),(0,Y.jsx)(jn,{contentRef:c,descriptionId:l.descriptionId})]})]})})),fn="DialogTitle",hn=s.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,o=Vr(fn,r);return(0,Y.jsx)(Rt.h2,{id:o.titleId,...n,ref:t})}));hn.displayName=fn;var pn="DialogDescription",mn=s.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,o=Vr(pn,r);return(0,Y.jsx)(Rt.p,{id:o.descriptionId,...n,ref:t})}));mn.displayName=pn;var gn="DialogClose",vn=s.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,o=Vr(gn,r);return(0,Y.jsx)(Rt.button,{type:"button",...n,ref:t,onClick:xt(e.onClick,(()=>o.onOpenChange(!1)))})}));function yn(e){return e?"open":"closed"}vn.displayName=gn;var xn="DialogTitleWarning",[bn,wn]=function(e,t){const r=s.createContext(t),n=e=>{const{children:t,...n}=e,o=s.useMemo((()=>n),Object.values(n));return(0,Y.jsx)(r.Provider,{value:o,children:t})};return n.displayName=e+"Provider",[n,function(n){const o=s.useContext(r);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(xn,{contentName:an,titleName:fn,docsSlug:"dialog"}),_n=e=>{let{titleId:t}=e;const r=wn(xn),n=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return s.useEffect((()=>{t&&(document.getElementById(t)||console.error(n))}),[n,t]),null},jn=e=>{let{contentRef:t,descriptionId:r}=e;const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wn("DialogDescriptionWarning").contentName}}.`;return s.useEffect((()=>{const e=t.current?.getAttribute("aria-describedby");r&&e&&(document.getElementById(r)||console.warn(n))}),[n,t,r]),null},Cn=Zr,En=rn,Mn=on,Nn=ln,Dn=hn,kn=mn,Rn=vn,Sn=o(461),On='[cmdk-group=""]',Pn='[cmdk-group-items=""]',Tn='[cmdk-item=""]',An=`${Tn}:not([aria-disabled="true"])`,In="cmdk-item-select",Ln="data-value",Fn=(e,t,r)=>yt(e,t,r),zn=s.createContext(void 0),Bn=()=>s.useContext(zn),Un=s.createContext(void 0),qn=()=>s.useContext(Un),Kn=s.createContext(void 0),$n=s.forwardRef(((e,t)=>{let r=oo((()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}})),n=oo((()=>new Set)),o=oo((()=>new Map)),i=oo((()=>new Map)),a=oo((()=>new Set)),l=ro(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,x=Mt(),b=Mt(),w=Mt(),j=s.useRef(null),C=lo();no((()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}}),[d]),no((()=>{C(6,S)}),[]);let E=s.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,i,s;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)R(),D(),C(1,k);else if("value"===e&&(n||C(5,S),void 0!==(null==(o=l.current)?void 0:o.value))){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}E.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),M=s.useMemo((()=>({value:(e,t,n)=>{var o;t!==(null==(o=i.current.get(e))?void 0:o.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),C(2,(()=>{D(),E.emit()})))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{R(),D(),r.current.value||k(),E.emit()})),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=O();C(4,(()=>{R(),(null==t?void 0:t.getAttribute("id"))===e&&k(),E.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{i.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:w,labelId:b,listInnerRef:j})),[]);function N(e,t){var n,o;let i=null!=(o=null==(n=l.current)?void 0:n.filter)?o:Fn;return e?i(e,r.current.search,t):0}function D(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach((r=>{let n=o.current.get(r),i=0;n.forEach((t=>{let r=e.get(t);i=Math.max(r,i)})),t.push([r,i])}));let n=j.current;P().sort(((t,r)=>{var n,o;let i=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(Pn);t?t.appendChild(e.parentElement===t?e:e.closest(`${Pn} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Pn} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{var t;let r=null==(t=j.current)?void 0:t.querySelector(`${On}[${Ln}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)}))}function k(){let e=P().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(Ln);E.setState("value",t||void 0)}function R(){var e,t,s,a;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=N(null!=(t=null==(e=i.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(s=i.current.get(o))?void 0:s.keywords)?a:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function S(){var e,t,r;let n=O();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(On))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=j.current)?void 0:e.querySelector(`${Tn}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=j.current)?void 0:e.querySelectorAll(An))||[])}function _(e){let t=P()[e];t&&E.setState("value",t.getAttribute(Ln))}function T(e){var t;let r=O(),n=P(),o=n.findIndex((e=>e===r)),i=n[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),i&&E.setState("value",i.getAttribute(Ln))}function A(e){let t,r=O(),n=null==r?void 0:r.closest(On);for(;n&&!t;)n=e>0?eo(n,On):to(n,On),t=null==n?void 0:n.querySelector(An);t?E.setState("value",t.getAttribute(Ln)):T(e)}let I=()=>_(P().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?A(1):T(1)},F=e=>{e.preventDefault(),e.metaKey?_(0):e.altKey?A(-1):T(-1)};return s.createElement(Rt.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=y.onKeyDown)||t.call(y,e),!e.defaultPrevented)switch(e.key){case"n":case"j":v&&e.ctrlKey&&L(e);break;case"ArrowDown":L(e);break;case"p":case"k":v&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),_(0);break;case"End":e.preventDefault(),I();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=O();if(t){let e=new Event(In);t.dispatchEvent(e)}}}}},s.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:uo},c),co(e,(e=>s.createElement(Un.Provider,{value:E},s.createElement(zn.Provider,{value:M},e)))))})),Qn=s.forwardRef(((e,t)=>{var r,n;let o=Mt(),i=s.useRef(null),a=s.useContext(Kn),l=Bn(),c=ro(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;no((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=ao(o,i,[e.value,e.children,i],e.keywords),f=qn(),h=so((e=>e.value&&e.value===d.current)),p=so((e=>!(!u&&!1!==l.filter())||!e.search||e.filtered.items.get(o)>0));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){f.setState("value",d.current,!0)}if(s.useEffect((()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(In,m),()=>t.removeEventListener(In,m)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:x,forceMount:b,keywords:w,...j}=e;return s.createElement(Rt.div,{ref:io([i,t]),...j,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)})),Wn=s.forwardRef(((e,t)=>{let{heading:r,children:n,forceMount:o,...i}=e,a=Mt(),l=s.useRef(null),c=s.useRef(null),u=Mt(),d=Bn(),f=so((e=>!(!o&&!1!==d.filter())||!e.search||e.filtered.groups.has(a)));no((()=>d.group(a)),[]),ao(a,l,[e.value,e.heading,c]);let h=s.useMemo((()=>({id:a,forceMount:o})),[o]);return s.createElement(Rt.div,{ref:io([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&s.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),co(e,(e=>s.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},s.createElement(Kn.Provider,{value:h},e)))))})),Hn=s.forwardRef(((e,t)=>{let{alwaysRender:r,...n}=e,o=s.useRef(null),i=so((e=>!e.search));return r||i?s.createElement(Rt.div,{ref:io([o,t]),...n,"cmdk-separator":"",role:"separator"}):null})),Gn=s.forwardRef(((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,i=qn(),a=so((e=>e.search)),l=so((e=>e.value)),c=Bn(),u=s.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${Tn}[${Ln}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return s.useEffect((()=>{null!=e.value&&i.setState("search",e.value)}),[e.value]),s.createElement(Rt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||i.setState("search",e.target.value),null==r||r(e.target.value)}})})),Vn=s.forwardRef(((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,i=s.useRef(null),a=s.useRef(null),l=Bn();return s.useEffect((()=>{if(a.current&&i.current){let e,t=a.current,r=i.current,n=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")}))}));return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}}),[]),s.createElement(Rt.div,{ref:io([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},co(e,(e=>s.createElement("div",{ref:io([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),Zn=s.forwardRef(((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:i,container:a,...l}=e;return s.createElement(Cn,{open:r,onOpenChange:n},s.createElement(En,{container:a},s.createElement(Mn,{"cmdk-overlay":"",className:o}),s.createElement(Nn,{"aria-label":e.label,"cmdk-dialog":"",className:i},s.createElement($n,{ref:t,...l}))))})),Yn=s.forwardRef(((e,t)=>so((e=>0===e.filtered.count))?s.createElement(Rt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),Xn=s.forwardRef(((e,t)=>{let{progress:r,children:n,label:o="Loading...",...i}=e;return s.createElement(Rt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},co(e,(e=>s.createElement("div",{"aria-hidden":!0},e))))})),Jn=Object.assign($n,{List:Vn,Item:Qn,Input:Gn,Group:Wn,Separator:Hn,Dialog:Zn,Empty:Yn,Loading:Xn});function eo(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function to(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function ro(e){let t=s.useRef(e);return no((()=>{t.current=e})),t}var no="undefined"==typeof window?s.useEffect:s.useLayoutEffect;function oo(e){let t=s.useRef();return void 0===t.current&&(t.current=e()),t}function io(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function so(e){let t=qn(),r=()=>e(t.snapshot());return(0,Sn.useSyncExternalStore)(t.subscribe,r,r)}function ao(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=s.useRef(),i=Bn();return no((()=>{var s;let a=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map((e=>e.trim()));i.value(e,a,l),null==(s=t.current)||s.setAttribute(Ln,a),o.current=a})),o}var lo=()=>{let[e,t]=s.useState(),r=oo((()=>new Map));return no((()=>{r.current.forEach((e=>e())),r.current=new Map}),[e]),(e,n)=>{r.current.set(e,n),t({})}};function co(e,t){let{asChild:r,children:n}=e;return r&&s.isValidElement(n)?s.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(n),{ref:n.ref},t(n.props.children)):t(n)}var uo={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const fo=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t)).join(" ").trim()};var ho={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"};const po=(0,s.forwardRef)(((e,t)=>{let{color:r="currentColor",size:n=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:a="",children:l,iconNode:c,...u}=e;return(0,s.createElement)("svg",{ref:t,...ho,width:n,height:n,stroke:r,strokeWidth:i?24*Number(o)/Number(n):o,className:fo("lucide",a),...u},[...c.map((e=>{let[t,r]=e;return(0,s.createElement)(t,r)})),...Array.isArray(l)?l:[l]])})),mo=(e,t)=>{const r=(0,s.forwardRef)(((r,n)=>{let{className:o,...i}=r;return(0,s.createElement)(po,{ref:n,iconNode:t,className:fo(`lucide-${a=e,a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,o),...i});var a}));return r.displayName=`${e}`,r},go=mo("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),vo=mo("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),yo=Cn,xo=En,bo=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Mn,{ref:t,className:it("fixed inset-0 z-[9999] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...n})}));bo.displayName=Mn.displayName;const wo=s.forwardRef(((e,t)=>{let{className:r,children:n,hideCloseButton:o=!1,...i}=e;return(0,Y.jsxs)(xo,{children:[(0,Y.jsx)(bo,{}),(0,Y.jsxs)(Nn,{ref:t,className:it("fixed left-[50%] top-[50%] z-[9999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r,!o&&"gap-4"),...i,children:[n,!o&&(0,Y.jsxs)(Rn,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Y.jsx)(vo,{className:"h-4 w-4"}),(0,Y.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}));wo.displayName=Nn.displayName;const jo=e=>{let{className:t,...r}=e;return(0,Y.jsx)("div",{className:it("flex flex-col space-y-1.5 text-center sm:text-left items-center gap-5",t),...r})};jo.displayName="DialogHeader";const Co=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Dn,{ref:t,className:it("text-lg font-semibold leading-none tracking-tight",r),...n})}));Co.displayName=Dn.displayName,s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(kn,{ref:t,className:it("text-sm text-muted-foreground",r),...n})})).displayName=kn.displayName;const Eo=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Jn,{ref:t,className:it("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",r),...n})}));Eo.displayName=Jn.displayName;const Mo=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,Y.jsx)(go,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,Y.jsx)(Jn.Input,{ref:t,className:it("flex h-10 w-full rounded-md text-primary border-transparent bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 focus:border-none",r),...n})]})}));Mo.displayName=Jn.Input.displayName;const No=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Jn.List,{ref:t,className:it("max-h-[300px] overflow-y-auto overflow-x-hidden",r),...n})}));No.displayName=Jn.List.displayName;const Do=s.forwardRef(((e,t)=>(0,Y.jsx)(Jn.Empty,{ref:t,className:"py-6 text-center text-sm",...e})));Do.displayName=Jn.Empty.displayName;const ko=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Jn.Group,{ref:t,className:it("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r),...n})}));ko.displayName=Jn.Group.displayName;const Ro=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Jn.Separator,{ref:t,className:it("-mx-1 h-px bg-border",r),...n})}));Ro.displayName=Jn.Separator.displayName;const So=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Jn.Item,{ref:t,className:it("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r),...n})}));So.displayName=Jn.Item.displayName;const Oo=["top","right","bottom","left"],Po=Math.min,_o=Math.max,To=Math.round,Ao=Math.floor,Io=e=>({x:e,y:e}),Lo={left:"right",right:"left",bottom:"top",top:"bottom"},Fo={start:"end",end:"start"};function zo(e,t,r){return _o(e,Po(t,r))}function Bo(e,t){return"function"==typeof e?e(t):e}function Uo(e){return e.split("-")[0]}function qo(e){return e.split("-")[1]}function Ko(e){return"x"===e?"y":"x"}function $o(e){return"y"===e?"height":"width"}function Qo(e){return["top","bottom"].includes(Uo(e))?"y":"x"}function Wo(e){return Ko(Qo(e))}function Ho(e){return e.replace(/start|end/g,(e=>Fo[e]))}function Go(e){return e.replace(/left|right|bottom|top/g,(e=>Lo[e]))}function Vo(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Zo(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 Yo(e,t,r){let{reference:n,floating:o}=e;const i=Qo(t),s=Wo(t),a=$o(s),l=Uo(t),c="y"===i,u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2;let h;switch(l){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:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(qo(t)){case"start":h[s]-=f*(r&&c?-1:1);break;case"end":h[s]+=f*(r&&c?-1:1)}return h}async function Xo(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bo(t,e),p=Vo(h),m=a[f?"floating"===d?"reference":"floating":d],g=Zo(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=Zo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-b.top+p.top)/x.y,bottom:(b.bottom-g.bottom+p.bottom)/x.y,left:(g.left-b.left+p.left)/x.x,right:(b.right-g.right+p.right)/x.x}}function Jo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ei(e){return Oo.some((t=>e[t]>=0))}function ti(){return"undefined"!=typeof window}function ri(e){return ii(e)?(e.nodeName||"").toLowerCase():"#document"}function ni(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function oi(e){var t;return null==(t=(ii(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ii(e){return!!ti()&&(e instanceof Node||e instanceof ni(e).Node)}function si(e){return!!ti()&&(e instanceof Element||e instanceof ni(e).Element)}function ai(e){return!!ti()&&(e instanceof HTMLElement||e instanceof ni(e).HTMLElement)}function li(e){return!(!ti()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ni(e).ShadowRoot)}function ci(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function ui(e){return["table","td","th"].includes(ri(e))}function di(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function fi(e){const t=hi(),r=si(e)?mi(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!r[e]&&"none"!==r[e]))||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(r.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(r.contain||"").includes(e)))}function hi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function pi(e){return["html","body","#document"].includes(ri(e))}function mi(e){return ni(e).getComputedStyle(e)}function gi(e){return si(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vi(e){if("html"===ri(e))return e;const t=e.assignedSlot||e.parentNode||li(e)&&e.host||oi(e);return li(t)?t.host:t}function yi(e){const t=vi(e);return pi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ai(t)&&ci(t)?t:yi(t)}function xi(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=yi(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),s=ni(o);if(i){const e=bi(s);return t.concat(s,s.visualViewport||[],ci(o)?o:[],e&&r?xi(e):[])}return t.concat(o,xi(o,[],r))}function bi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wi(e){const t=mi(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ai(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=To(r)!==i||To(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function ji(e){return si(e)?e:e.contextElement}function Ci(e){const t=ji(e);if(!ai(t))return Io(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=wi(t);let s=(i?To(r.width):r.width)/n,a=(i?To(r.height):r.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Ei=Io(0);function Mi(e){const t=ni(e);return hi()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ei}function Ni(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),i=ji(e);let s=Io(1);t&&(n?si(n)&&(s=Ci(n)):s=Ci(e));const a=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ni(e))&&t}(i,r,n)?Mi(i):Io(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=ni(i),t=n&&si(n)?ni(n):n;let r=e,o=bi(r);for(;o&&n&&t!==r;){const e=Ci(o),t=o.getBoundingClientRect(),n=mi(o),i=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,r=ni(o),o=bi(r)}}return Zo({width:u,height:d,x:l,y:c})}function Di(e,t){const r=gi(e).scrollLeft;return t?t.left+r:Ni(oi(e)).left+r}function ki(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:Di(e,n)),y:n.top+t.scrollTop}}function Ri(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=ni(e),n=oi(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=hi();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,r);else if("document"===t)n=function(e){const t=oi(e),r=gi(e),n=e.ownerDocument.body,o=_o(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=_o(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Di(e);const a=-r.scrollTop;return"rtl"===mi(n).direction&&(s+=_o(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}(oi(e));else if(si(t))n=function(e,t){const r=Ni(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ai(e)?Ci(e):Io(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:n*i.y}}(t,r);else{const r=Mi(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Zo(n)}function Si(e,t){const r=vi(e);return!(r===t||!si(r)||pi(r))&&("fixed"===mi(r).position||Si(r,t))}function Oi(e,t,r){const n=ai(t),o=oi(t),i="fixed"===r,s=Ni(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Io(0);if(n||!n&&!i)if(("body"!==ri(t)||ci(o))&&(a=gi(t)),n){const e=Ni(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Di(o));const c=!o||n||i?Io(0):ki(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Pi(e){return"static"===mi(e).position}function _i(e,t){if(!ai(e)||"fixed"===mi(e).position)return null;if(t)return t(e);let r=e.offsetParent;return oi(e)===r&&(r=r.ownerDocument.body),r}function Ti(e,t){const r=ni(e);if(di(e))return r;if(!ai(e)){let t=vi(e);for(;t&&!pi(t);){if(si(t)&&!Pi(t))return t;t=vi(t)}return r}let n=_i(e,t);for(;n&&ui(n)&&Pi(n);)n=_i(n,t);return n&&pi(n)&&Pi(n)&&!fi(n)?r:n||function(e){let t=vi(e);for(;ai(t)&&!pi(t);){if(fi(t))return t;if(di(t))return null;t=vi(t)}return null}(e)||r}const Ai={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i="fixed"===o,s=oi(n),a=!!t&&di(t.floating);if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Io(1);const u=Io(0),d=ai(n);if((d||!d&&!i)&&(("body"!==ri(n)||ci(s))&&(l=gi(n)),ai(n))){const e=Ni(n);c=Ci(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const f=!s||d||i?Io(0):ki(s,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:oi,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[..."clippingAncestors"===r?di(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=xi(e,[],!1).filter((e=>si(e)&&"body"!==ri(e))),o=null;const i="fixed"===mi(e).position;let s=i?vi(e):e;for(;si(s)&&!pi(s);){const t=mi(s),r=fi(s);r||"fixed"!==t.position||(o=null),(i?!r&&!o:!r&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ci(s)&&!r&&Si(e,s))?n=n.filter((e=>e!==s)):o=t,s=vi(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=i[0],a=i.reduce(((e,r)=>{const n=Ri(t,r,o);return e.top=_o(n.top,e.top),e.right=Po(n.right,e.right),e.bottom=Po(n.bottom,e.bottom),e.left=_o(n.left,e.left),e}),Ri(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ti,getElementRects:async function(e){const t=this.getOffsetParent||Ti,r=this.getDimensions,n=await r(e.floating);return{reference:Oi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=wi(e);return{width:t,height:r}},getScale:Ci,isElement:si,isRTL:function(e){return"rtl"===mi(e).direction}};function Ii(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const Li=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,i=await(null==n.isRTL?void 0:n.isRTL(o.floating)),s=Uo(r),a=qo(r),l="y"===Qo(r),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Bo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(r=a.offset)?void 0:r.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Fi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Bo(e,t),c={x:r,y:n},u=await Xo(t,l),d=Qo(Uo(o)),f=Ko(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=zo(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=zo(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[f]:i,[d]:s}}}}}},zi=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=Bo(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const v=Uo(o),y=Qo(a),x=Uo(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(x||!m?[Go(a)]:function(e){const t=Go(e);return[Ho(e),t,Ho(t)]}(a)),j="none"!==p;!f&&j&&w.push(...function(e,t,r,n){const o=qo(e);let i=function(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:s;default:return[]}}(Uo(e),"start"===r,n);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Ho)))),i}(a,m,p,b));const C=[a,...w],E=await Xo(t,g),M=[];let N=(null==(n=i.flip)?void 0:n.overflows)||[];if(u&&M.push(E[v]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=qo(e),o=Wo(e),i=$o(o);let s="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Go(s)),[s,Go(s)]}(o,s,b);M.push(E[e[0]],E[e[1]])}if(N=[...N,{placement:o,overflows:M}],!M.every((e=>e<=0))){var D,k;const e=((null==(D=i.flip)?void 0:D.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:N},reset:{placement:t}};let r=null==(k=N.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!r)switch(h){case"bestFit":{var R;const e=null==(R=N.filter((e=>{if(j){const t=Qo(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(r=e);break}case"initialPlacement":r=a}if(o!==r)return{reset:{placement:r}}}return{}}}},Bi=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Bo(e,t),u=await Xo(t,c),d=Uo(o),f=qo(o),h="y"===Qo(o),{width:p,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g="end"===f?"top":"bottom");const y=m-u.top-u.bottom,x=p-u.left-u.right,b=Po(m-u[g],y),w=Po(p-u[v],x),j=!t.middlewareData.shift;let C=b,E=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(E=x),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(C=y),j&&!f){const e=_o(u.left,0),t=_o(u.right,0),r=_o(u.top,0),n=_o(u.bottom,0);h?E=p-2*(0!==e||0!==t?e+t:_o(u.left,u.right)):C=m-2*(0!==r||0!==n?r+n:_o(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:C});const M=await s.getDimensions(a.floating);return p!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}},Ui=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Bo(e,t);switch(n){case"referenceHidden":{const e=Jo(await Xo(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ei(e)}}}case"escaped":{const e=Jo(await Xo(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:ei(e)}}}default:return{}}}}},qi=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Bo(e,t)||{};if(null==c)return{};const d=Vo(u),f={x:r,y:n},h=Wo(o),p=$o(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],j=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=j?j[x]:0;C&&await(null==s.isElement?void 0:s.isElement(j))||(C=a.floating[x]||i.floating[p]);const E=b/2-w/2,M=C/2-m[p]/2-1,N=Po(d[v],M),D=Po(d[y],M),k=N,R=C-m[p]-D,S=C/2-m[p]/2+E,O=zo(k,S,R),P=!l.arrow&&null!=qo(o)&&S!==O&&i.reference[p]/2-(S<k?N:D)-m[p]/2<0,_=P?S<k?S-k:S-R:0;return{[h]:f[h]+_,data:{[h]:O,centerOffset:S-O-_,...P&&{alignmentOffset:_}},reset:P}}}),Ki=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Bo(e,t),u={x:r,y:n},d=Qo(o),f=Ko(d);let h=u[f],p=u[d];const m=Bo(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,r=i.reference[f]+i.reference[e]-g.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var v,y;const e="y"===f?"width":"height",t=["top","left"].includes(Uo(o)),r=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),n=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);p<r?p=r:p>n&&(p=n)}return{[f]:h,[d]:p}}}};var $i="undefined"!=typeof document?s.useLayoutEffect:s.useEffect;function Qi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!=n--;)if(!Qi(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;0!=n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||Qi(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function Wi(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hi(e,t){const r=Wi(e);return Math.round(t*r)/r}function Gi(e){const t=s.useRef(e);return $i((()=>{t.current=e})),t}const Vi=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(o=r,{}.hasOwnProperty.call(o,"current"))?null!=r.current?qi({element:r.current,padding:n}).fn(t):{}:r?qi({element:r,padding:n}).fn(t):{};var o}}),Zi=(e,t)=>({...Li(e),options:[e,t]}),Yi=(e,t)=>({...Fi(e),options:[e,t]}),Xi=(e,t)=>({...Ki(e),options:[e,t]}),Ji=(e,t)=>({...zi(e),options:[e,t]}),es=(e,t)=>({...Bi(e),options:[e,t]}),ts=(e,t)=>({...Ui(e),options:[e,t]}),rs=(e,t)=>({...Vi(e),options:[e,t]});var ns=s.forwardRef(((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return(0,Y.jsx)(Rt.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,Y.jsx)("polygon",{points:"0,0 30,0 15,10"})})}));ns.displayName="Arrow";var os=ns,is="Popper",[ss,as]=bt(is),[ls,cs]=ss(is),us=e=>{const{__scopePopper:t,children:r}=e,[n,o]=s.useState(null);return(0,Y.jsx)(ls,{scope:t,anchor:n,onAnchorChange:o,children:r})};us.displayName=is;var ds="PopperAnchor",fs=s.forwardRef(((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=cs(ds,r),a=s.useRef(null),l=ne(t,a);return s.useEffect((()=>{i.onAnchorChange(n?.current||a.current)})),n?null:(0,Y.jsx)(Rt.div,{...o,ref:l})}));fs.displayName=ds;var hs="PopperContent",[ps,ms]=ss(hs),gs=s.forwardRef(((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,v=cs(hs,r),[y,x]=s.useState(null),b=ne(t,(e=>x(e))),[w,j]=s.useState(null),C=function(e){const[t,r]=s.useState(void 0);return jt((()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;r({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)}),[e]),t}(w),E=C?.width??0,M=C?.height??0,N=n+("center"!==i?"-"+i:""),D="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(u)?u:[u],R=k.length>0,S={padding:D,boundary:k.filter(bs),altBoundary:R},{refs:O,floatingStyles:P,placement:_,isPositioned:T,middlewareData:A}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=s.useState(n);Qi(h,n)||p(n);const[m,g]=s.useState(null),[v,y]=s.useState(null),x=s.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),b=s.useCallback((e=>{e!==E.current&&(E.current=e,y(e))}),[]),w=i||m,j=a||v,C=s.useRef(null),E=s.useRef(null),M=s.useRef(d),N=null!=c,D=Gi(c),k=Gi(o),R=Gi(u),S=s.useCallback((()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:r,middleware:h};k.current&&(e.platform=k.current),((e,t,r)=>{const n=new Map,o={platform:Ai,...r},i={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Yo(c,n,l),f=n,h={},p=0;for(let r=0;r<a.length;r++){const{name:i,fn:m}=a[r],{x:g,y:v,data:y,reset:x}=await m({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,h={...h,[i]:{...h[i],...y}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(c=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=Yo(c,f,l))),r=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})})(C.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==R.current};O.current&&!Qi(M.current,t)&&(M.current=t,kt.flushSync((()=>{f(t)})))}))}),[h,t,r,k,R]);$i((()=>{!1===u&&M.current.isPositioned&&(M.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const O=s.useRef(!1);$i((()=>(O.current=!0,()=>{O.current=!1})),[]),$i((()=>{if(w&&(C.current=w),j&&(E.current=j),w&&j){if(D.current)return D.current(w,j,S);S()}}),[w,j,S,D,N]);const P=s.useMemo((()=>({reference:C,floating:E,setReference:x,setFloating:b})),[x,b]),_=s.useMemo((()=>({reference:w,floating:j})),[w,j]),T=s.useMemo((()=>{const e={position:r,left:0,top:0};if(!_.floating)return e;const t=Hi(_.floating,d.x),n=Hi(_.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Wi(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,l,_.floating,d.x,d.y]);return s.useMemo((()=>({...d,update:S,refs:P,elements:_,floatingStyles:T})),[d,S,P,_,T])}({strategy:"fixed",placement:N,whileElementsMounted:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=ji(e),u=o||i?[...c?xi(c):[],...xi(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)}));const d=c&&a?function(e,t){let r,n=null;const o=oi(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(a||t(),!f||!h)return;const p={rootMargin:-Ao(d)+"px "+-Ao(o.clientWidth-(u+f))+"px "+-Ao(o.clientHeight-(d+h))+"px "+-Ao(u)+"px",threshold:_o(0,Po(1,l))||1};let m=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return s();n?s(!1,n):r=setTimeout((()=>{s(!1,1e-7)}),1e3)}1!==n||Ii(c,e.getBoundingClientRect())||s(),m=!1}try{n=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,p)}n.observe(e)}(!0),i}(c,r):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),r()})),c&&!l&&p.observe(c),p.observe(t));let m=l?Ni(e):null;return l&&function t(){const n=Ni(e);m&&!Ii(m,n)&&r(),m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}(...t,{animationFrame:"always"===p})},elements:{reference:v.anchor},middleware:[Zi({mainAxis:o+M,alignmentAxis:a}),c&&Yi({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Xi():void 0,...S}),c&&Ji({...S}),es({...S,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e;const{width:i,height:s}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${s}px`)}}),w&&rs({element:w,padding:l}),ws({arrowWidth:E,arrowHeight:M}),h&&ts({strategy:"referenceHidden",...S})]}),[I,L]=js(_),F=Nt(m);jt((()=>{T&&F?.()}),[T,F]);const z=A.arrow?.x,B=A.arrow?.y,U=0!==A.arrow?.centerOffset,[q,K]=s.useState();return jt((()=>{y&&K(window.getComputedStyle(y).zIndex)}),[y]),(0,Y.jsx)("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:T?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Y.jsx)(ps,{scope:r,placedSide:I,onArrowChange:j,arrowX:z,arrowY:B,shouldHideArrow:U,children:(0,Y.jsx)(Rt.div,{"data-side":I,"data-align":L,...g,ref:b,style:{...g.style,animation:T?void 0:"none"}})})})}));gs.displayName=hs;var vs="PopperArrow",ys={top:"bottom",right:"left",bottom:"top",left:"right"},xs=s.forwardRef((function(e,t){const{__scopePopper:r,...n}=e,o=ms(vs,r),i=ys[o.placedSide];return(0,Y.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,Y.jsx)(os,{...n,ref:t,style:{...n.style,display:"block"}})})}));function bs(e){return null!==e}xs.displayName=vs;var ws=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=js(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,f=(o.arrow?.y??0)+a/2;let h="",p="";return"bottom"===l?(h=i?u:`${d}px`,p=-a+"px"):"top"===l?(h=i?u:`${d}px`,p=`${n.floating.height+a}px`):"right"===l?(h=-a+"px",p=i?u:`${f}px`):"left"===l&&(h=`${n.floating.width+a}px`,p=i?u:`${f}px`),{data:{x:h,y:p}}}});function js(e){const[t,r="center"]=e.split("-");return[t,r]}var Cs=us,Es=fs,Ms=gs,Ns=xs,Ds="Popover",[ks,Rs]=bt(Ds,[as]),Ss=as(),[Os,Ps]=ks(Ds),_s=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,l=Ss(t),c=s.useRef(null),[u,d]=s.useState(!1),[f=!1,h]=Dt({prop:n,defaultProp:o,onChange:i});return(0,Y.jsx)(Cs,{...l,children:(0,Y.jsx)(Os,{scope:t,contentId:Mt(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:s.useCallback((()=>h((e=>!e))),[h]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback((()=>d(!0)),[]),onCustomAnchorRemove:s.useCallback((()=>d(!1)),[]),modal:a,children:r})})};_s.displayName=Ds;var Ts="PopoverAnchor",As=s.forwardRef(((e,t)=>{const{__scopePopover:r,...n}=e,o=Ps(Ts,r),i=Ss(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=o;return s.useEffect((()=>(a(),()=>l())),[a,l]),(0,Y.jsx)(Es,{...i,...n,ref:t})}));As.displayName=Ts;var Is="PopoverTrigger",Ls=s.forwardRef(((e,t)=>{const{__scopePopover:r,...n}=e,o=Ps(Is,r),i=Ss(r),s=ne(t,o.triggerRef),a=(0,Y.jsx)(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Zs(o.open),...n,ref:s,onClick:xt(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:(0,Y.jsx)(Es,{asChild:!0,...i,children:a})}));Ls.displayName=Is;var Fs="PopoverPortal",[zs,Bs]=ks(Fs,{forceMount:void 0}),Us=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Ps(Fs,t);return(0,Y.jsx)(zs,{scope:t,forceMount:r,children:(0,Y.jsx)(Vt,{present:r||i.open,children:(0,Y.jsx)(Gt,{asChild:!0,container:o,children:n})})})};Us.displayName=Fs;var qs="PopoverContent",Ks=s.forwardRef(((e,t)=>{const r=Bs(qs,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Ps(qs,e.__scopePopover);return(0,Y.jsx)(Vt,{present:n||i.open,children:i.modal?(0,Y.jsx)($s,{...o,ref:t}):(0,Y.jsx)(Qs,{...o,ref:t})})}));Ks.displayName=qs;var $s=s.forwardRef(((e,t)=>{const r=Ps(qs,e.__scopePopover),n=s.useRef(null),o=ne(t,n),i=s.useRef(!1);return s.useEffect((()=>{const e=n.current;if(e)return $r(e)}),[]),(0,Y.jsx)(Fr,{as:oe,allowPinchZoom:!0,children:(0,Y.jsx)(Ws,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xt(e.onCloseAutoFocus,(e=>{e.preventDefault(),i.current||r.triggerRef.current?.focus()})),onPointerDownOutside:xt(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n}),{checkForDefaultPrevented:!1}),onFocusOutside:xt(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),Qs=s.forwardRef(((e,t)=>{const r=Ps(qs,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return(0,Y.jsx)(Ws,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,s=r.triggerRef.current?.contains(i);s&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})})),Ws=s.forwardRef(((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=Ps(qs,r),h=Ss(r);return Xt(),(0,Y.jsx)(Ut,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,Y.jsx)(Tt,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:(0,Y.jsx)(Ms,{"data-state":Zs(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),Hs="PopoverClose",Gs=s.forwardRef(((e,t)=>{const{__scopePopover:r,...n}=e,o=Ps(Hs,r);return(0,Y.jsx)(Rt.button,{type:"button",...n,ref:t,onClick:xt(e.onClick,(()=>o.onOpenChange(!1)))})}));Gs.displayName=Hs;var Vs=s.forwardRef(((e,t)=>{const{__scopePopover:r,...n}=e,o=Ss(r);return(0,Y.jsx)(Ns,{...o,...n,ref:t})}));function Zs(e){return e?"open":"closed"}Vs.displayName="PopoverArrow";var Ys=Us,Xs=Ks;const Js=_s,ea=Ls,ta=s.forwardRef(((e,t)=>{let{className:r,align:n="center",sideOffset:o=4,...i}=e;return(0,Y.jsx)(Ys,{children:(0,Y.jsx)(Xs,{ref:t,align:n,sideOffset:o,className:it("z-[100000] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...i})})}));ta.displayName=Xs.displayName;var ra="horizontal",na=["horizontal","vertical"],oa=s.forwardRef(((e,t)=>{const{decorative:r,orientation:n=ra,...o}=e,i=function(e){return na.includes(e)}(n)?n:ra,s=r?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return(0,Y.jsx)(Rt.div,{"data-orientation":i,...s,...o,ref:t})}));oa.displayName="Separator";var ia=oa;const sa=s.forwardRef(((e,t)=>{let{className:r,orientation:n="horizontal",decorative:o=!0,...i}=e;return(0,Y.jsx)(ia,{ref:t,decorative:o,orientation:n,className:it("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",r),...i})}));sa.displayName=ia.displayName;const aa=mo("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),la=mo("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),ca=mo("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),ua=mo("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]),da="m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 border-foreground/10 text-foreground bg-card hover:bg-card/80",fa=s.forwardRef(((e,t)=>{var r;let{options:n,onValueChange:o,defaultValue:i=[],placeholder:a="Select options",animation:l=0,maxCount:c=3,modalPopover:u=!1,asChild:d=!1,className:f,singleOption:h=!1,allowNew:p=!1,showSearch:m=!0,required:g=!1,onCreateNew:v,onRemoveNew:y,...x}=e;const b=h?1:c,[w,j]=s.useState(i),[C,E]=s.useState(!1),[M,N]=s.useState(!1),[D,k]=s.useState(""),R=e=>{if(h)w[0]===e?(j([]),o([])):(j([e]),o([e])),E(!1);else{const t=w.includes(e)?w.filter((t=>t!==e)):[...w,e];j(t),o(t)}},S=()=>{if(g)return j([n[0].value]),void o([n[0].value]);j([]),o([])};return(0,Y.jsxs)(Js,{open:C,onOpenChange:E,modal:u,children:[(0,Y.jsx)(ea,{asChild:!0,children:(0,Y.jsxs)(at,{ref:t,...x,onClick:()=>{E((e=>!e))},className:it("flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit [&_svg]:pointer-events-auto shadow-none hover:bg-accent",f),children:[w.length>0&&h&&(0,Y.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,Y.jsx)("span",{className:"text-sm text-popover-foreground mx-3",children:null===(r=n.find((e=>e.value===w[0])))||void 0===r?void 0:r.label}),(0,Y.jsxs)("div",{className:"flex items-center",children:[!g&&(0,Y.jsx)(vo,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),S()}}),(0,Y.jsx)(aa,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}),w.length>0&&!h&&(0,Y.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,Y.jsxs)("div",{className:"flex flex-wrap items-center",children:[w.slice(0,b).map((e=>{const t=n.find((t=>t.value===e)),r=null==t?void 0:t.icon;return(0,Y.jsxs)(ut,{className:it(M?"animate-bounce":"",da),style:{animationDuration:`${l}s`},children:[r&&(0,Y.jsx)(r,{className:"h-4 w-4 mr-2"}),null==t?void 0:t.label,(0,Y.jsx)(la,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:t=>{t.stopPropagation(),R(e)}})]},e)})),w.length>b&&(0,Y.jsxs)(ut,{className:it("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",M?"animate-bounce":"",da),style:{animationDuration:`${l}s`},children:[`+ ${w.length-b} more`,(0,Y.jsx)(la,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=w.slice(0,b);j(e),o(e)})()}})]})]}),(0,Y.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Y.jsx)(vo,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),S()}}),(0,Y.jsx)(sa,{orientation:"vertical",className:"flex min-h-6 h-full"}),(0,Y.jsx)(aa,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}),0===w.length&&(0,Y.jsxs)("div",{className:"flex items-center justify-between w-full mx-auto",children:[(0,Y.jsx)("span",{className:"text-sm text-muted-foreground mx-3",children:a}),(0,Y.jsx)(aa,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})]})}),(0,Y.jsx)(ta,{className:"w-auto p-0 min-w-[240px]",align:"start",onEscapeKeyDown:()=>E(!1),children:(0,Y.jsxs)(Eo,{children:[m&&(0,Y.jsx)(Mo,{placeholder:"Search...",onKeyDown:async e=>{const t=e.currentTarget;if("Enter"===e.key){const e=t.value.trim();if(p&&e&&!n.some((t=>t.value===e))){if(v){const t=await v(e);t&&(j([...w,t]),o([...w,t]),k(""))}return void E(!0)}E(!0)}else if("Backspace"===e.key&&!t.value){const e=[...w];e.pop(),j(e),o(e)}},value:D,onValueChange:k}),(0,Y.jsxs)(No,{children:[(0,Y.jsxs)(Do,{children:["No results found.",p&&(0,Y.jsx)("p",{className:"text-sm text-muted-foreground px-3",children:"Hit enter to create a new option."})]}),(0,Y.jsxs)(ko,{children:[!h&&n.length<1&&(0,Y.jsx)("p",{className:"text-sm text-muted-foreground px-3",children:"No options available."}),!h&&n.length>1&&(0,Y.jsxs)(So,{onSelect:()=>{if(!h)if(w.length===n.length)S();else{const e=n.map((e=>e.value));j(e),o(e)}},className:"cursor-pointer",children:[(0,Y.jsx)("div",{className:it("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",w.length===n.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,Y.jsx)(ca,{className:"h-4 w-4"})}),(0,Y.jsx)("span",{children:"(Select All)"})]},"all"),n.map((e=>{const t=w.includes(e.value);return(0,Y.jsxs)("div",{className:"relative",children:[(0,Y.jsxs)(So,{onSelect:()=>R(e.value),className:"cursor-pointer",children:[(0,Y.jsx)("div",{className:it("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",t?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,Y.jsx)(ca,{className:"h-4 w-4"})}),e.icon&&(0,Y.jsx)(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),(0,Y.jsx)("span",{children:e.label})]},e.value),p&&(0,Y.jsx)(la,{className:"ml-2 h-4 w-4 cursor-pointer absolute right-2 top-[50%] -translate-y-1/2 text-muted-foreground hover:text-red-500",onClick:t=>{t.nativeEvent.stopImmediatePropagation(),null==y||y(e.value)}})]},e.value)}))]}),!g&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ro,{}),(0,Y.jsx)(ko,{children:(0,Y.jsxs)("div",{className:"flex items-center justify-between",children:[w.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(So,{onSelect:S,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),(0,Y.jsx)(sa,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),(0,Y.jsx)(So,{onSelect:()=>E(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"})]})})]})]})]})}),l>0&&w.length>0&&(0,Y.jsx)(ua,{className:it("cursor-pointer my-2 text-foreground bg-background w-3 h-3",M?"":"text-muted-foreground"),onClick:()=>N(!M)})]})}));var ha,pa;fa.displayName="MultiSelect";const ma=(null===(ha=window)||void 0===ha||null===(pa=ha.ui_dc_global)||void 0===pa?void 0:pa.api)||"http://dc.uicore",ga=e=>{const{template:t}=e,[r,n]=(0,s.useState)([]),[o,i]=(0,s.useState)(""),[a,l]=(0,s.useState)(""),[c,u]=(0,s.useState)(""),[d,f]=(0,s.useState)([]),[h,p]=(0,s.useState)([]),[m,g]=(0,s.useState)(""),v=[{value:"14",label:"My Agency Starter",token:"dc-271-4375e4c6fdc33c3"},{value:"2",label:"fake Collection 1",token:"fewuihgf43u7"}],y=(0,s.useCallback)((()=>v.find((e=>e.value===r[0]))),[r])(),x=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="POST";const n={token:null==y?void 0:y.token,user_id:"1",category:e};t&&(r="DELETE");try{const t=await fetch(`${ma}/?rest_route=/dc/v1/collections/${null==y?void 0:y.value}/category`,{method:r,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(t.ok){const r=await t.json(),{category_id:n}=r;return n?(p([...h,{value:n,label:e}]),g("Category added successfully!"),n):void g("Category failed to add.")}return void g("Category failed to add.")}catch(e){return void g("Error adding category.")}};return(0,s.useEffect)((()=>{y&&(async()=>{const e=new URLSearchParams;e.append("token",(null==y?void 0:y.token)||""),e.append("user_id","1");const t=await fetch(`${ma}/?rest_route=/dc/v1/collections/${null==y?void 0:y.value}/categories&${e.toString()}`);if(t.ok){const e=(await t.json()).map((e=>({value:e.id,label:e.name})));p(e)}})()}),[y]),(0,Y.jsxs)("main",{className:"h-full w-full p-4",children:[(0,Y.jsx)("h1",{children:"Design Cloud"}),(0,Y.jsx)("p",{children:"Welcome to the cloud design interface."}),(0,Y.jsxs)("form",{onSubmit:async e=>{e.preventDefault();const r={token:null==y?void 0:y.token,user_id:"1",type:c,post_data:{title:o,content:[t],tags:a,category:d.join(",")}};try{(await fetch(`${ma}/?rest_route=/dc/v1/collections/${null==y?void 0:y.value}/save`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})).ok?g("Template submitted successfully!"):g("Submission failed.")}catch(e){g("Error submitting form.")}},children:[(0,Y.jsxs)("div",{children:[(0,Y.jsx)("label",{children:"Collection:"}),(0,Y.jsx)(fa,{options:v,onValueChange:e=>n(e),defaultValue:r,placeholder:"Select a collection",singleOption:!0})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("label",{children:"Template Type:"}),(0,Y.jsx)(fa,{options:[{value:"page",label:"Page"},{value:"block",label:"Block"}],onValueChange:e=>u(e[0]),defaultValue:[c],placeholder:"Select a type",singleOption:!0})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("label",{children:"Template Name:"}),(0,Y.jsx)(lt,{type:"text",value:o,onChange:e=>i(e.target.value),required:!0})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("label",{children:"Tags:"}),(0,Y.jsx)(lt,{type:"text",value:a,onChange:e=>l(e.target.value),placeholder:"Enter tags separated by commas"})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("label",{children:"Category:"}),(0,Y.jsx)(fa,{options:h,onValueChange:e=>f(e),defaultValue:d,placeholder:"Select categories",allowNew:!0,onCreateNew:e=>x(e),onRemoveNew:async e=>{await x(e,!0),p(h.filter((t=>t.value!==e)))}})]}),(0,Y.jsx)(at,{type:"submit",children:"Submit Template"})]}),m&&(0,Y.jsx)("p",{children:m})]})},va={blocks:{navLabel:"Blocks",hidden:!1},pages:{navLabel:"Pages",hidden:!1},favorites:{navLabel:"Favorites",hidden:!1},cloud:{navLabel:"Cloud Settings",hidden:!0}},ya=(0,s.createContext)(void 0),xa=e=>{let{children:t,defaultTab:r}=e;const[n,o]=(0,s.useState)(r||"blocks"),i=va[n]?{...va[n],id:n}:{id:n,navLabel:n};return(0,Y.jsx)(ya.Provider,{value:{activeTab:i,setActiveTabId:o},children:t})},ba=()=>{const e=(0,s.useContext)(ya);if(void 0===e)throw new Error("useTabs must be used within a TabsProvider");return e},wa=(0,s.memo)((()=>{const{activeTab:e,setActiveTabId:t}=ba(),r=(0,s.useMemo)((()=>[]),[]),n=(0,s.useMemo)((()=>"cloud"===e.id?[]:[...Object.keys(va).map((r=>{const n=r;return"hidden"in va[n]&&va[n].hidden?null:{label:va[n].navLabel,key:n,onClick:()=>t(n),isActive:n===e.id}})).filter((e=>null!==e)),...r.length?r.map((r=>({label:null==r?void 0:r.label,key:null==r?void 0:r.value,onClick:()=>t(null==r?void 0:r.value),isActive:(null==r?void 0:r.value)===e.id}))):[]]),[e.id,t,r]);return"fake"===e.id?(0,Y.jsx)("div",{className:"uicore-dc-popup-close",children:"test"}):(0,Y.jsxs)("header",{className:"flex items-center py-4 px-6 border-b h-[60px] border-border",children:[(0,Y.jsx)("img",{alt:"UiCore design cloud logo",className:"h-6",src:"https://r2.dc.uicore.co/ui-dc.svg"}),(0,Y.jsx)("nav",{className:"mx-auto",children:(0,Y.jsx)("ul",{className:"flex gap-5",children:n&&n.map((e=>{let{isActive:t,label:r,key:n,onClick:o}=e;return(0,Y.jsx)(at,{className:t?"underline":"hover:no-underline hover:opacity-70",onClick:o,variant:"link",children:r},n)}))})})]})}));var ja=class extends P{constructor(e,t){super(),this.options=t,this.#l=e,this.#x=null,this.#b=A(),this.options.experimental_prefetchInRender||this.#b.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#l;#w=void 0;#j=void 0;#C=void 0;#E;#M;#b;#x;#N;#D;#k;#R;#S;#O;#P=(()=>new Set)();bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),Ca(this.#w,this.options)?this.#_():this.updateResult(),this.#T())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ea(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ea(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#A(),this.#I(),this.#w.removeObserver(this)}setOptions(e,t){const r=this.options,n=this.#w;if(this.options=this.#l.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof p(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#L(),this.#w.setOptions(this.options),r._defaulted&&!w(this.options,r)&&this.#l.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const o=this.hasListeners();o&&Ma(this.#w,n,this.options,r)&&this.#_(),this.updateResult(t),!o||this.#w===n&&p(this.options.enabled,this.#w)===p(r.enabled,this.#w)&&h(this.options.staleTime,this.#w)===h(r.staleTime,this.#w)||this.#F();const i=this.#z();!o||this.#w===n&&p(this.options.enabled,this.#w)===p(r.enabled,this.#w)&&i===this.#O||this.#B(i)}getOptimisticResult(e){const t=this.#l.getQueryCache().build(this.#l,e),r=this.createResult(t,e);return function(e,t){return!w(e.getCurrentResult(),t)}(this,r)&&(this.#C=r,this.#M=this.options,this.#E=this.#w.state),r}getCurrentResult(){return this.#C}trackResult(e,t){const r={};return Object.keys(e).forEach((n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),t?.(n),e[n])})})),r}trackProp(e){this.#P.add(e)}getCurrentQuery(){return this.#w}refetch(){let{...e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.fetch({...e})}fetchOptimistic(e){const t=this.#l.defaultQueryOptions(e),r=this.#l.getQueryCache().build(this.#l,t);return r.fetch().then((()=>this.createResult(r,t)))}fetch(e){return this.#_({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#C)))}#_(e){this.#L();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u)),t}#F(){this.#A();const e=h(this.options.staleTime,this.#w);if(c||this.#C.isStale||!d(e))return;const t=f(this.#C.dataUpdatedAt,e)+1;this.#R=setTimeout((()=>{this.#C.isStale||this.updateResult()}),t)}#z(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#B(e){this.#I(),this.#O=e,!c&&!1!==p(this.options.enabled,this.#w)&&d(this.#O)&&0!==this.#O&&(this.#S=setInterval((()=>{(this.options.refetchIntervalInBackground||_.isFocused())&&this.#_()}),this.#O))}#T(){this.#F(),this.#B(this.#z())}#A(){this.#R&&(clearTimeout(this.#R),this.#R=void 0)}#I(){this.#S&&(clearInterval(this.#S),this.#S=void 0)}createResult(e,t){const r=this.#w,n=this.options,o=this.#C,i=this.#E,s=this.#M,a=e!==r?e.state:this.#j,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const o=this.hasListeners(),i=!o&&Ca(e,t),s=o&&Ma(e,r,t,n);(i||s)&&(u={...u,...K(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:p}=u;if(t.select&&void 0!==u.data)if(o&&u.data===i?.data&&t.select===this.#N)c=this.#D;else try{this.#N=t.select,c=t.select(u.data),c=M(o?.data,c,t),this.#D=c,this.#x=null}catch(e){this.#x=e}else c=u.data;if(void 0!==t.placeholderData&&void 0===c&&"pending"===p){let e;if(o?.isPlaceholderData&&t.placeholderData===s?.placeholderData)e=o.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#k?.state.data,this.#k):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#x=null}catch(e){this.#x=e}void 0!==e&&(p="success",c=M(o?.data,e,t),d=!0)}this.#x&&(f=this.#x,c=this.#D,h=Date.now(),p="error");const m="fetching"===u.fetchStatus,g="pending"===p,v="error"===p,y=g&&m,x=void 0!==c,b={status:p,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===p,isError:v,isInitialLoading:y,isLoading:y,data:c,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:v&&!x,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:v&&x,isStale:Na(e,t),refetch:this.refetch,promise:this.#b};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===b.status?e.reject(b.error):void 0!==b.data&&e.resolve(b.data)},n=()=>{const e=this.#b=b.promise=A();t(e)},o=this.#b;switch(o.status){case"pending":e.queryHash===r.queryHash&&t(o);break;case"fulfilled":"error"!==b.status&&b.data===o.value||n();break;case"rejected":"error"===b.status&&b.error===o.reason||n()}}return b}updateResult(e){const t=this.#C,r=this.createResult(this.#w,this.options);if(this.#E=this.#w.state,this.#M=this.options,void 0!==this.#E.data&&(this.#k=this.#w),w(r,t))return;this.#C=r;const n={};!1!==e?.listeners&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.#P.size)return!0;const n=new Set(r??this.#P);return this.options.throwOnError&&n.add("error"),Object.keys(this.#C).some((e=>{const r=e;return this.#C[r]!==t[r]&&n.has(r)}))})()&&(n.listeners=!0),this.#U({...n,...e})}#L(){const e=this.#l.getQueryCache().build(this.#l,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#j=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#T()}#U(e){O.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#C)})),this.#l.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})}))}};function Ca(e,t){return function(e,t){return!1!==p(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&Ea(e,t,t.refetchOnMount)}function Ea(e,t,r){if(!1!==p(t.enabled,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&Na(e,t)}return!1}function Ma(e,t,r,n){return(e!==t||!1===p(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&Na(e,r)}function Na(e,t){return!1!==p(t.enabled,e)&&e.isStaleByTime(h(t.staleTime,e))}var Da=s.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}());function ka(e,t){return"function"==typeof e?e(...t):!!e}function Ra(){}var Sa=s.createContext(!1),Oa=(Sa.Provider,(e,t,r)=>t.fetchOptimistic(e).catch((()=>{r.clearReset()})));function Pa(e,t){return function(e,t,r){const n=J(r),o=s.useContext(Sa),i=s.useContext(Da),a=n.defaultQueryOptions(e);n.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=o?"isRestoring":"optimistic",(e=>{const t=e.staleTime;e.suspense&&(e.staleTime="function"==typeof t?function(){return Math.max(t(...arguments),1e3)}:Math.max(t??1e3,1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))})(a),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(a,i),(e=>{s.useEffect((()=>{e.clearReset()}),[e])})(i);const l=!n.getQueryCache().get(a.queryHash),[u]=s.useState((()=>new t(n,a))),d=u.getOptimisticResult(a),f=!o&&!1!==e.subscribed;if(s.useSyncExternalStore(s.useCallback((e=>{const t=f?u.subscribe(O.batchCalls(e)):Ra;return u.updateResult(),t}),[u,f]),(()=>u.getCurrentResult()),(()=>u.getCurrentResult())),s.useEffect((()=>{u.setOptions(a,{listeners:!1})}),[a,u]),((e,t)=>e?.suspense&&t.isPending)(a,d))throw Oa(a,u,i);if((e=>{let{result:t,errorResetBoundary:r,throwOnError:n,query:o,suspense:i}=e;return t.isError&&!r.isReset()&&!t.isFetching&&o&&(i&&void 0===t.data||ka(n,[t.error,o]))})({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:n.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;if(n.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!c&&((e,t)=>e.isLoading&&e.isFetching&&!t)(d,o)){const e=l?Oa(a,u,i):n.getQueryCache().get(a.queryHash)?.promise;e?.catch(Ra).finally((()=>{u.updateResult()}))}return a.notifyOnChangeProps?d:u.trackResult(d)}(e,ja,t)}const _a=(0,s.forwardRef)(((e,t)=>{let{className:r,children:n,...o}=e;return(0,Y.jsx)("div",{ref:t,className:it("relative overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300",r),...o,children:n})}));_a.displayName="ScrollArea";const Ta=(0,s.createContext)(void 0),Aa=e=>{let{children:t}=e;const{activeTab:r}=ba(),[n,o]=(0,s.useState)(0),[i,a]=(0,s.useState)("all"),[l,c]=(0,s.useState)("block");return(0,s.useEffect)((()=>{"cloud"===r.id?o(null):o(0)}),[r]),(0,s.useEffect)((()=>{o(0)}),[l]),(0,Y.jsx)(Ta.Provider,{value:{activeCategory:n,setActiveCategory:o,activeCollections:i,setActiveCollection:a,activeType:l,setActiveType:c},children:t})},Ia=()=>{const e=(0,s.useContext)(Ta);if(void 0===e)throw new Error("useCategoriesAndCollections must be used within a CardsProvider");return e},La=()=>{var e,t,r,n,o,i,s,a,l,c,u,d,f,h,p;const m=null===(e=window)||void 0===e||null===(t=e.ui_dc_global)||void 0===t||null===(r=t.license)||void 0===r?void 0:r.product,g=null===(n=window)||void 0===n||null===(o=n.ui_dc_global)||void 0===o?void 0:o.builder,v=null===(i=window)||void 0===i||null===(s=i.ui_dc_global)||void 0===s||null===(a=s.license)||void 0===a?void 0:a.key,y=null==v?void 0:v.split("ui")[1],x=(null===(l=window)||void 0===l||null===(c=l.ui_dc_global)||void 0===c||null===(u=c.license)||void 0===u?void 0:u.url)||(null===(d=window)||void 0===d||null===(f=d.ui_dc_global)||void 0===f?void 0:f.local_url),b=null==v?void 0:v.split("ui")[0];return{product:m,builder:g,license:v,user_id:y,website_url:x,website_id:b,local_url:null===(h=window)||void 0===h||null===(p=h.ui_dc_global)||void 0===p?void 0:p.local_url}};var Fa,za;const Ba=(null===(Fa=window)||void 0===Fa||null===(za=Fa.ui_dc_global)||void 0===za?void 0:za.api)||"http://dc.uicore",{user_id:Ua,website_id:qa}=La(),Ka=()=>{const{data:e}=Pa({queryKey:["favorites"],queryFn:async()=>{const e=await fetch(`${Ba}/?rest_route=/dc/v1/get_favorites&user_id=${Ua}&website_id=${qa}`);if(!e.ok)return[];const t=await e.json();return console.log("favorites response",t),t},gcTime:36e5}),t={};return null!=e&&e.length&&e.forEach((e=>t[e]=!0)),{favorites:t,favoritesArray:e}},$a=e=>{let{className:t,...r}=e;return(0,Y.jsx)("div",{className:it("animate-pulse rounded-md bg-primary/10",t),...r})},Qa=e=>{let{id:t,name:r,count:n}=e;const{activeCategory:o,setActiveCategory:i}=Ia(),s=o===t?"bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground":"text-foreground hover:text-foreground";return(0,Y.jsx)("li",{onClick:()=>i(t),children:(0,Y.jsxs)("button",{className:`gap-3 items-center relative px-3 py-2 w-full flex rounded-sm transition-colors font-medium text-sm hover:bg-accent justify-between ${s}`,type:"button",children:[r," ",(0,Y.jsx)("span",{className:"min-w-[24px] text-[10px] rounded-full bg-gray-500 px-[6px] py-[2px] font-[600] text-white dark:bg-white/5 ",children:n})]})})},Wa=()=>(0,Y.jsx)("li",{children:(0,Y.jsx)($a,{className:"w-full h-9 bg-accent"})});var Ha,Ga;const Va=(null===(Ha=window)||void 0===Ha||null===(Ga=Ha.ui_dc_global)||void 0===Ga?void 0:Ga.api)||"http://dc.uicore.co",Za=()=>{const{activeTab:e}=ba(),{activeType:t,activeCollections:r,setActiveCollection:n,setActiveType:o}=Ia(),{id:i}=e,a=!("pages"===i||"blocks"===i),l="favorites"===i,{favoritesArray:c}=Ka(),u=l?c:void 0,d=(0,s.useCallback)((async()=>{const e=a?i:r,{product:n,builder:o,user_id:s,website_id:l}=La(),c=new URLSearchParams({collection:String(e),product:n,builder:o,user_id:s,website_id:l,type:t});"blocks"===i?c.set("type","block"):"pages"===i&&c.set("type","page"),a&&c.append("collection_view","true");const d={method:u?"POST":"GET",headers:{"Content-Type":"application/json"},body:u?JSON.stringify({ids:u}):null},f=await fetch(`${Va}/?rest_route=/dc/v1/terms&${c.toString()}`,d);return await f.json()}),[i,t,r,u]),{isLoading:f,data:h}=Pa({queryKey:["categories-and-collections",i,t,r],queryFn:d,gcTime:36e5}),p=(null==h?void 0:h.categories)||{},m=Object.keys(p).map((e=>{const t=p[e];return{id:e,...t,count:Number(t.count)}})),g=(null==h?void 0:h.collections)||{},v=Object.keys(g).reverse().map((e=>({value:g[e].id,label:g[e].name})));v.unshift({value:"all",label:"All"});const y=!a&&Boolean(g.length)?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"text-sm font-semibold mb-3",children:"Collections"}),(0,Y.jsx)(fa,{options:v,onValueChange:e=>n(e[0]),defaultValue:r?[r]:[],placeholder:"Select a collection",singleOption:!0,required:!0},"collections")]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"text-sm font-semibold mb-3",children:"Template Type"}),(0,Y.jsx)(fa,{options:[{value:"page",label:"Pages"},{value:"block",label:"Blocks"}],onValueChange:e=>o(e[0]),defaultValue:t?[t]:[],placeholder:"Select a template type",singleOption:!0,required:!0,showSearch:!1},i)]});return(0,Y.jsxs)(_a,{className:"h-full min-w-72 w-72 border-r px-6 py-4 border-border",children:[y,(0,Y.jsx)(sa,{className:"my-4"}),(0,Y.jsx)("ul",{className:"flex flex-col gap-1",children:f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Wa,{}),(0,Y.jsx)(Wa,{}),(0,Y.jsx)(Wa,{}),(0,Y.jsx)(Wa,{}),(0,Y.jsx)(Wa,{})]}):m.map((e=>(0,s.createElement)(Qa,{...e,key:e.id})))})]})};function Ya(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}var Xa=["color"],Ja=(0,s.forwardRef)((function(e,t){var r=e.color,n=void 0===r?"currentColor":r,o=Ya(e,Xa);return(0,s.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),(0,s.createElement)("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),el=["color"],tl=(0,s.forwardRef)((function(e,t){var r=e.color,n=void 0===r?"currentColor":r,o=Ya(e,el);return(0,s.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),(0,s.createElement)("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),rl=["color"],nl=(0,s.forwardRef)((function(e,t){var r=e.color,n=void 0===r?"currentColor":r,o=Ya(e,rl);return(0,s.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),(0,s.createElement)("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:n}))})),ol=["color"],il=(0,s.forwardRef)((function(e,t){var r=e.color,n=void 0===r?"currentColor":r,o=Ya(e,ol);return(0,s.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),(0,s.createElement)("path",{d:"M4.89346 2.35248C3.49195 2.35248 2.35248 3.49359 2.35248 4.90532C2.35248 6.38164 3.20954 7.9168 4.37255 9.33522C5.39396 10.581 6.59464 11.6702 7.50002 12.4778C8.4054 11.6702 9.60608 10.581 10.6275 9.33522C11.7905 7.9168 12.6476 6.38164 12.6476 4.90532C12.6476 3.49359 11.5081 2.35248 10.1066 2.35248C9.27059 2.35248 8.81894 2.64323 8.5397 2.95843C8.27877 3.25295 8.14623 3.58566 8.02501 3.88993C8.00391 3.9429 7.98315 3.99501 7.96211 4.04591C7.88482 4.23294 7.7024 4.35494 7.50002 4.35494C7.29765 4.35494 7.11523 4.23295 7.03793 4.04592C7.01689 3.99501 6.99612 3.94289 6.97502 3.8899C6.8538 3.58564 6.72126 3.25294 6.46034 2.95843C6.18109 2.64323 5.72945 2.35248 4.89346 2.35248ZM1.35248 4.90532C1.35248 2.94498 2.936 1.35248 4.89346 1.35248C6.0084 1.35248 6.73504 1.76049 7.20884 2.2953C7.32062 2.42147 7.41686 2.55382 7.50002 2.68545C7.58318 2.55382 7.67941 2.42147 7.79119 2.2953C8.265 1.76049 8.99164 1.35248 10.1066 1.35248C12.064 1.35248 13.6476 2.94498 13.6476 4.90532C13.6476 6.74041 12.6013 8.50508 11.4008 9.96927C10.2636 11.3562 8.92194 12.5508 8.00601 13.3664C7.94645 13.4194 7.88869 13.4709 7.83291 13.5206C7.64324 13.6899 7.3568 13.6899 7.16713 13.5206C7.11135 13.4709 7.05359 13.4194 6.99403 13.3664C6.0781 12.5508 4.73641 11.3562 3.59926 9.96927C2.39872 8.50508 1.35248 6.74041 1.35248 4.90532Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),sl=["color"],al=(0,s.forwardRef)((function(e,t){var r=e.color,n=void 0===r?"currentColor":r,o=Ya(e,sl);return(0,s.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),(0,s.createElement)("path",{d:"M1.35248 4.90532C1.35248 2.94498 2.936 1.35248 4.89346 1.35248C6.25769 1.35248 6.86058 1.92336 7.50002 2.93545C8.13946 1.92336 8.74235 1.35248 10.1066 1.35248C12.064 1.35248 13.6476 2.94498 13.6476 4.90532C13.6476 6.74041 12.6013 8.50508 11.4008 9.96927C10.2636 11.3562 8.92194 12.5508 8.00601 13.3664C7.94645 13.4194 7.88869 13.4709 7.83291 13.5206C7.64324 13.6899 7.3568 13.6899 7.16713 13.5206C7.11135 13.4709 7.05359 13.4194 6.99403 13.3664C6.0781 12.5508 4.73641 11.3562 3.59926 9.96927C2.39872 8.50508 1.35248 6.74041 1.35248 4.90532Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),ll=["color"],cl=(0,s.forwardRef)((function(e,t){var r=e.color,n=void 0===r?"currentColor":r,o=Ya(e,ll);return(0,s.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),(0,s.createElement)("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}));const ul=e=>{let{words:t,extraClassName:r}=e;return(0,Y.jsxs)("div",{className:`flex flex-col items-center justify-center gap-9 pt-9 ${r}`,children:[(0,Y.jsx)("div",{className:"uicore-dc-spinner animate-spin",children:(0,Y.jsx)("div",{className:"uicore-dc-spinner-inner animate-pulse"})}),(0,Y.jsx)("div",{className:"uicore-dc-loader",children:(0,Y.jsx)("div",{className:"overflow-hidden relative uicore-dc-words",children:t.map(((e,t)=>(0,Y.jsx)("div",{className:"uicore-dc-word text-center h-full",children:e},t)))})})]})},dl=mo("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),fl=mo("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),hl=(mo("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),e=>{let{className:t,...r}=e;return(0,Y.jsx)("nav",{role:"navigation","aria-label":"pagination",className:it("mx-auto flex w-full justify-center",t),...r})});hl.displayName="Pagination";const pl=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)("ul",{ref:t,className:it("flex flex-row items-center gap-1",r),...n})}));pl.displayName="PaginationContent";const ml=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)("li",{ref:t,className:it("",r),...n})}));ml.displayName="PaginationItem";const gl=e=>{let{className:t,active:r,disabled:n,size:o="icon",...i}=e;return(0,Y.jsx)("button",{"aria-current":r?"page":"false","aria-disabled":n?"true":"false",onClick:n?e=>e.preventDefault():i.onClick,className:it(st({variant:r?"outline":"ghost",size:o}),t,{"opacity-50":n}),...i,disabled:n})};gl.displayName="PaginationLink";const vl=e=>{let{className:t,...r}=e;return(0,Y.jsxs)(gl,{"aria-label":"Go to previous page",size:"default",className:it("gap-1 pl-2.5",t),...r,children:[(0,Y.jsx)(dl,{className:"h-4 w-4"}),(0,Y.jsx)("span",{children:"Previous"})]})};vl.displayName="PaginationPrevious";const yl=e=>{let{className:t,...r}=e;return(0,Y.jsxs)(gl,{"aria-label":"Go to next page",size:"default",className:it("gap-1 pr-2.5",t),...r,children:[(0,Y.jsx)("span",{children:"Next"}),(0,Y.jsx)(fl,{className:"h-4 w-4"})]})};yl.displayName="PaginationNext";var xl=s.forwardRef(((e,t)=>(0,Y.jsx)(Rt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));xl.displayName="VisuallyHidden";var bl=xl,[wl,jl]=bt("Tooltip",[as]),Cl=as(),El="TooltipProvider",Ml=700,Nl="tooltip.open",[Dl,kl]=wl(El),Rl=e=>{const{__scopeTooltip:t,delayDuration:r=Ml,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,[a,l]=s.useState(!0),c=s.useRef(!1),u=s.useRef(0);return s.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),(0,Y.jsx)(Dl,{scope:t,isOpenDelayed:a,delayDuration:r,onOpen:s.useCallback((()=>{window.clearTimeout(u.current),l(!1)}),[]),onClose:s.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>l(!0)),n)}),[n]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback((e=>{c.current=e}),[]),disableHoverableContent:o,children:i})};Rl.displayName=El;var Sl="Tooltip",[Ol,Pl]=wl(Sl),_l=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=e,c=kl(Sl,e.__scopeTooltip),u=Cl(t),[d,f]=s.useState(null),h=Mt(),p=s.useRef(0),m=a??c.disableHoverableContent,g=l??c.delayDuration,v=s.useRef(!1),[y=!1,x]=Dt({prop:n,defaultProp:o,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Nl))):c.onClose(),i?.(e)}}),b=s.useMemo((()=>y?v.current?"delayed-open":"instant-open":"closed"),[y]),w=s.useCallback((()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,x(!0)}),[x]),j=s.useCallback((()=>{window.clearTimeout(p.current),p.current=0,x(!1)}),[x]),C=s.useCallback((()=>{window.clearTimeout(p.current),p.current=window.setTimeout((()=>{v.current=!0,x(!0),p.current=0}),g)}),[g,x]);return s.useEffect((()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)}),[]),(0,Y.jsx)(Cs,{...u,children:(0,Y.jsx)(Ol,{scope:t,contentId:h,open:y,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:s.useCallback((()=>{c.isOpenDelayed?C():w()}),[c.isOpenDelayed,C,w]),onTriggerLeave:s.useCallback((()=>{m?j():(window.clearTimeout(p.current),p.current=0)}),[j,m]),onOpen:w,onClose:j,disableHoverableContent:m,children:r})})};_l.displayName=Sl;var Tl="TooltipTrigger",Al=s.forwardRef(((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Pl(Tl,r),i=kl(Tl,r),a=Cl(r),l=ne(t,s.useRef(null),o.onTriggerChange),c=s.useRef(!1),u=s.useRef(!1),d=s.useCallback((()=>c.current=!1),[]);return s.useEffect((()=>()=>document.removeEventListener("pointerup",d)),[d]),(0,Y.jsx)(Es,{asChild:!0,...a,children:(0,Y.jsx)(Rt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:xt(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(u.current||i.isPointerInTransitRef.current||(o.onTriggerEnter(),u.current=!0))})),onPointerLeave:xt(e.onPointerLeave,(()=>{o.onTriggerLeave(),u.current=!1})),onPointerDown:xt(e.onPointerDown,(()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})})),onFocus:xt(e.onFocus,(()=>{c.current||o.onOpen()})),onBlur:xt(e.onBlur,o.onClose),onClick:xt(e.onClick,o.onClose)})})}));Al.displayName=Tl;var[Il,Ll]=wl("TooltipPortal",{forceMount:void 0}),Fl="TooltipContent",zl=s.forwardRef(((e,t)=>{const r=Ll(Fl,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=Pl(Fl,e.__scopeTooltip);return(0,Y.jsx)(Vt,{present:n||s.open,children:s.disableHoverableContent?(0,Y.jsx)(Kl,{side:o,...i,ref:t}):(0,Y.jsx)(Bl,{side:o,...i,ref:t})})})),Bl=s.forwardRef(((e,t)=>{const r=Pl(Fl,e.__scopeTooltip),n=kl(Fl,e.__scopeTooltip),o=s.useRef(null),i=ne(t,o),[a,l]=s.useState(null),{trigger:c,onClose:u}=r,d=o.current,{onPointerInTransitChange:f}=n,h=s.useCallback((()=>{l(null),f(!1)}),[f]),p=s.useCallback(((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...o,...function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect())]);l(i),f(!0)}),[f]);return s.useEffect((()=>()=>h()),[h]),s.useEffect((()=>{if(c&&d){const e=e=>p(e,d),t=e=>p(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}}),[c,d,p,h]),s.useEffect((()=>{if(a){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=c?.contains(t)||d?.contains(t),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const s=t[e].x,a=t[e].y,l=t[i].x,c=t[i].y;a>n!=c>n&&r<(l-s)*(n-a)/(c-a)+s&&(o=!o)}return o}(r,a);n?h():o&&(h(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[c,d,a,u,h]),(0,Y.jsx)(Kl,{...e,ref:i})})),[Ul,ql]=wl(Sl,{isInside:!1}),Kl=s.forwardRef(((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=e,c=Pl(Fl,r),u=Cl(r),{onClose:d}=c;return s.useEffect((()=>(document.addEventListener(Nl,d),()=>document.removeEventListener(Nl,d))),[d]),s.useEffect((()=>{if(c.trigger){const e=e=>{const t=e.target;t?.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[c.trigger,d]),(0,Y.jsx)(Tt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,Y.jsxs)(Ms,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,Y.jsx)(se,{children:n}),(0,Y.jsx)(Ul,{scope:r,isInside:!0,children:(0,Y.jsx)(bl,{id:c.contentId,role:"tooltip",children:o||n})})]})})}));zl.displayName=Fl;var $l="TooltipArrow",Ql=s.forwardRef(((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Cl(r);return ql($l,r).isInside?null:(0,Y.jsx)(Ns,{...o,...n,ref:t})}));Ql.displayName=$l;var Wl=zl;const Hl=Rl,Gl=_l,Vl=Al,Zl=s.forwardRef(((e,t)=>{let{className:r,sideOffset:n=4,...o}=e;return(0,Y.jsx)(Wl,{ref:t,sideOffset:n,className:it("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...o})}));Zl.displayName=Wl.displayName;const Yl=mo("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]),Xl=mo("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Jl=mo("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var ec,tc,rc,nc;const oc=(null===(ec=window)||void 0===ec||null===(tc=ec.ui_dc_global)||void 0===tc?void 0:tc.api)||"http://dc.uicore",ic=(null===(rc=window)||void 0===rc||null===(nc=rc.ui_dc_global)||void 0===nc?void 0:nc.local_url)||"http://dc.uicore",sc=(0,s.memo)((e=>{let{id:t}=e;const[r,n]=(0,s.useState)(null),[o,i]=(0,s.useState)(0),[a,l]=(0,s.useState)(""),{product:c,user_id:u,license:d,website_url:f,builder:h}=La(),p=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;l(null),n("loading"),i(0),setTimeout((()=>{"loading"===r&&(n("error"),l("An error occurred while loading the template."),setTimeout((()=>{n(null),l(null)}),1e4))}),6e4);const o=new URLSearchParams({product:c,user_id:u,token:e||d,url:f,builder:h,template:t.toString()}),s={method:"GET",headers:{"Content-Type":"application/json"}};try{const e=await fetch(`${oc}/?rest_route=/dc/v1/get_template&${o.toString()}`,s),t=await e.json();if(null!=t&&t.success){let e;var a,p,m,g;if(n("processing"),"el"===h?e=await(async e=>{var t,r;const n={method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(null===(t=window)||void 0===t||null===(r=t.ui_dc_global)||void 0===r?void 0:r.nonce)||""},body:JSON.stringify(e)};try{const e=await fetch(`${ic}/?rest_route=/uielem/v1/prepare_template`,n),t=await e.json();return null!=t&&t.success?{success:!0,template:t.template}:{success:!1,error:t.error||"Error preparing data"}}catch(e){return console.error("Error preparing data:",e),{success:!1,error:"Error preparing data"}}})(t):"gt"===h?e=await(async e=>{var t,r;const n={method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(null===(t=window)||void 0===t||null===(r=t.ui_dc_global)||void 0===r?void 0:r.nonce)||""},body:JSON.stringify({template:e.data})};try{const e=await fetch(`${ic}/?rest_route=/uicore-blocks/v1/import-images`,n),t=await e.json();return null!=t&&t.success?(console.log("fail image import",t.data.fails),{success:!0,template:t.data.template}):{success:!1,error:t.error||"Error preparing data"}}catch(e){return console.error("Error preparing data:",e),{success:!1,error:"Error preparing data"}}})(t):console.log("Unknown builder type:",h),e&&e.success&&"template"in e&&e.template)return n(null),console.log("result",null===(a=e)||void 0===a?void 0:a.template),"gt"===h?(e=>{var t,r;const n=null===(t=window)||void 0===t?void 0:t.wp.blocks.parse(e);null===(r=window)||void 0===r||r.wp.data.dispatch("core/block-editor").insertBlocks(n)})(null===(m=e)||void 0===m?void 0:m.template):(e=>{var t,r=window.designCloudIndex||void 0;for(let t=0;t<e.length;t++){var n,o,i,s=window.$e.internal("document/history/start-log",{type:"add",title:"Add UiCore Library Element"}),a={container:null===(n=window)||void 0===n?void 0:n.elementor.getPreviewContainer(),model:e[t],options:void 0!==r&&r>=0?{at:r++}:{}};console.log(a),null===(o=window)||void 0===o||o.$e.run("document/elements/create",a),null===(i=window)||void 0===i||i.$e.internal("document/history/end-log",{id:s})}null===(t=window)||void 0===t||t.$e.internal("document/save/set-is-modified",{status:!0})})(null===(g=e)||void 0===g?void 0:g.template),void(null===(p=document.querySelector(".uicore-dc-popup-close"))||void 0===p||p.click());e&&!e.success&&(n("error"),l(e.error||"An error occurred"))}else{if("connect"===t.code)return n("connect"),void l((null==t?void 0:t.message)||"Your product is not connected.");n("error"),l((null==t?void 0:t.error)||"An error occurred")}}catch(e){console.error("Error fetching template:",e)}},m=async()=>{if("connecting"!==r)return;i((e=>e+1));const e="el"===h?"uielem":"uibl",t=await fetch(`${ic}/?rest_route=/${e}/v1/check_connection`,{method:"GET",headers:{"Content-Type":"application/json"}}),o=await t.json();o.success&&o.license&&o.license.key?(n("processing"),window.ui_dc_global.license.key=o.license.key,window.ui_dc_global.license.url=o.license.url,p(o.license.key)):setTimeout((()=>{m()}),2e3)};return(0,Y.jsxs)(yo,{open:null!==r,children:[(0,Y.jsxs)(at,{className:"translate-y-3 group-hover:translate-y-0 w-full transition-all gap-2 py-3 h-auto",onClick:()=>p(),children:["Add Template",(0,Y.jsx)(Yl,{size:18})]}),(0,Y.jsxs)(wo,{className:"ui-dc-styles",hideCloseButton:!0,children:[(0,Y.jsx)(Co,{children:(0,Y.jsx)(xl,{children:"Import Template"})}),(0,Y.jsx)(jo,{children:"loading"===r?(0,Y.jsx)(ul,{words:["Please wait","Processing your request","Setting up the Connection","Downloading the template","Fetching the data"]}):"processing"===r?(0,Y.jsx)(ul,{words:["Please wait","Preparing data","Decoding content","Downloading Media","Finalizing setup"]}):"connect"===r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Xl,{size:36,className:"text-red-500 mt-3 mb-2"}),(0,Y.jsx)("div",{className:"text-xl/6 font-medium text-gray-950",children:a}),(0,Y.jsxs)("div",{className:"flex justify-end mt-5",children:[(0,Y.jsxs)(at,{onClick:async e=>{l(null),n("connecting"),m(),window.open("https://my.uicore.co/connect/?ui_connect=true&ui_connect_url="+ic+"&ui_connect_product="+c,"","")},children:["Connect My Product"," ",(0,Y.jsx)(Jl,{className:"ml-3",size:20})]}),(0,Y.jsx)(at,{variant:"destructive",className:"ml-2",onClick:()=>{n(null)},children:"Cancel"})]})]}):"connecting"===r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ul,{words:["Please wait","Checking for license","Waiting for connection","Checking for updates","Connecting to server"]}),o>20&&(0,Y.jsx)(at,{variant:"destructive",className:"ml-2",onClick:()=>{n(null)},children:"Cancel"})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Xl,{size:36,className:"text-red-500 mt-3 mb-2"}),(0,Y.jsx)("div",{className:"text-xl/6 font-medium text-gray-950",children:a}),(0,Y.jsx)("div",{className:"flex justify-end mt-5",children:(0,Y.jsx)(at,{variant:"destructive",className:"ml-2",onClick:()=>{n(null)},children:"Cancel"})})]})})]})]})}));var ac,lc,cc=class extends P{#l;#C=void 0;#q;#K;constructor(e,t){super(),this.#l=e,this.setOptions(t),this.bindMethods(),this.#$()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#l.defaultMutationOptions(e),w(this.options,t)||this.#l.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#q,observer:this}),t?.mutationKey&&this.options.mutationKey&&y(t.mutationKey)!==y(this.options.mutationKey)?this.reset():"pending"===this.#q?.state.status&&this.#q.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#q?.removeObserver(this)}onMutationUpdate(e){this.#$(),this.#U(e)}getCurrentResult(){return this.#C}reset(){this.#q?.removeObserver(this),this.#q=void 0,this.#$(),this.#U()}mutate(e,t){return this.#K=t,this.#q?.removeObserver(this),this.#q=this.#l.getMutationCache().build(this.#l,this.options),this.#q.addObserver(this),this.#q.execute(e)}#$(){const e=this.#q?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#C={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#U(e){O.batch((()=>{if(this.#K&&this.hasListeners()){const t=this.#C.variables,r=this.#C.context;"success"===e?.type?(this.#K.onSuccess?.(e.data,t,r),this.#K.onSettled?.(e.data,null,t,r)):"error"===e?.type&&(this.#K.onError?.(e.error,t,r),this.#K.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach((e=>{e(this.#C)}))}))}};const uc=(null===(ac=window)||void 0===ac||null===(lc=ac.ui_dc_global)||void 0===lc?void 0:lc.api)||"http://dc.uicore",{user_id:dc}=La(),fc=()=>({1:(0,Y.jsxs)("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1440 836",className:"absolute top-[10%] left-0 w-full",children:[(0,Y.jsxs)("g",{"clip-path":"url(#svg_dc_a)",children:[(0,Y.jsx)("rect",{x:"170",y:"459.5",width:"1100",height:"315",rx:"10",fill:"#D1D9E2"}),(0,Y.jsx)("path",{d:"M720 610a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",fill:"#7C8B9D"}),(0,Y.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M717 599h-6l-4 1-4 4-1 4v18l1 4 4 4 4 1h18l4-1 4-4 1-4v-18l-1-4-4-4-4-1h-12Zm-8 4 2-1h18l2 1c2 0 3 1 3 3l1 2v14l-3-3h-4l-4 4h-1l-11-10c-1-2-3-2-4 0l-3 2v-7l1-2c0-2 1-3 3-3Z",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M720 610a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",stroke:"#7C8B9D","stroke-width":"1.7"}),(0,Y.jsx)("path",{"clip-rule":"evenodd",d:"M717 599h-6l-4 1-4 4-1 4v18l1 4 4 4 4 1h18l4-1 4-4 1-4v-18l-1-4-4-4-4-1h-12Zm-8 4 2-1h18l2 1c2 0 3 1 3 3l1 2v14l-3-3h-4l-4 4h-1l-11-10c-1-2-3-2-4 0l-3 2v-7l1-2c0-2 1-3 3-3Z",stroke:"#7C8B9D","stroke-width":"1.7"}),(0,Y.jsx)("rect",{x:"660",y:"80.5",width:"120",height:"10",rx:"5",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"400",y:"134.5",width:"640",height:"30",rx:"15",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"580.8",y:"180.5",width:"278.5",height:"30",rx:"15",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"400",y:"234.5",width:"640",height:"13",rx:"6.5",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"447.6",y:"259.5",width:"543.5",height:"13",rx:"6.5",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"580.8",y:"284.5",width:"278.5",height:"13",rx:"6.5",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"599",y:"333.5",width:"113",height:"46",rx:"12",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"631",y:"348.5",width:"49",height:"16",rx:"8",fill:"#fff"}),(0,Y.jsx)("rect",{x:"728",y:"333.5",width:"113",height:"46",rx:"12",fill:"#E6E9EC"}),(0,Y.jsx)("rect",{x:"760",y:"348.5",width:"49",height:"16",rx:"8",fill:"#7C8B9D"})]}),(0,Y.jsx)("defs",{children:(0,Y.jsx)("clipPath",{id:"svg_dc_a",children:(0,Y.jsx)("path",{fill:"#fff",transform:"translate(0 1)",d:"M0 0h1440v835H0z"})})})]}),2:(0,Y.jsxs)("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1440 825",className:"absolute top-[10%] left-0 w-full",children:[(0,Y.jsx)("rect",{x:"379.5",y:"64.5",width:"679.4",height:"22",rx:"11",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"320",y:"104.5",width:"800",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"379.5",y:"124.5",width:"679.4",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"347.5",width:"228",height:"10",rx:"5",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"365.5",width:"516",height:"22",rx:"11",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"112",y:"401.5",width:"438.2",height:"22",rx:"11",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"112",y:"437.5",width:"224.5",height:"22",rx:"11",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"112",y:"475.5",width:"516",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"495.5",width:"438.2",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"515.5",width:"224.5",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"567.5",width:"113",height:"46",rx:"12",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"144",y:"582.5",width:"49",height:"16",rx:"8",fill:"#fff"}),(0,Y.jsx)("rect",{x:"768",y:"200.5",width:"560",height:"560",rx:"10",fill:"#D1D9E2"}),(0,Y.jsx)("path",{d:"M1048 473a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",fill:"#7C8B9D"}),(0,Y.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1045 462h-6l-4 1-4 5-1 4v17l1 4 4 5 4 1h18l4-1 4-5 1-4v-17l-1-4-4-5-4-1h-12Zm-8 4h22l3 3 1 3v13l-3-2h-4l-4 4h-1l-11-11h-4l-3 3v-7l1-3 3-3Z",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M1048 473a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",stroke:"#7C8B9D","stroke-width":"1.7"}),(0,Y.jsx)("path",{"clip-rule":"evenodd",d:"M1045 462h-6l-4 1-4 5-1 4v17l1 4 4 5 4 1h18l4-1 4-5 1-4v-17l-1-4-4-5-4-1h-12Zm-8 4h22l3 3 1 3v13l-3-2h-4l-4 4h-1l-11-11h-4l-3 3v-7l1-3 3-3Z",stroke:"#7C8B9D","stroke-width":"1.7"})]}),3:(0,Y.jsxs)("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1440 689",className:"absolute top-[10%] left-0 w-full",children:[(0,Y.jsx)("rect",{x:"379.5",y:"64.5",width:"679.4",height:"22",rx:"11",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"320",y:"104.5",width:"800",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"379.5",y:"124.5",width:"679.4",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"200.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M138 215h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"112",y:"268.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"112",y:"296.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"316.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"336.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"364.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M181 366h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"424",y:"200.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M450 215h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"424",y:"268.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"424",y:"296.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"424",y:"316.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"424",y:"336.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"424",y:"364.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M493 366h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"736",y:"200.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M762 215h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"736",y:"268.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"736",y:"296.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"736",y:"316.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"736",y:"336.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"736",y:"364.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M805 366h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"1048",y:"200.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M1074 215h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"1048",y:"268.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"1048",y:"296.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"1048",y:"316.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"1048",y:"336.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"1048",y:"364.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M1117 366h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"112",y:"444.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M138 459h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"112",y:"512.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"112",y:"540.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"560.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"580.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"112",y:"608.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M181 610h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"424",y:"444.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M450 459h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"424",y:"512.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"424",y:"540.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"424",y:"560.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"424",y:"580.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"424",y:"608.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M493 610h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"736",y:"444.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M762 459h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"736",y:"512.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"736",y:"540.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"736",y:"560.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"736",y:"580.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"736",y:"608.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M805 610h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"}),(0,Y.jsx)("rect",{x:"1048",y:"444.5",width:"48",height:"48",rx:"24",fill:"#7C8B9D"}),(0,Y.jsx)("path",{d:"M1074 459h-4l-6 4-1 3v5l1 3 6 4h4l6-4 1-3v-5l-1-3-6-4Z",fill:"#fff",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round"}),(0,Y.jsx)("rect",{x:"1048",y:"512.5",width:"237.8",height:"16",rx:"8",fill:"#7C8B9D"}),(0,Y.jsx)("rect",{x:"1048",y:"540.5",width:"280",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"1048",y:"560.5",width:"237.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"1048",y:"580.5",width:"121.8",height:"12",rx:"6",fill:"#D1D9E2"}),(0,Y.jsx)("rect",{x:"1048",y:"608.5",width:"54",height:"16",rx:"8",fill:"#437EF7"}),(0,Y.jsx)("path",{d:"M1117 610h-2l-4 3-1 2v3l1 2 4 3h2l4-3 1-2v-3l-1-2-4-3Z",fill:"#437EF7"})]})}[Math.floor(3*Math.random())+1]);var hc,pc;const mc=(null===(hc=window)||void 0===hc||null===(pc=hc.ui_dc_global)||void 0===pc?void 0:pc.api)||"http://dc.uicore.co",gc=(0,s.memo)((e=>{let{id:t,slug:r,tag:n,name:o,collection_name:i,collection_id:a,cardsQueryKey:l}=e;const{setActiveCollection:c}=Ia(),{isFavorite:u,onFavoriteClick:d}=(e=>{let{id:t,cardsQueryKey:r}=e;const{favorites:n}=Ka(),o=n[t],i=J(),a=o?"remove_favorite":"add_favorite",l=function(e){const t=J(void 0),[r]=s.useState((()=>new cc(t,e)));s.useEffect((()=>{r.setOptions(e)}),[r,e]);const n=s.useSyncExternalStore(s.useCallback((e=>r.subscribe(O.batchCalls(e))),[r]),(()=>r.getCurrentResult()),(()=>r.getCurrentResult())),o=s.useCallback(((e,t)=>{r.mutate(e,t).catch(Ra)}),[r]);if(n.error&&ka(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:o,mutateAsync:n.mutate}}({mutationKey:[a,t],mutationFn:async()=>{const e=await fetch(`${uc}/?rest_route=/dc/v1/${a}`,{method:"POST",body:JSON.stringify({favorite_id:t.toString(),user_id:dc}),headers:{"Content-Type":"application/json"}});await e.json()}});return{isFavorite:o,onFavoriteClick:async()=>{const e=!o;await l.mutateAsync(),i.setQueryData(["favorites"],(r=>{const n=t.toString();return e?r?[...r,n]:[n]:null==r?void 0:r.filter((e=>e!==n))})),e||i.setQueryData(r,(e=>{if(e)return{...e,data:e.data.filter((e=>e.id!==t))}}))}}})({id:t,cardsQueryKey:l}),{user_id:f}=La(),h=(0,s.useRef)(null),p=(0,s.useRef)(null),[m,g]=(0,s.useState)(222),v=(0,s.useRef)(null),y=(0,s.useCallback)((e=>{if(!h.current)return;const t=e?e*(1/3):h.current.clientHeight;h.current.style.height=`${t+56}px`,g(Math.ceil((t+2+56)/2))}),[]);return(0,s.useEffect)((()=>{const e=e=>{if(!p.current||e.source!==p.current.contentWindow)return;const{type:t,height:r,withGlobalStyles:n}=e.data;var o,i,s,a;if(n||null===(o=p.current)||void 0===o||null===(i=o.contentWindow)||void 0===i||i.postMessage({type:"global_styles",...(null===(s=window)||void 0===s||null===(a=s.ui_dc_global)||void 0===a?void 0:a.preview)||{}},"*"),"iframe_height"===t&&void 0!==r){const e=Number(r)>1800?1800:Number(r);var l;p.current.style.height=`${e}px`,y(e),n&&(null===(l=p.current)||void 0===l||l.style.setProperty("opacity","1"))}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[y,3]),(0,s.useEffect)((()=>{if(h.current)return v.current=new IntersectionObserver((e=>{e.forEach((e=>{var t;e.isIntersecting&&p.current&&(p.current.src=`${mc}/templates/${r}/?iframe=true`,null===(t=v.current)||void 0===t||t.disconnect())}))}),{rootMargin:"100px"}),v.current.observe(h.current),()=>{var e;return null===(e=v.current)||void 0===e?void 0:e.disconnect()}}),[r]),(0,s.useEffect)((()=>{const e=()=>{y()};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[y]),(0,Y.jsxs)("li",{className:"uicore-dc-masonry-card px-5 py-2 flex flex-col",ref:h,style:{gridRowEnd:`span ${m}`},children:[(0,Y.jsxs)("div",{className:"relative h-full group overflow-hidden rounded-md transition-all",children:[n&&(0,Y.jsx)(ut,{className:"absolute right-2 top-2",children:n}),p.current&&(0,Y.jsx)("div",{className:"opacity-0 hover:opacity-100 absolute group bottom-0 top-0 right-0 left-0 z-50 transition-all flex flex-col justify-end items-center p-4 bg-gradient-to-t from-white from-0% to-white/0 to-35%",children:(0,Y.jsx)(sc,{id:t})}),!p.current&&(0,Y.jsx)(fc,{}),(0,Y.jsx)("iframe",{ref:p,loading:"lazy",title:"card preview",style:{border:"none",overflow:"hidden",width:"300%",height:"100%",transform:`scale(${1/3})`,transformOrigin:"top left",position:"absolute",top:0,left:0,opacity:0}})]}),(0,Y.jsxs)("div",{className:"flex justify-between gap-3 p-2 w-full",children:[(0,Y.jsxs)("div",{className:"text-xs font-semibold text-gray-600 mt-1",children:["Collection :"," ",(0,Y.jsx)("span",{className:"underline hover:text-blue-600 cursor-pointer",onClick:()=>c(a),children:i})]}),void 0!==f&&(0,Y.jsxs)(Gl,{children:[(0,Y.jsx)(Vl,{onClick:d,children:u?(0,Y.jsx)(al,{className:"h-4 w-4"}):(0,Y.jsx)(il,{className:"h-4 w-4"})}),(0,Y.jsx)(Zl,{children:u?"Remove from favorites":"Mark as favorite"})]})]})]})}));function vc(e){const t=e+"CollectionProvider",[r,n]=bt(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=e=>{const{scope:t,children:r}=e,n=s.useRef(null),i=s.useRef(new Map).current;return(0,Y.jsx)(o,{scope:t,itemMap:i,collectionRef:n,children:r})};a.displayName=t;const l=e+"CollectionSlot",c=s.forwardRef(((e,t)=>{const{scope:r,children:n}=e,o=ne(t,i(l,r).collectionRef);return(0,Y.jsx)(oe,{ref:o,children:n})}));c.displayName=l;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=s.forwardRef(((e,t)=>{const{scope:r,children:n,...o}=e,a=s.useRef(null),l=ne(t,a),c=i(u,r);return s.useEffect((()=>(c.itemMap.set(a,{ref:a,...o}),()=>{c.itemMap.delete(a)}))),(0,Y.jsx)(oe,{[d]:"",ref:l,children:n})}));return f.displayName=u,[{Provider:a,Slot:c,ItemSlot:f},function(t){const r=i(e+"CollectionConsumer",t),n=s.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`)),n=Array.from(r.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)));return n}),[r.collectionRef,r.itemMap]);return n},n]}var yc=s.createContext(void 0);function xc(e){const t=s.useContext(yc);return e||t||"ltr"}var bc="rovingFocusGroup.onEntryFocus",wc={bubbles:!1,cancelable:!0},jc="RovingFocusGroup",[Cc,Ec,Mc]=vc(jc),[Nc,Dc]=bt(jc,[Mc]),[kc,Rc]=Nc(jc),Sc=s.forwardRef(((e,t)=>(0,Y.jsx)(Cc.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,Y.jsx)(Cc.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,Y.jsx)(Oc,{...e,ref:t})})})));Sc.displayName=jc;var Oc=s.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=s.useRef(null),p=ne(t,h),m=xc(i),[g=null,v]=Dt({prop:a,defaultProp:l,onChange:c}),[y,x]=s.useState(!1),b=Nt(u),w=Ec(r),j=s.useRef(!1),[C,E]=s.useState(0);return s.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(bc,b),()=>e.removeEventListener(bc,b)}),[b]),(0,Y.jsx)(kc,{scope:r,orientation:n,dir:m,loop:o,currentTabStopId:g,onItemFocus:s.useCallback((e=>v(e)),[v]),onItemShiftTab:s.useCallback((()=>x(!0)),[]),onFocusableItemAdd:s.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:s.useCallback((()=>E((e=>e-1))),[]),children:(0,Y.jsx)(Rt.div,{tabIndex:y||0===C?-1:0,"data-orientation":n,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:xt(e.onMouseDown,(()=>{j.current=!0})),onFocus:xt(e.onFocus,(e=>{const t=!j.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(bc,wc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));Ac([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)),d)}}j.current=!1})),onBlur:xt(e.onBlur,(()=>x(!1)))})})})),Pc="RovingFocusGroupItem",_c=s.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,...a}=e,l=Mt(),c=i||l,u=Rc(Pc,r),d=u.currentTabStopId===c,f=Ec(r),{onFocusableItemAdd:h,onFocusableItemRemove:p}=u;return s.useEffect((()=>{if(n)return h(),()=>p()}),[n,h,p]),(0,Y.jsx)(Cc.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:(0,Y.jsx)(Rt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:xt(e.onMouseDown,(e=>{n?u.onItemFocus(c):e.preventDefault()})),onFocus:xt(e.onFocus,(()=>u.onItemFocus(c))),onKeyDown:xt(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void u.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:Tc[n]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=u.loop?(n=i+1,(r=o).map(((e,t)=>r[(n+t)%r.length]))):o.slice(i+1)}setTimeout((()=>Ac(o)))}var r,n}))})})}));_c.displayName=Pc;var Tc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ac(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Ic=Sc,Lc=_c,Fc=["Enter"," "],zc=["ArrowUp","PageDown","End"],Bc=["ArrowDown","PageUp","Home",...zc],Uc={ltr:[...Fc,"ArrowRight"],rtl:[...Fc,"ArrowLeft"]},qc={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Kc="Menu",[$c,Qc,Wc]=vc(Kc),[Hc,Gc]=bt(Kc,[Wc,as,Dc]),Vc=as(),Zc=Dc(),[Yc,Xc]=Hc(Kc),[Jc,eu]=Hc(Kc),tu=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:i,modal:a=!0}=e,l=Vc(t),[c,u]=s.useState(null),d=s.useRef(!1),f=Nt(i),h=xc(o);return s.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),(0,Y.jsx)(Cs,{...l,children:(0,Y.jsx)(Yc,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u,children:(0,Y.jsx)(Jc,{scope:t,onClose:s.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:n})})})};tu.displayName=Kc;var ru=s.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e,o=Vc(r);return(0,Y.jsx)(Es,{...o,...n,ref:t})}));ru.displayName="MenuAnchor";var nu="MenuPortal",[ou,iu]=Hc(nu,{forceMount:void 0}),su=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,i=Xc(nu,t);return(0,Y.jsx)(ou,{scope:t,forceMount:r,children:(0,Y.jsx)(Vt,{present:r||i.open,children:(0,Y.jsx)(Gt,{asChild:!0,container:o,children:n})})})};su.displayName=nu;var au="MenuContent",[lu,cu]=Hc(au),uu=s.forwardRef(((e,t)=>{const r=iu(au,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,i=Xc(au,e.__scopeMenu),s=eu(au,e.__scopeMenu);return(0,Y.jsx)($c.Provider,{scope:e.__scopeMenu,children:(0,Y.jsx)(Vt,{present:n||i.open,children:(0,Y.jsx)($c.Slot,{scope:e.__scopeMenu,children:s.modal?(0,Y.jsx)(du,{...o,ref:t}):(0,Y.jsx)(fu,{...o,ref:t})})})})})),du=s.forwardRef(((e,t)=>{const r=Xc(au,e.__scopeMenu),n=s.useRef(null),o=ne(t,n);return s.useEffect((()=>{const e=n.current;if(e)return $r(e)}),[]),(0,Y.jsx)(hu,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:xt(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),fu=s.forwardRef(((e,t)=>{const r=Xc(au,e.__scopeMenu);return(0,Y.jsx)(hu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),hu=s.forwardRef(((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:m,...g}=e,v=Xc(au,r),y=eu(au,r),x=Vc(r),b=Zc(r),w=Qc(r),[j,C]=s.useState(null),E=s.useRef(null),M=ne(t,E,v.onContentChange),N=s.useRef(0),D=s.useRef(""),k=s.useRef(0),R=s.useRef(null),S=s.useRef("right"),O=s.useRef(0),P=m?Fr:s.Fragment,_=m?{as:oe,allowPinchZoom:!0}:void 0;s.useEffect((()=>()=>window.clearTimeout(N.current)),[]),Xt();const T=s.useCallback((e=>S.current===R.current?.side&&function(e,t){return!!t&&function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const s=t[e].x,a=t[e].y,l=t[i].x,c=t[i].y;a>n!=c>n&&r<(l-s)*(n-a)/(c-a)+s&&(o=!o)}return o}({x:e.clientX,y:e.clientY},t)}(e,R.current?.area)),[]);return(0,Y.jsx)(lu,{scope:r,searchRef:D,onItemEnter:s.useCallback((e=>{T(e)&&e.preventDefault()}),[T]),onItemLeave:s.useCallback((e=>{T(e)||(E.current?.focus(),C(null))}),[T]),onTriggerLeave:s.useCallback((e=>{T(e)&&e.preventDefault()}),[T]),pointerGraceTimerRef:k,onPointerGraceIntentChange:s.useCallback((e=>{R.current=e}),[]),children:(0,Y.jsx)(P,{..._,children:(0,Y.jsx)(Ut,{asChild:!0,trapped:o,onMountAutoFocus:xt(i,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:a,children:(0,Y.jsx)(Tt,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:(0,Y.jsx)(Ic,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:C,onEntryFocus:xt(c,(e=>{y.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:(0,Y.jsx)(Ms,{role:"menu","aria-orientation":"vertical","data-state":zu(v.open),"data-radix-menu-content":"",dir:y.dir,...x,...g,ref:M,style:{outline:"none",...g.style},onKeyDown:xt(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&(e=>{const t=D.current+e,r=w().filter((e=>!e.disabled)),n=document.activeElement,o=r.find((e=>e.ref.current===n))?.textValue,i=function(e,t,r){const n=t.length>1&&Array.from(t).every((e=>e===t[0])),o=n?t[0]:t,i=r?e.indexOf(r):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==r)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==r?c:void 0}(r.map((e=>e.textValue)),t,o),s=r.find((e=>e.textValue===i))?.ref.current;!function e(t){D.current=t,window.clearTimeout(N.current),""!==t&&(N.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))})(e.key));const o=E.current;if(e.target!==o)return;if(!Bc.includes(e.key))return;e.preventDefault();const i=w().filter((e=>!e.disabled)).map((e=>e.ref.current));zc.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const r of e){if(r===t)return;if(r.focus(),document.activeElement!==t)return}}(i)})),onBlur:xt(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),D.current="")})),onPointerMove:xt(e.onPointerMove,qu((e=>{const t=e.target,r=O.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>O.current?"right":"left";S.current=t,O.current=e.clientX}})))})})})})})})}));uu.displayName=au;var pu=s.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return(0,Y.jsx)(Rt.div,{role:"group",...n,ref:t})}));pu.displayName="MenuGroup";var mu=s.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return(0,Y.jsx)(Rt.div,{...n,ref:t})}));mu.displayName="MenuLabel";var gu="MenuItem",vu="menu.itemSelect",yu=s.forwardRef(((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,i=s.useRef(null),a=eu(gu,e.__scopeMenu),l=cu(gu,e.__scopeMenu),c=ne(t,i),u=s.useRef(!1);return(0,Y.jsx)(xu,{...o,ref:c,disabled:r,onClick:xt(e.onClick,(()=>{const e=i.current;if(!r&&e){const t=new CustomEvent(vu,{bubbles:!0,cancelable:!0});e.addEventListener(vu,(e=>n?.(e)),{once:!0}),St(e,t),t.defaultPrevented?u.current=!1:a.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:xt(e.onPointerUp,(e=>{u.current||e.currentTarget?.click()})),onKeyDown:xt(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;r||t&&" "===e.key||Fc.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));yu.displayName=gu;var xu=s.forwardRef(((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...i}=e,a=cu(gu,r),l=Zc(r),c=s.useRef(null),u=ne(t,c),[d,f]=s.useState(!1),[h,p]=s.useState("");return s.useEffect((()=>{const e=c.current;e&&p((e.textContent??"").trim())}),[i.children]),(0,Y.jsx)($c.ItemSlot,{scope:r,disabled:n,textValue:o??h,children:(0,Y.jsx)(Lc,{asChild:!0,...l,focusable:!n,children:(0,Y.jsx)(Rt.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:xt(e.onPointerMove,qu((e=>{n?a.onItemLeave(e):(a.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))}))),onPointerLeave:xt(e.onPointerLeave,qu((e=>a.onItemLeave(e)))),onFocus:xt(e.onFocus,(()=>f(!0))),onBlur:xt(e.onBlur,(()=>f(!1)))})})})})),bu=s.forwardRef(((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return(0,Y.jsx)(ku,{scope:e.__scopeMenu,checked:r,children:(0,Y.jsx)(yu,{role:"menuitemcheckbox","aria-checked":Bu(r)?"mixed":r,...o,ref:t,"data-state":Uu(r),onSelect:xt(o.onSelect,(()=>n?.(!!Bu(r)||!r)),{checkForDefaultPrevented:!1})})})}));bu.displayName="MenuCheckboxItem";var wu="MenuRadioGroup",[ju,Cu]=Hc(wu,{value:void 0,onValueChange:()=>{}}),Eu=s.forwardRef(((e,t)=>{const{value:r,onValueChange:n,...o}=e,i=Nt(n);return(0,Y.jsx)(ju,{scope:e.__scopeMenu,value:r,onValueChange:i,children:(0,Y.jsx)(pu,{...o,ref:t})})}));Eu.displayName=wu;var Mu="MenuRadioItem",Nu=s.forwardRef(((e,t)=>{const{value:r,...n}=e,o=Cu(Mu,e.__scopeMenu),i=r===o.value;return(0,Y.jsx)(ku,{scope:e.__scopeMenu,checked:i,children:(0,Y.jsx)(yu,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":Uu(i),onSelect:xt(n.onSelect,(()=>o.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));Nu.displayName=Mu;var Du="MenuItemIndicator",[ku,Ru]=Hc(Du,{checked:!1}),Su=s.forwardRef(((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,i=Ru(Du,r);return(0,Y.jsx)(Vt,{present:n||Bu(i.checked)||!0===i.checked,children:(0,Y.jsx)(Rt.span,{...o,ref:t,"data-state":Uu(i.checked)})})}));Su.displayName=Du;var Ou=s.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return(0,Y.jsx)(Rt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})}));Ou.displayName="MenuSeparator";var Pu=s.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e,o=Vc(r);return(0,Y.jsx)(Ns,{...o,...n,ref:t})}));Pu.displayName="MenuArrow";var[_u,Tu]=Hc("MenuSub"),Au="MenuSubTrigger",Iu=s.forwardRef(((e,t)=>{const r=Xc(Au,e.__scopeMenu),n=eu(Au,e.__scopeMenu),o=Tu(Au,e.__scopeMenu),i=cu(Au,e.__scopeMenu),a=s.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},d=s.useCallback((()=>{a.current&&window.clearTimeout(a.current),a.current=null}),[]);return s.useEffect((()=>d),[d]),s.useEffect((()=>{const e=l.current;return()=>{window.clearTimeout(e),c(null)}}),[l,c]),(0,Y.jsx)(ru,{asChild:!0,...u,children:(0,Y.jsx)(xu,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":zu(r.open),...e,ref:re(t,o.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:xt(e.onPointerMove,qu((t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||a.current||(i.onPointerGraceIntentChange(null),a.current=window.setTimeout((()=>{r.onOpenChange(!0),d()}),100))}))),onPointerLeave:xt(e.onPointerLeave,qu((e=>{d();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,s=o?-5:5,a=t[o?"left":"right"],c=t[o?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:a,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:a,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:xt(e.onKeyDown,(t=>{const o=""!==i.searchRef.current;e.disabled||o&&" "===t.key||Uc[n.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));Iu.displayName=Au;var Lu="MenuSubContent",Fu=s.forwardRef(((e,t)=>{const r=iu(au,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,i=Xc(au,e.__scopeMenu),a=eu(au,e.__scopeMenu),l=Tu(Lu,e.__scopeMenu),c=s.useRef(null),u=ne(t,c);return(0,Y.jsx)($c.Provider,{scope:e.__scopeMenu,children:(0,Y.jsx)(Vt,{present:n||i.open,children:(0,Y.jsx)($c.Slot,{scope:e.__scopeMenu,children:(0,Y.jsx)(hu,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:u,align:"start",side:"rtl"===a.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{a.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:xt(e.onFocusOutside,(e=>{e.target!==l.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:xt(e.onEscapeKeyDown,(e=>{a.onClose(),e.preventDefault()})),onKeyDown:xt(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),r=qc[a.dir].includes(e.key);t&&r&&(i.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())}))})})})})}));function zu(e){return e?"open":"closed"}function Bu(e){return"indeterminate"===e}function Uu(e){return Bu(e)?"indeterminate":e?"checked":"unchecked"}function qu(e){return t=>"mouse"===t.pointerType?e(t):void 0}Fu.displayName=Lu;var Ku=tu,$u=ru,Qu=su,Wu=uu,Hu=pu,Gu=mu,Vu=yu,Zu=bu,Yu=Eu,Xu=Nu,Ju=Su,ed=Ou,td=Pu,rd=Iu,nd=Fu,od="DropdownMenu",[id,sd]=bt(od,[Gc]),ad=Gc(),[ld,cd]=id(od),ud=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:i,onOpenChange:a,modal:l=!0}=e,c=ad(t),u=s.useRef(null),[d=!1,f]=Dt({prop:o,defaultProp:i,onChange:a});return(0,Y.jsx)(ld,{scope:t,triggerId:Mt(),triggerRef:u,contentId:Mt(),open:d,onOpenChange:f,onOpenToggle:s.useCallback((()=>f((e=>!e))),[f]),modal:l,children:(0,Y.jsx)(Ku,{...c,open:d,onOpenChange:f,dir:n,modal:l,children:r})})};ud.displayName=od;var dd="DropdownMenuTrigger",fd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,i=cd(dd,r),s=ad(r);return(0,Y.jsx)($u,{asChild:!0,...s,children:(0,Y.jsx)(Rt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:re(t,i.triggerRef),onPointerDown:xt(e.onPointerDown,(e=>{n||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:xt(e.onKeyDown,(e=>{n||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));fd.displayName=dd;var hd=e=>{const{__scopeDropdownMenu:t,...r}=e,n=ad(t);return(0,Y.jsx)(Qu,{...n,...r})};hd.displayName="DropdownMenuPortal";var pd="DropdownMenuContent",md=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=cd(pd,r),i=ad(r),a=s.useRef(!1);return(0,Y.jsx)(Wu,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...n,ref:t,onCloseAutoFocus:xt(e.onCloseAutoFocus,(e=>{a.current||o.triggerRef.current?.focus(),a.current=!1,e.preventDefault()})),onInteractOutside:xt(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;o.modal&&!n||(a.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));md.displayName=pd;var gd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(Hu,{...o,...n,ref:t})}));gd.displayName="DropdownMenuGroup";var vd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(Gu,{...o,...n,ref:t})}));vd.displayName="DropdownMenuLabel";var yd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(Vu,{...o,...n,ref:t})}));yd.displayName="DropdownMenuItem";var xd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(Zu,{...o,...n,ref:t})}));xd.displayName="DropdownMenuCheckboxItem";var bd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(Yu,{...o,...n,ref:t})}));bd.displayName="DropdownMenuRadioGroup";var wd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(Xu,{...o,...n,ref:t})}));wd.displayName="DropdownMenuRadioItem";var jd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(Ju,{...o,...n,ref:t})}));jd.displayName="DropdownMenuItemIndicator";var Cd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(ed,{...o,...n,ref:t})}));Cd.displayName="DropdownMenuSeparator";var Ed=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(td,{...o,...n,ref:t})}));Ed.displayName="DropdownMenuArrow";var Md=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(rd,{...o,...n,ref:t})}));Md.displayName="DropdownMenuSubTrigger";var Nd=s.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ad(r);return(0,Y.jsx)(nd,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));Nd.displayName="DropdownMenuSubContent";var Dd=hd,kd=md,Rd=vd,Sd=yd,Od=xd,Pd=wd,_d=jd,Td=Cd,Ad=Md,Id=Nd;const Ld=ud,Fd=fd,zd=bd;s.forwardRef(((e,t)=>{let{className:r,inset:n,children:o,...i}=e;return(0,Y.jsxs)(Ad,{ref:t,className:it("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",r),...i,children:[o,(0,Y.jsx)(tl,{className:"ml-auto h-4 w-4"})]})})).displayName=Ad.displayName,s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Id,{ref:t,className:it("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...n})})).displayName=Id.displayName;const Bd=s.forwardRef(((e,t)=>{let{className:r,sideOffset:n=4,...o}=e;return(0,Y.jsx)(Dd,{children:(0,Y.jsx)(kd,{ref:t,sideOffset:n,className:it("z-[9999] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...o})})}));Bd.displayName=kd.displayName,s.forwardRef(((e,t)=>{let{className:r,inset:n,...o}=e;return(0,Y.jsx)(Sd,{ref:t,className:it("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",r),...o})})).displayName=Sd.displayName,s.forwardRef(((e,t)=>{let{className:r,children:n,checked:o,...i}=e;return(0,Y.jsxs)(Od,{ref:t,className:it("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),checked:o,...i,children:[(0,Y.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Y.jsx)(_d,{children:(0,Y.jsx)(Ja,{className:"h-4 w-4"})})}),n]})})).displayName=Od.displayName;const Ud=s.forwardRef(((e,t)=>{let{className:r,children:n,...o}=e;return(0,Y.jsxs)(Pd,{ref:t,className:it("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...o,children:[(0,Y.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Y.jsx)(_d,{children:(0,Y.jsx)(nl,{className:"h-4 w-4 fill-current"})})}),n]})}));Ud.displayName=Pd.displayName;const qd=s.forwardRef(((e,t)=>{let{className:r,inset:n,...o}=e;return(0,Y.jsx)(Rd,{ref:t,className:it("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",r),...o})}));qd.displayName=Rd.displayName;const Kd=s.forwardRef(((e,t)=>{let{className:r,...n}=e;return(0,Y.jsx)(Td,{ref:t,className:it("-mx-1 my-1 h-px bg-muted",r),...n})}));Kd.displayName=Td.displayName;const $d=e=>{var t;let{items:r,triggerLabel:n,menuLabel:o,value:i,onChange:s}=e;return(0,Y.jsxs)(Ld,{children:[(0,Y.jsx)(Fd,{asChild:!0,children:(0,Y.jsxs)(at,{variant:"outline",className:"min-h-10 shadow-none",children:[n," ",null===(t=r.find((e=>e.value===i)))||void 0===t?void 0:t.label]})}),(0,Y.jsxs)(Bd,{children:[(0,Y.jsx)(qd,{children:o}),(0,Y.jsx)(Kd,{}),(0,Y.jsx)(zd,{value:i,onValueChange:e=>s(e),children:r.map((e=>{let{value:t,label:r}=e;return(0,Y.jsx)(Ud,{value:t,children:r},t)}))})]})]})};function Qd(e,t){return e===t}var Wd,Hd;const Gd=(null===(Wd=window)||void 0===Wd||null===(Hd=Wd.ui_dc_global)||void 0===Hd?void 0:Hd.api)||"http://dc.uicore.co",Vd=()=>{const[e,t]=(0,s.useState)(""),[r,n]=(0,s.useState)("recent"),[o]=function(e){var t=Qd,r=(0,s.useRef)(e),n=(0,s.useState)({})[1],o=function(e,t,r){var n=this,o=(0,s.useRef)(null),i=(0,s.useRef)(0),a=(0,s.useRef)(null),l=(0,s.useRef)([]),c=(0,s.useRef)(),u=(0,s.useRef)(),d=(0,s.useRef)(e),f=(0,s.useRef)(!0);d.current=e;var h="undefined"!=typeof window,p=!t&&0!==t&&h;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var m=!!(r=r||{}).leading,g=!("trailing"in r)||!!r.trailing,v="maxWait"in r,y="debounceOnServer"in r&&!!r.debounceOnServer,x=v?Math.max(+r.maxWait||0,t):null;(0,s.useEffect)((function(){return f.current=!0,function(){f.current=!1}}),[]);var b=(0,s.useMemo)((function(){var e=function(e){var t=l.current,r=c.current;return l.current=c.current=null,i.current=e,u.current=d.current.apply(r,t)},r=function(e,t){p&&cancelAnimationFrame(a.current),a.current=p?requestAnimationFrame(e):setTimeout(e,t)},s=function(e){if(!f.current)return!1;var r=e-o.current;return!o.current||r>=t||r<0||v&&e-i.current>=x},b=function(t){return a.current=null,g&&l.current?e(t):(l.current=c.current=null,u.current)},w=function e(){var n=Date.now();if(s(n))return b(n);if(f.current){var a=t-(n-o.current),l=v?Math.min(a,x-(n-i.current)):a;r(e,l)}},j=function(){if(h||y){var d=Date.now(),p=s(d);if(l.current=[].slice.call(arguments),c.current=n,o.current=d,p){if(!a.current&&f.current)return i.current=o.current,r(w,t),m?e(o.current):u.current;if(v)return r(w,t),e(o.current)}return a.current||r(w,t),u.current}};return j.cancel=function(){a.current&&(p?cancelAnimationFrame(a.current):clearTimeout(a.current)),i.current=0,l.current=o.current=c.current=a.current=null},j.isPending=function(){return!!a.current},j.flush=function(){return a.current?b(Date.now()):u.current},j}),[m,v,t,x,g,p,h,y]);return b}((0,s.useCallback)((function(e){r.current=e,n({})}),[n]),400,void 0),i=(0,s.useRef)(e);return t(i.current,e)||(o(e),i.current=e),[r.current,o]}(e),[i,a]=(0,s.useState)(1),{activeTab:l}=ba(),{id:c}=l,u="blocks"!==c&&"pages"!==c,d="favorites"===c,{favoritesArray:f}=Ka(),h=d?f:void 0,{activeCategory:p,activeCollections:m,activeType:g}=Ia(),v=(0,s.useMemo)((()=>u?c:m),[u,c,m]),y=(0,s.useMemo)((()=>({sort:r,category:p,activeCollections:v,search:o,activeType:g})),[r,p,v,o,g]),x=(0,s.useMemo)((()=>["cards",l.id,p,v,g,r,o,i]),[l.id,p,v,g,r,o,i]),{isLoading:b,data:w}=Pa({queryKey:x,queryFn:()=>(async e=>{let{search:t,page:r,sort:n,category:o,activeCollections:i,activeType:s,activeTabId:a,favoritesIds:l}=e;const c=i,{product:u,builder:d,user_id:f,website_id:h}=La(),p=new URLSearchParams({collection:String(c),page:String(r),product:u,builder:d,user_id:f,website_id:h});"blocks"===a?p.append("type","block"):"pages"===a?p.append("type","page"):p.append("type",s),t&&p.append("search",t),n&&"recent"!==n&&p.append("sort",n),null!==o&&"all"!==o&&p.append("category",String(o));const m={method:l?"POST":"GET",headers:{"Content-Type":"application/json"},body:l?JSON.stringify({ids:l}):null},g=await fetch(`${Gd}/?rest_route=/dc/v1/templates&${p.toString()}`,m);return await g.json()})({...y,activeTabId:c,page:i,favoritesIds:h,activeType:g}),gcTime:36e5,placeholderData:N}),j=(0,s.useMemo)((()=>(null==w?void 0:w.data)||[]),[null==w?void 0:w.data]),C=parseInt((null==w?void 0:w.page)||"1"),E=!(j.length<12);return(0,s.useEffect)((()=>{a(1)}),[c,p,v,o,r]),{isLoading:b,cards:j,sortValue:r,search:e,queryKey:x,onSearch:e=>{let{target:r}=e;return t(r.value)},setSortValue:n,activePage:i,setActivePage:a,currentPage:C,hasNext:E,activeTabIsFavorite:d}},Zd=[{value:"recent",label:"Recent"},{value:"old",label:"Old"}],Yd=()=>{const{isLoading:e,cards:t,sortValue:r,search:n,queryKey:o,onSearch:i,setSortValue:a,activePage:l,setActivePage:c,hasNext:u,activeTabIsFavorite:d}=Vd(),{scrollableAreaRef:f}=(e=>{let{dependencies:t}=e;const r=(0,s.useRef)(null);return(0,s.useEffect)((()=>{r.current&&(r.current.scrollTop=0)}),t),{scrollableAreaRef:r}})({dependencies:[t,l]});return(0,Y.jsx)("main",{className:"h-full w-full pr-1",children:e?(0,Y.jsx)(ul,{extraClassName:"h-full",words:["Please wait","Gathering data","Loading templates","Checking for updates","We're almost there"]}):(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(_a,{id:"masonry-scrollable-area",ref:f,color:"bg-gray-100",className:"h-full px-4 flex flex-col",children:[(0,Y.jsxs)("div",{className:"flex gap-4 justify-between py-3 px-2",children:[(0,Y.jsxs)("div",{className:"relative",children:[(0,Y.jsx)(lt,{className:"px-7 min-h-10 min-w-96",placeholder:"Search by tag",value:n,onChange:i}),(0,Y.jsx)(cl,{className:"absolute top-1/2 translate-y-[-50%] left-2"})]}),(0,Y.jsx)($d,{triggerLabel:"Sorted by: ",menuLabel:"Sort",items:Zd,value:r,onChange:a})]}),(0,Y.jsx)(sa,{className:"my-2"}),t.length?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("ul",{className:"uicore-dc-masonry -mx-3 mb-5",children:t.map((e=>(0,s.createElement)(gc,{...e,cardsQueryKey:o,key:e.id})))}),(0,Y.jsx)(hl,{className:"mt-auto mb-6 self-end",children:(0,Y.jsxs)(pl,{children:[(0,Y.jsx)(ml,{children:(0,Y.jsx)(vl,{onClick:()=>l>1&&c(l-1),disabled:1===l})}),(0,Y.jsx)(ml,{children:(0,Y.jsx)(yl,{onClick:()=>u&&c(l+1),disabled:!u})})]})})]}):(0,Y.jsxs)("div",{className:"text-center m-10 flex flex-col items-center gap-2 p-10",children:[(0,Y.jsxs)("svg",{className:"opacity-40",width:"120",height:"120",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Y.jsx)("path",{d:"M5 22.3927C5 17.7914 8.73007 14.0513 13.3314 14.0513V14.0513C17.9326 14.0513 21.6627 17.7813 21.6627 22.3826V30.7543H13.3515C8.73911 30.7543 5 27.0051 5 22.3927V22.3927Z",fill:"#19D9FF"}),(0,Y.jsx)("path",{d:"M12.3438 17.1383C12.3438 12.0913 16.4351 8 21.482 8V8C26.5289 8 30.6203 12.1014 30.6203 17.1483V17.1483C30.6203 22.2064 26.5199 26.3169 21.4618 26.3169H12.3438V17.1383Z",fill:"#C926FF"}),(0,Y.jsx)("path",{d:"M21.6602 24.6224C21.6602 21.2578 24.3877 18.5303 27.7523 18.5303V18.5303C31.1169 18.5303 33.8445 21.2679 33.8445 24.6325V24.6325C33.8445 28.0083 31.1079 30.755 27.7322 30.755H21.6602V24.6224Z",fill:"#FFDD33"}),(0,Y.jsx)("path",{d:"M27.7568 18.5303C28.706 18.5303 29.6044 18.7483 30.4053 19.1367C29.5108 23.1785 25.9511 26.2192 21.6641 26.3105V24.6221C21.6642 21.2576 24.3923 18.5303 27.7568 18.5303Z",fill:"#FF7D3E"}),(0,Y.jsx)("path",{d:"M13.334 14.0513C17.9353 14.0513 21.666 17.782 21.666 22.3833V26.311C21.5994 26.3125 21.5327 26.3169 21.4658 26.3169H12.3477V17.1382C12.3477 16.0595 12.5357 15.0247 12.8789 14.064C13.0296 14.0558 13.1813 14.0513 13.334 14.0513Z",fill:"#198CFF"})]}),d?(0,Y.jsx)("p",{className:"text-gray-600",children:"You have no favorite templates yet."}):(0,Y.jsx)("p",{className:"text-gray-600",children:"No templates found."})]})]})})})},Xd=new class{#Q;#m;#u;#W;#H;#G;#V;#Z;constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.#Q=e.queryCache||new $,this.#m=e.mutationCache||new W,this.#u=e.defaultOptions||{},this.#W=new Map,this.#H=new Map,this.#G=0}mount(){this.#G++,1===this.#G&&(this.#V=_.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#Q.onFocus())})),this.#Z=T.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#Q.onOnline())})))}unmount(){this.#G--,0===this.#G&&(this.#V?.(),this.#V=void 0,this.#Z?.(),this.#Z=void 0)}isFetching(e){return this.#Q.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#m.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#Q.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#Q.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(h(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#Q.findAll(e).map((e=>{let{queryKey:t,state:r}=e;return[t,r.data]}))}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=this.#Q.get(n.queryHash),i=o?.state.data,s=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==s)return this.#Q.build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return O.batch((()=>this.#Q.findAll(e).map((e=>{let{queryKey:n}=e;return[n,this.setQueryData(n,t,r)]}))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#Q.get(t.queryHash)?.state}removeQueries(e){const t=this.#Q;O.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const r=this.#Q,n={type:"active",...e};return O.batch((()=>(r.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries(n,t))))}cancelQueries(e){const t={revert:!0,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}},r=O.batch((()=>this.#Q.findAll(e).map((e=>e.cancel(t)))));return Promise.all(r).then(u).catch(u)}invalidateQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return O.batch((()=>{if(this.#Q.findAll(e).forEach((e=>{e.invalidate()})),"none"===e?.refetchType)return Promise.resolve();const r={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(r,t)}))}refetchQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={...t,cancelRefetch:t.cancelRefetch??!0},n=O.batch((()=>this.#Q.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(u)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(n).then(u)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=this.#Q.build(this,t);return r.isStaleByTime(h(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(u).catch(u)}fetchInfiniteQuery(e){return e.behavior=G(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(u).catch(u)}ensureInfiniteQueryData(e){return e.behavior=G(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return T.isOnline()?this.#m.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#Q}getMutationCache(){return this.#m}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=e}setQueryDefaults(e,t){this.#W.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#W.values()],r={};return t.forEach((t=>{x(e,t.queryKey)&&Object.assign(r,t.defaultOptions)})),r}setMutationDefaults(e,t){this.#H.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#H.values()];let r={};return t.forEach((t=>{x(e,t.mutationKey)&&(r={...r,...t.defaultOptions})})),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#u.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=v(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===R&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#Q.clear(),this.#m.clear()}}({defaultOptions:{queries:{refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1}}}),Jd=e=>{const{activeTab:t}=ba();return(0,Y.jsxs)("div",{className:"flex flex-col h-screen",children:[(0,Y.jsx)(wa,{}),(0,Y.jsx)(Aa,{children:"cloud"!==(null==t?void 0:t.id)?(0,Y.jsxs)("div",{className:"flex h-[calc(100%-60px)]",children:[(0,Y.jsx)(Za,{}),(0,Y.jsx)(Yd,{})]}):(0,Y.jsx)(ga,{...e})})]})},ef=e=>{let{view:t,...r}=e;return(0,s.useEffect)((()=>(document.body.classList.add("ui-dc-styles"),()=>{document.body.classList.remove("ui-dc-styles")})),[]),(0,Y.jsx)(ee,{client:Xd,children:(0,Y.jsx)(xa,{defaultTab:t,children:(0,Y.jsx)(Hl,{children:(0,Y.jsx)(Jd,{...r})})})})},tf=e=>(0,Y.jsx)(l().StrictMode,{children:(0,Y.jsx)(ef,{...e})});return console.log("Production mode: React app not rendered."),i})(),e.exports=n(r(609),r(795))},609:e=>{"use strict";e.exports=window.React},795:e=>{"use strict";e.exports=window.ReactDOM}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(940),t=r(795),n=r.n(t);const o=window.ReactJSXRuntime,i="design-cloud-react-root",s=()=>{const e=window.elementor,t=document.createElement("div");t.classList.add("elementor-add-section-area-button"),t.classList.add("uicore-dc-trigger"),t.title="Design Cloud",t.innerHTML="";const r=e.$previewContents.find(".elementor-add-new-section");Array.from(r).forEach((r=>{r.querySelector(".uicore-dc-trigger")||(r.querySelector(".elementor-add-section-area-button:nth-child(2)").after(t),window.isDesignCloud||(window.isDesignCloud=!0,e.$previewContents.on("click",".uicore-dc-trigger",a)))}))},a=(t,r=null)=>{if(!document.querySelector("#uicore-library-wrap")){if(window.designCloudIndex=void 0,t){const e=t.target;if(window.elementor.$previewContents.find(".elementor-add-section-inline").length){const t=e.closest(".elementor-add-section-inline");if(!t)return;window.designCloudIndex=Array.from(t.parentNode.children).indexOf(t)}}const e=document.createElement("div");e.classList.add("uicore-dc-popup");const r=document.createElement("div");r.id=i,r.style.height="calc(100% - 40px)";const o=document.createElement("button");o.classList.add("uicore-dc-popup-close"),o.innerHTML="×",o.type="button",o.onclick=()=>{e.remove(),n().createRoot(r).unmount(),document.body.classList.remove("ui-dc-styles")},e.appendChild(o),e.appendChild(r),document.body.appendChild(e)}const s=document.getElementById(i);n().createRoot(s).render((0,o.jsx)(e.DesignCloud,{template:r}))};window.addEventListener("elementor:loaded",(()=>{const e=window.elementor;e.on("preview:loaded",(()=>{const t=setInterval((()=>{e.$previewContents.find(".elementor-add-new-section").length&&(s(),clearInterval(t))}),400),r=document.createElement("style");r.innerHTML="\n\t\t.uicore-dc-trigger {\n\t\t\tbackground: #10172a\n\t\t\t\turl(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUgMjIuMzkyN0M1IDE3Ljc5MTQgOC43MzAwNyAxNC4wNTEzIDEzLjMzMTQgMTQuMDUxM1YxNC4wNTEzQzE3LjkzMjYgMTQuMDUxMyAyMS42NjI3IDE3Ljc4MTMgMjEuNjYyNyAyMi4zODI2VjMwLjc1NDNIMTMuMzUxNUM4LjczOTExIDMwLjc1NDMgNSAyNy4wMDUxIDUgMjIuMzkyN1YyMi4zOTI3WiIgZmlsbD0iIzE5RDlGRiIvPgo8cGF0aCBkPSJNMTIuMzQzOCAxNy4xMzgzQzEyLjM0MzggMTIuMDkxMyAxNi40MzUxIDggMjEuNDgyIDhWOEMyNi41Mjg5IDggMzAuNjIwMyAxMi4xMDE0IDMwLjYyMDMgMTcuMTQ4M1YxNy4xNDgzQzMwLjYyMDMgMjIuMjA2NCAyNi41MTk5IDI2LjMxNjkgMjEuNDYxOCAyNi4zMTY5SDEyLjM0MzhWMTcuMTM4M1oiIGZpbGw9IiNDOTI2RkYiLz4KPHBhdGggZD0iTTIxLjY2MDIgMjQuNjIyNEMyMS42NjAyIDIxLjI1NzggMjQuMzg3NyAxOC41MzAzIDI3Ljc1MjMgMTguNTMwM1YxOC41MzAzQzMxLjExNjkgMTguNTMwMyAzMy44NDQ1IDIxLjI2NzkgMzMuODQ0NSAyNC42MzI1VjI0LjYzMjVDMzMuODQ0NSAyOC4wMDgzIDMxLjEwNzkgMzAuNzU1IDI3LjczMjIgMzAuNzU1SDIxLjY2MDJWMjQuNjIyNFoiIGZpbGw9IiNGRkREMzMiLz4KPHBhdGggZD0iTTI3Ljc1NjggMTguNTMwM0MyOC43MDYgMTguNTMwMyAyOS42MDQ0IDE4Ljc0ODMgMzAuNDA1MyAxOS4xMzY3QzI5LjUxMDggMjMuMTc4NSAyNS45NTExIDI2LjIxOTIgMjEuNjY0MSAyNi4zMTA1VjI0LjYyMjFDMjEuNjY0MiAyMS4yNTc2IDI0LjM5MjMgMTguNTMwMyAyNy43NTY4IDE4LjUzMDNaIiBmaWxsPSIjRkY3RDNFIi8+CjxwYXRoIGQ9Ik0xMy4zMzQgMTQuMDUxM0MxNy45MzUzIDE0LjA1MTMgMjEuNjY2IDE3Ljc4MiAyMS42NjYgMjIuMzgzM1YyNi4zMTFDMjEuNTk5NCAyNi4zMTI1IDIxLjUzMjcgMjYuMzE2OSAyMS40NjU4IDI2LjMxNjlIMTIuMzQ3N1YxNy4xMzgyQzEyLjM0NzcgMTYuMDU5NSAxMi41MzU3IDE1LjAyNDcgMTIuODc4OSAxNC4wNjRDMTMuMDI5NiAxNC4wNTU4IDEzLjE4MTMgMTQuMDUxMyAxMy4zMzQgMTQuMDUxM1oiIGZpbGw9IiMxOThDRkYiLz4KPC9zdmc+Cg==)\n\t\t\t\tno-repeat center/35px!important;\n\t\t\ttransition: filter 0.3s ease;\n\t\t}\n\t\t.uicore-dc-trigger:hover {\n\t\t\tfilter: brightness(1.3);\n\t\t}\n\t\t",e.$previewContents[0].documentElement.appendChild(r),e.$previewContents.on("click",".elementor-editor-element-setting.elementor-editor-element-add",s)}))}))})()})();
| ver. 1.1 | |
.
| PHP 8.4.20 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0.3 |
proxy
|
phpinfo
|
ÐаÑтройка