@vireo-ai/trellis-ui 0.1.56 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/client/src/components/data-grid/styles.css +0 -16
- package/packages/client/src/components/panels/styles.css +2 -10
- package/packages/client/src/styles/components.css +1 -1
- package/packages/client/src/styles/generated/theme-fonts.css +1 -1
- package/packages/client/src/styles/generated/theme-palette.css +275 -59
- package/packages/client/src/styles/generated/theme-runtime.css +1007 -24
- package/packages/client/src/styles/generated-sources.css +1 -1
- package/packages/client/src/styles/recipes/selection.css +62 -12
- package/packages/client/src/styles/theme-support.css +23 -2
- package/packages/client/types/components/accordion/index.d.ts +3 -3
- package/packages/client/types/components/accordion/machine.d.ts +11 -7
- package/packages/client/types/components/app/contract.d.ts +5 -5
- package/packages/client/types/components/box/contract.d.ts +2 -2
- package/packages/client/types/components/card/contract.d.ts +2 -2
- package/packages/client/types/components/common.d.ts +3 -3
- package/packages/client/types/components/container/contract.d.ts +1 -1
- package/packages/client/types/components/date-picker/contract.d.ts +2 -2
- package/packages/client/types/components/date-picker/machine.d.ts +2 -2
- package/packages/client/types/components/flex/contract.d.ts +1 -1
- package/packages/client/types/components/frame/contract.d.ts +2 -2
- package/packages/client/types/components/grid/contract.d.ts +1 -1
- package/packages/client/types/components/layout.d.ts +2 -2
- package/packages/client/types/components/menu/contract.d.ts +4 -2
- package/packages/client/types/components/modal/contract.d.ts +2 -2
- package/packages/client/types/components/section/contract.d.ts +1 -1
- package/packages/client/types/components/select/contract.d.ts +2 -2
- package/packages/client/types/components/select/machine.d.ts +2 -2
- package/packages/client/types/components/sidebar/contract.d.ts +3 -3
- package/packages/client/types/components/stack/contract.d.ts +1 -1
- package/packages/client/types/components/tooltip/contract.d.ts +2 -2
- package/packages/client/types/runtime/engine/stream.d.ts +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +3278 -265
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +343 -342
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-B7n3PcSH.js → capability-motion-BGVnZE_T.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-B7n3PcSH.js.map → capability-motion-BGVnZE_T.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-BgPVyFfh.js → capability-sortable-ehmPfdn1.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-BgPVyFfh.js.map → capability-sortable-ehmPfdn1.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-CBK89mIt.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-CBK89mIt.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-CYvnO__o.js → core-Ybm_WmKr.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-CYvnO__o.js.map → core-Ybm_WmKr.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BAghaHV-.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BAghaHV-.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D-2vjhTV.js → entry.generated-BREj4oHG.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BREj4oHG.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DSWnCzSX.js → entry.generated-BZWdGtgg.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DSWnCzSX.js.map → entry.generated-BZWdGtgg.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CwuIK_Zx.js → entry.generated-COp9wMCd.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CwuIK_Zx.js.map → entry.generated-COp9wMCd.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dfm1775-.js → entry.generated-CVOYoh61.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dfm1775-.js.map → entry.generated-CVOYoh61.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-d1MxpnFh.js → entry.generated-CVWqQEed.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-d1MxpnFh.js.map → entry.generated-CVWqQEed.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BXvp4vUv.js → entry.generated-C_ObpRjR.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BXvp4vUv.js.map → entry.generated-C_ObpRjR.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BLduYCHm.js → entry.generated-C_SxTqg5.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BLduYCHm.js.map → entry.generated-C_SxTqg5.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B4lDxzh9.js → entry.generated-Cb-VMAE1.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B4lDxzh9.js.map → entry.generated-Cb-VMAE1.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaC7gw-h.js → entry.generated-CfYgsDun.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaC7gw-h.js.map → entry.generated-CfYgsDun.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dcm3s3ey.js → entry.generated-D2es_Wi2.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dcm3s3ey.js.map → entry.generated-D2es_Wi2.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D6ai6meC.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D6ai6meC.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CheA8dXD.js → entry.generated-DYQxGle9.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CheA8dXD.js.map → entry.generated-DYQxGle9.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_jeOgRf.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_jeOgRf.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DuY9bHje.js → entry.generated-DqL-zI7j.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DuY9bHje.js.map → entry.generated-DqL-zI7j.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C3y5qBcc.js → entry.generated-EqHVGr1d.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C3y5qBcc.js.map → entry.generated-EqHVGr1d.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-z3EbXrD0.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-z3EbXrD0.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-BGTjVnQy.js → flip-Bzn312Nc.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-BGTjVnQy.js.map → flip-Bzn312Nc.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-fU4E5Q4w.js → motion-DI5H1Js0.js} +3 -3
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-fU4E5Q4w.js.map → motion-DI5H1Js0.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{styles-C9PrQrca.js → styles-CQDZhwd_.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{styles-C9PrQrca.js.map → styles-CQDZhwd_.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{ui-B3f-Nt9P.js → ui-CTQoglp3.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CTQoglp3.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/checkbox.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/field.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/input.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/radio.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/slider.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/switch.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +129 -129
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +5 -5
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +5 -5
- package/packages/client/src/styles/layout-participation.css +0 -17
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-De1R7Xh6.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-De1R7Xh6.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BlsLkwW8.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BlsLkwW8.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CC-C5gQn.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CC-C5gQn.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D-2vjhTV.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-QFVPoffg.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-QFVPoffg.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-pfUkaGe1.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-pfUkaGe1.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-B3f-Nt9P.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"../chunks/motion-
|
|
1
|
+
import{t as e}from"../chunks/motion-DI5H1Js0.js";import{n as t,t as n}from"../chunks/capability-motion-BGVnZE_T.js";var r=n;export{r as default,e as motion,t as registerBoundsDirective,n as registerMotionCapability};
|
|
2
2
|
//# sourceMappingURL=motion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"../chunks/capability-sortable-
|
|
1
|
+
import{n as e,r as t,t as n}from"../chunks/capability-sortable-ehmPfdn1.js";var r=n;export{t as createSortableRegistry,r as default,n as registerSortableCapability,e as registerSortableDirective};
|
|
2
2
|
//# sourceMappingURL=sortable.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as e,n as t}from"./ui-
|
|
2
|
-
//# sourceMappingURL=capability-motion-
|
|
1
|
+
import{d as e,n as t}from"./ui-CTQoglp3.js";import{a as n,f as r,i,n as a,r as o,s,t as c,y as l}from"./motion-DI5H1Js0.js";import{n as u}from"./morph-Cq3V_23_.js";var d=e=>{let{height:t,width:n}=e.getBoundingClientRect();return{height:t,width:n}},f=(e,t,n)=>n.some(n=>Math.abs(n===`height`||n===`maxHeight`?e.height-t.height:e.width-t.width)>=1),p=(e,t={})=>{let n=[...new Set(t.properties??[`height`,`width`])],r=t.role??`layout`,i=d(e),a=null,o=0,c=!1,u=[...new Set([...n,...n.includes(`maxHeight`)?[`height`]:[],...n.includes(`maxWidth`)?[`width`]:[]])],p=Object.fromEntries(u.map(t=>[t,e.style.getPropertyValue(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`))])),m={overflow:e.style.overflow,willChange:e.style.willChange},h=()=>{for(let[t,n]of Object.entries(p))e.style.setProperty(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),n);Object.assign(e.style,m)},g=()=>{let t=d(e);return a?.handle.stop(),a=null,h(),t},_=(t=()=>{},u={})=>{if(c)return null;if(a&&u.animate!==!1&&u.key!==void 0&&a.key===u.key)return t(),a.handle;let p=a?g():i;t();let m=d(e);if(i=m,u.animate===!1||!f(p,m,n)||l())return null;let _={...n.some(e=>e===`height`||e===`maxHeight`)?{height:[`${p.height}px`,`${m.height}px`]}:{},...n.some(e=>e===`width`||e===`maxWidth`)?{width:[`${p.width}px`,`${m.width}px`]}:{}};e.style.overflow=`hidden`,e.style.willChange=n.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join(`, `),`height`in _&&(e.style.height=`${p.height}px`),`width`in _&&(e.style.width=`${p.width}px`),n.includes(`maxHeight`)&&(e.style.maxHeight=`${Math.max(p.height,m.height)}px`),n.includes(`maxWidth`)&&(e.style.maxWidth=`${Math.max(p.width,m.width)}px`),e.getBoundingClientRect();let v=s(e,{keyframes:_,role:r,cleanup:h}),y={handle:v,generation:++o,key:u.key};return a=y,v.finished.finally(()=>{a?.generation===y.generation&&(a=null)}),v};return{update:_,refresh:e=>_(void 0,e),destroy(){c||(c=!0,a&&g(),h())}}},m=`data-ui-bounds`,h=(e,t)=>{if(!e||typeof t.evaluate!=`function`)return{};let n=t.evaluate(e);return typeof n==`string`?{role:n}:n??{}},g=e=>{e.directive(`ui-bounds`,(e,{expression:t},n)=>{if(!(e instanceof HTMLElement))return;e.setAttribute(m,``),u(e,m);let r=p(e,h(t,n)),i=!1,a=new MutationObserver(t=>{t.every(t=>t.type===`attributes`&&t.target===e&&(t.attributeName===`style`||t.attributeName===`data-ui-bounds`))||i||(i=!0,queueMicrotask(()=>{i=!1,r.refresh()}))});a.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),n.cleanup?.(()=>{a.disconnect(),r.destroy(),e.removeAttribute(m)})})},_=e=>e.selector?e.selector:e.target?e.target.startsWith(`#`)?e.target:`#${i(e.target)}`:null,v=e=>{let t=getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>e&&e!==`visible`)},y=e=>{let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){if(v(t))return t;t=t.parentElement}return null},b=e=>e.width===0&&e.height===0&&e.top===0&&e.left===0,x=e=>{let t=y(e);if(!t)return!0;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(b(n)&&b(r))return!0;let i=Math.min(n.height,160);return n.top>=r.top&&n.left<r.right&&n.right>r.left&&n.bottom+i<=r.bottom},S=e=>{let t=[];return e.forEach(e=>{let r=_(e),i=r?document.querySelector(r):null;if(!i)return;let a=[],o=i.getAttribute(`data-ui-motion-key`);if(i.querySelectorAll(`[data-ui-motion-key]`).forEach(e=>{let t=e.getAttribute(`data-ui-motion-key`);if(t&&x(e)){let e=n(t);a.push({from:{selector:e},to:{selector:e}})}}),(o||i.hasAttribute(`data-ui-motion-layout`))&&x(i)){let e=o?n(o):r;a.unshift({from:{selector:e},to:{selector:e}})}t.push(...a)}),t},C=(e,t,n={})=>{let i=n.update;if(!i)return r();let o=S(Array.isArray(t)?t:[t]);if(o.length===0||l(n.reducedMotion))return r(i);let s={...n,preset:`stream`};return n.scope&&n.scope!==`target`&&(s.scope=n.scope),a(i,o,s)},w=new WeakSet,T=n=>{w.has(n)||(w.add(n),g(n),o(()=>n.nextTick()),t(c),e((e,t,n)=>{C(e,t,{scope:`target`,update:n})}))};export{g as n,p as r,T as t};
|
|
2
|
+
//# sourceMappingURL=capability-motion-BGVnZE_T.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-motion-B7n3PcSH.js","names":[],"sources":["../../../../../../../../client/src/motion/bounds.ts","../../../../../../../../client/src/directives/bounds.ts","../../../../../../../../client/src/motion/stream.ts","../../../../../../../../client/src/capabilities/motion.ts"],"sourcesContent":["import type {MotionHandle} from './animate';\nimport {type MotionRoleName} from './recipe';\nimport {shouldReduceMotion} from './reduced-motion';\nimport {animateSize} from './size';\n\ntype BoundsProperty = 'height' | 'width' | 'maxHeight' | 'maxWidth';\n\ntype BoundsMotionOptions = Readonly<{\n properties?: readonly BoundsProperty[];\n role?: MotionRoleName;\n}>;\n\ntype BoundsUpdateOptions = Readonly<{\n animate?: boolean;\n /** Stable identity for an animated destination, used to coalesce duplicate syncs. */\n key?: string;\n}>;\n\ntype BoundsMotion = Readonly<{\n update(mutate?: () => void, options?: BoundsUpdateOptions): MotionHandle | null;\n refresh(options?: BoundsUpdateOptions): MotionHandle | null;\n destroy(): void;\n}>;\n\ntype Bounds = Readonly<{height: number; width: number}>;\n\nconst boundsOf = (element: HTMLElement): Bounds => {\n const {height, width} = element.getBoundingClientRect();\n return {height, width};\n};\n\nconst changed = (from: Bounds, to: Bounds, properties: readonly BoundsProperty[]): boolean => (\n properties.some((property) => (\n (property === 'height' || property === 'maxHeight' ? Math.abs(from.height - to.height) : Math.abs(from.width - to.width)) >= 1\n ))\n);\n\nconst createBoundsMotion = (\n element: HTMLElement,\n options: BoundsMotionOptions = {},\n): BoundsMotion => {\n const properties: BoundsProperty[] = [...new Set<BoundsProperty>(options.properties ?? ['height', 'width'])];\n const role = options.role ?? 'layout';\n let settled = boundsOf(element);\n let active: {handle: MotionHandle; generation: number; key: string | undefined} | null = null;\n let generation = 0;\n let destroyed = false;\n\n const presentationProperties = [...new Set<BoundsProperty>([\n ...properties,\n ...(properties.includes('maxHeight') ? ['height' as const] : []),\n ...(properties.includes('maxWidth') ? ['width' as const] : []),\n ])];\n const baseline = Object.fromEntries(presentationProperties.map((property) => [property, element.style.getPropertyValue(\n property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`),\n )])) as Record<BoundsProperty, string>;\n const presentation = {\n overflow: element.style.overflow,\n willChange: element.style.willChange,\n };\n\n const restore = (): void => {\n for (const [property, value] of Object.entries(baseline)) {\n element.style.setProperty(property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`), value);\n }\n Object.assign(element.style, presentation);\n };\n\n const stop = (): Bounds => {\n const rendered = boundsOf(element);\n active?.handle.stop();\n active = null;\n restore();\n return rendered;\n };\n\n const update = (mutate: () => void = () => {}, updateOptions: BoundsUpdateOptions = {}): MotionHandle | null => {\n if (destroyed) return null;\n if (active && updateOptions.animate !== false && updateOptions.key !== undefined && active.key === updateOptions.key) {\n mutate();\n return active.handle;\n }\n const from = active ? stop() : settled;\n mutate();\n const to = boundsOf(element);\n settled = to;\n if (updateOptions.animate === false || !changed(from, to, properties)) return null;\n if (shouldReduceMotion()) return null;\n\n const keyframes = {\n ...(properties.some((property) => property === 'height' || property === 'maxHeight')\n ? {height: [`${from.height}px`, `${to.height}px`]} : {}),\n ...(properties.some((property) => property === 'width' || property === 'maxWidth')\n ? {width: [`${from.width}px`, `${to.width}px`]} : {}),\n };\n element.style.overflow = 'hidden';\n element.style.willChange = properties.map((property) => property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)).join(', ');\n if ('height' in keyframes) element.style.height = `${from.height}px`;\n if ('width' in keyframes) element.style.width = `${from.width}px`;\n if (properties.includes('maxHeight')) element.style.maxHeight = `${Math.max(from.height, to.height)}px`;\n if (properties.includes('maxWidth')) element.style.maxWidth = `${Math.max(from.width, to.width)}px`;\n // Commit the source bounds before Motion takes ownership so a server morph\n // cannot collapse the source and destination into the same rendered frame.\n element.getBoundingClientRect();\n const handle = animateSize(element, {keyframes, role, cleanup: restore});\n const current = {handle, generation: ++generation, key: updateOptions.key};\n active = current;\n void handle.finished.finally(() => {\n if (active?.generation !== current.generation) return;\n active = null;\n });\n return handle;\n };\n\n return {\n update,\n refresh: (updateOptions) => update(undefined, updateOptions),\n destroy() {\n if (destroyed) return;\n destroyed = true;\n if (active) stop();\n restore();\n },\n };\n};\n\nexport {createBoundsMotion};\nexport type {BoundsMotion, BoundsMotionOptions, BoundsProperty, BoundsUpdateOptions};\n","import type Alpine from 'alpinejs';\nimport {createBoundsMotion, type BoundsMotionOptions} from '@client/motion/bounds';\nimport type {MotionRoleName} from '@client/motion/recipe';\nimport {declareMorphAttributes} from '@client/runtime/morph';\n\nconst BOUNDS_ATTR = 'data-ui-bounds';\n\nconst readOptions = (expression: string | undefined, utilities: Alpine.DirectiveUtilities): BoundsMotionOptions => {\n if (!expression || typeof utilities.evaluate !== 'function') return {};\n const value = utilities.evaluate(expression) as BoundsMotionOptions | string | undefined;\n return typeof value === 'string' ? {role: value as MotionRoleName} : value ?? {};\n};\n\nconst registerBoundsDirective = (Alpine: Alpine.Alpine): void => {\n Alpine.directive('ui-bounds', (el, {expression}, utilities) => {\n if (!(el instanceof HTMLElement)) return;\n\n el.setAttribute(BOUNDS_ATTR, '');\n declareMorphAttributes(el, BOUNDS_ATTR);\n const bounds = createBoundsMotion(el, readOptions(expression, utilities));\n let scheduled = false;\n const observer = new MutationObserver((records) => {\n if (records.every((record) => record.type === 'attributes'\n && record.target === el\n && (record.attributeName === 'style' || record.attributeName === BOUNDS_ATTR))) return;\n if (scheduled) return;\n scheduled = true;\n queueMicrotask(() => {\n scheduled = false;\n bounds.refresh();\n });\n });\n observer.observe(el, {attributes: true, characterData: true, childList: true, subtree: true});\n\n utilities.cleanup?.(() => {\n observer.disconnect();\n bounds.destroy();\n el.removeAttribute(BOUNDS_ATTR);\n });\n });\n};\n\nexport {BOUNDS_ATTR, registerBoundsDirective};\n","import {animateView, type AnimateViewOptions} from './view';\nimport {cssEscape, keySelector, type MotionTarget, type ViewScope} from './targets';\nimport {noopHandle, type MotionHandle} from './animate';\nimport {shouldReduceMotion, type MotionPreference} from './reduced-motion';\n\ntype StreamPatchLike = {\n html?: string | null;\n target?: string | null;\n selector?: string | null;\n};\n\ntype AnimateStreamPatchOptions = Omit<AnimateViewOptions, 'scope' | 'preset'> & {\n scope?: ViewScope | 'target';\n update?: () => void | Promise<void>;\n reducedMotion?: MotionPreference;\n};\n\nconst targetSelectorForPatch = (patch: StreamPatchLike): string | null => {\n if (patch.selector) return patch.selector;\n if (!patch.target) return null;\n return patch.target.startsWith('#') ? patch.target : `#${cssEscape(patch.target)}`;\n};\n\nconst clipsOverflow = (element: Element): boolean => {\n const style = getComputedStyle(element);\n return [style.overflow, style.overflowX, style.overflowY].some((value) => value && value !== 'visible');\n};\n\nconst nearestClippingAncestor = (element: Element): Element | null => {\n let current = element.parentElement;\n while (current && current !== document.body && current !== document.documentElement) {\n if (clipsOverflow(current)) return current;\n current = current.parentElement;\n }\n return null;\n};\n\nconst isZeroRect = (rect: DOMRect): boolean => (\n rect.width === 0 && rect.height === 0 && rect.top === 0 && rect.left === 0\n);\n\nconst isComfortablyInsideClip = (element: Element): boolean => {\n const clip = nearestClippingAncestor(element);\n if (!clip) return true;\n\n const rect = element.getBoundingClientRect();\n const clipRect = clip.getBoundingClientRect();\n if (isZeroRect(rect) && isZeroRect(clipRect)) return true;\n\n const movementGuard = Math.min(rect.height, 160);\n return (\n rect.top >= clipRect.top\n && rect.left < clipRect.right\n && rect.right > clipRect.left\n && rect.bottom + movementGuard <= clipRect.bottom\n );\n};\n\nconst streamTargetsFromPatches = (patches: StreamPatchLike[]): MotionTarget[] => {\n const targets: MotionTarget[] = [];\n\n patches.forEach((patch) => {\n const selector = targetSelectorForPatch(patch);\n const target = selector ? document.querySelector(selector) : null;\n if (!target) return;\n\n const patchTargets: MotionTarget[] = [];\n const rootKey = target.getAttribute('data-ui-motion-key');\n target.querySelectorAll('[data-ui-motion-key]').forEach((element) => {\n const key = element.getAttribute('data-ui-motion-key');\n if (key && isComfortablyInsideClip(element)) {\n const selector = keySelector(key);\n patchTargets.push({from: {selector}, to: {selector}});\n }\n });\n if ((rootKey || target.hasAttribute('data-ui-motion-layout')) && isComfortablyInsideClip(target)) {\n const rootSelector = rootKey ? keySelector(rootKey) : selector as string;\n patchTargets.unshift({from: {selector: rootSelector}, to: {selector: rootSelector}});\n }\n\n targets.push(...patchTargets);\n });\n\n return targets;\n};\n\nconst animateStreamPatch = <AlpineInstance>(\n _Alpine: AlpineInstance,\n patchOrPatches: StreamPatchLike | StreamPatchLike[],\n options: AnimateStreamPatchOptions = {},\n): MotionHandle => {\n const update = options.update;\n if (!update) return noopHandle();\n\n const patches = Array.isArray(patchOrPatches) ? patchOrPatches : [patchOrPatches];\n const targets = streamTargetsFromPatches(patches);\n if (targets.length === 0 || shouldReduceMotion(options.reducedMotion)) {\n return noopHandle(update);\n }\n\n const viewOptions: AnimateViewOptions = {\n ...options,\n preset: 'stream',\n };\n if (options.scope && options.scope !== 'target') viewOptions.scope = options.scope;\n\n return animateView(update, targets, viewOptions);\n};\n\nexport {animateStreamPatch, streamTargetsFromPatches};\nexport type {AnimateStreamPatchOptions, StreamPatchLike};\n","import type {Alpine as AlpineType} from 'alpinejs';\n\nimport {registerBoundsDirective} from '../directives/bounds';\nimport {motion} from '../motion';\nimport {animateStreamPatch} from '../motion/stream';\nimport {configureViewFlush} from '../motion/view';\nimport {registerStreamPatchAnimator} from '../runtime/engine/stream';\nimport {registerUiMotion} from '../runtime/ui';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerMotionCapability = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerBoundsDirective(AlpineInstance);\n configureViewFlush(() => AlpineInstance.nextTick());\n registerUiMotion(motion);\n registerStreamPatchAnimator((Alpine, patches, update) => {\n animateStreamPatch(Alpine, patches, {scope: 'target', update});\n });\n};\n\nexport {motion, registerBoundsDirective, registerM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,EAAW,EAAY,CAAG,EAChC,EAAa,KAAK,CAAC,KAAM,CAAC,UAAQ,EAAG,GAAI,CAAC,UAAQ,CAAC,CAAC,CACxD,CACJ,CAAC,GACI,GAAW,EAAO,aAAa,uBAAuB,IAAM,EAAwB,CAAM,EAAG,CAC9F,IAAM,EAAe,EAAU,EAAY,CAAO,EAAI,EACtD,EAAa,QAAQ,CAAC,KAAM,CAAC,SAAU,CAAY,EAAG,GAAI,CAAC,SAAU,CAAY,CAAC,CAAC,CACvF,CAEA,EAAQ,KAAK,GAAG,CAAY,CAChC,CAAC,EAEM,CACX,EAEM,GACF,EACA,EACA,EAAqC,CAAC,IACvB,CACf,IAAM,EAAS,EAAQ,OACvB,GAAI,CAAC,EAAQ,OAAO,EAAW,EAG/B,IAAM,EAAU,EADA,MAAM,QAAQ,CAAc,EAAI,EAAiB,CAAC,CAAc,CAChC,EAChD,GAAI,EAAQ,SAAW,GAAK,EAAmB,EAAQ,aAAa,EAChE,OAAO,EAAW,CAAM,EAG5B,IAAM,EAAkC,CACpC,GAAG,EACH,OAAQ,QACZ,EAGA,OAFI,EAAQ,OAAS,EAAQ,QAAU,WAAU,EAAY,MAAQ,EAAQ,OAEtE,EAAY,EAAQ,EAAS,CAAW,CACnD,EClGM,EAAa,IAAI,QAEjB,EAA4B,GAAqC,CAC/D,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAC7B,EAAwB,CAAc,EACtC,MAAyB,EAAe,SAAS,CAAC,EAClD,EAAiB,CAAM,EACvB,GAA6B,EAAQ,EAAS,IAAW,CACrD,EAAmB,EAAQ,EAAS,CAAC,MAAO,SAAU,QAAM,CAAC,CACjE,CAAC,EACL"}
|
|
1
|
+
{"version":3,"file":"capability-motion-BGVnZE_T.js","names":[],"sources":["../../../../../../../../client/src/motion/bounds.ts","../../../../../../../../client/src/directives/bounds.ts","../../../../../../../../client/src/motion/stream.ts","../../../../../../../../client/src/capabilities/motion.ts"],"sourcesContent":["import type {MotionHandle} from './animate';\nimport {type MotionRoleName} from './recipe';\nimport {shouldReduceMotion} from './reduced-motion';\nimport {animateSize} from './size';\n\ntype BoundsProperty = 'height' | 'width' | 'maxHeight' | 'maxWidth';\n\ntype BoundsMotionOptions = Readonly<{\n properties?: readonly BoundsProperty[];\n role?: MotionRoleName;\n}>;\n\ntype BoundsUpdateOptions = Readonly<{\n animate?: boolean;\n /** Stable identity for an animated destination, used to coalesce duplicate syncs. */\n key?: string;\n}>;\n\ntype BoundsMotion = Readonly<{\n update(mutate?: () => void, options?: BoundsUpdateOptions): MotionHandle | null;\n refresh(options?: BoundsUpdateOptions): MotionHandle | null;\n destroy(): void;\n}>;\n\ntype Bounds = Readonly<{height: number; width: number}>;\n\nconst boundsOf = (element: HTMLElement): Bounds => {\n const {height, width} = element.getBoundingClientRect();\n return {height, width};\n};\n\nconst changed = (from: Bounds, to: Bounds, properties: readonly BoundsProperty[]): boolean => (\n properties.some((property) => (\n (property === 'height' || property === 'maxHeight' ? Math.abs(from.height - to.height) : Math.abs(from.width - to.width)) >= 1\n ))\n);\n\nconst createBoundsMotion = (\n element: HTMLElement,\n options: BoundsMotionOptions = {},\n): BoundsMotion => {\n const properties: BoundsProperty[] = [...new Set<BoundsProperty>(options.properties ?? ['height', 'width'])];\n const role = options.role ?? 'layout';\n let settled = boundsOf(element);\n let active: {handle: MotionHandle; generation: number; key: string | undefined} | null = null;\n let generation = 0;\n let destroyed = false;\n\n const presentationProperties = [...new Set<BoundsProperty>([\n ...properties,\n ...(properties.includes('maxHeight') ? ['height' as const] : []),\n ...(properties.includes('maxWidth') ? ['width' as const] : []),\n ])];\n const baseline = Object.fromEntries(presentationProperties.map((property) => [property, element.style.getPropertyValue(\n property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`),\n )])) as Record<BoundsProperty, string>;\n const presentation = {\n overflow: element.style.overflow,\n willChange: element.style.willChange,\n };\n\n const restore = (): void => {\n for (const [property, value] of Object.entries(baseline)) {\n element.style.setProperty(property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`), value);\n }\n Object.assign(element.style, presentation);\n };\n\n const stop = (): Bounds => {\n const rendered = boundsOf(element);\n active?.handle.stop();\n active = null;\n restore();\n return rendered;\n };\n\n const update = (mutate: () => void = () => {}, updateOptions: BoundsUpdateOptions = {}): MotionHandle | null => {\n if (destroyed) return null;\n if (active && updateOptions.animate !== false && updateOptions.key !== undefined && active.key === updateOptions.key) {\n mutate();\n return active.handle;\n }\n const from = active ? stop() : settled;\n mutate();\n const to = boundsOf(element);\n settled = to;\n if (updateOptions.animate === false || !changed(from, to, properties)) return null;\n if (shouldReduceMotion()) return null;\n\n const keyframes = {\n ...(properties.some((property) => property === 'height' || property === 'maxHeight')\n ? {height: [`${from.height}px`, `${to.height}px`]} : {}),\n ...(properties.some((property) => property === 'width' || property === 'maxWidth')\n ? {width: [`${from.width}px`, `${to.width}px`]} : {}),\n };\n element.style.overflow = 'hidden';\n element.style.willChange = properties.map((property) => property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)).join(', ');\n if ('height' in keyframes) element.style.height = `${from.height}px`;\n if ('width' in keyframes) element.style.width = `${from.width}px`;\n if (properties.includes('maxHeight')) element.style.maxHeight = `${Math.max(from.height, to.height)}px`;\n if (properties.includes('maxWidth')) element.style.maxWidth = `${Math.max(from.width, to.width)}px`;\n // Commit the source bounds before Motion takes ownership so a server morph\n // cannot collapse the source and destination into the same rendered frame.\n element.getBoundingClientRect();\n const handle = animateSize(element, {keyframes, role, cleanup: restore});\n const current = {handle, generation: ++generation, key: updateOptions.key};\n active = current;\n void handle.finished.finally(() => {\n if (active?.generation !== current.generation) return;\n active = null;\n });\n return handle;\n };\n\n return {\n update,\n refresh: (updateOptions) => update(undefined, updateOptions),\n destroy() {\n if (destroyed) return;\n destroyed = true;\n if (active) stop();\n restore();\n },\n };\n};\n\nexport {createBoundsMotion};\nexport type {BoundsMotion, BoundsMotionOptions, BoundsProperty, BoundsUpdateOptions};\n","import type Alpine from 'alpinejs';\nimport {createBoundsMotion, type BoundsMotionOptions} from '@client/motion/bounds';\nimport type {MotionRoleName} from '@client/motion/recipe';\nimport {declareMorphAttributes} from '@client/runtime/morph';\n\nconst BOUNDS_ATTR = 'data-ui-bounds';\n\nconst readOptions = (expression: string | undefined, utilities: Alpine.DirectiveUtilities): BoundsMotionOptions => {\n if (!expression || typeof utilities.evaluate !== 'function') return {};\n const value = utilities.evaluate(expression) as BoundsMotionOptions | string | undefined;\n return typeof value === 'string' ? {role: value as MotionRoleName} : value ?? {};\n};\n\nconst registerBoundsDirective = (Alpine: Alpine.Alpine): void => {\n Alpine.directive('ui-bounds', (el, {expression}, utilities) => {\n if (!(el instanceof HTMLElement)) return;\n\n el.setAttribute(BOUNDS_ATTR, '');\n declareMorphAttributes(el, BOUNDS_ATTR);\n const bounds = createBoundsMotion(el, readOptions(expression, utilities));\n let scheduled = false;\n const observer = new MutationObserver((records) => {\n if (records.every((record) => record.type === 'attributes'\n && record.target === el\n && (record.attributeName === 'style' || record.attributeName === BOUNDS_ATTR))) return;\n if (scheduled) return;\n scheduled = true;\n queueMicrotask(() => {\n scheduled = false;\n bounds.refresh();\n });\n });\n observer.observe(el, {attributes: true, characterData: true, childList: true, subtree: true});\n\n utilities.cleanup?.(() => {\n observer.disconnect();\n bounds.destroy();\n el.removeAttribute(BOUNDS_ATTR);\n });\n });\n};\n\nexport {BOUNDS_ATTR, registerBoundsDirective};\n","import {animateView, type AnimateViewOptions} from './view';\nimport {cssEscape, keySelector, type MotionTarget, type ViewScope} from './targets';\nimport {noopHandle, type MotionHandle} from './animate';\nimport {shouldReduceMotion, type MotionPreference} from './reduced-motion';\n\ntype StreamPatchLike = {\n html?: string | null;\n target?: string | null;\n selector?: string | null;\n};\n\ntype AnimateStreamPatchOptions = Omit<AnimateViewOptions, 'scope' | 'preset'> & {\n scope?: ViewScope | 'target';\n update?: () => void | Promise<void>;\n reducedMotion?: MotionPreference;\n};\n\nconst targetSelectorForPatch = (patch: StreamPatchLike): string | null => {\n if (patch.selector) return patch.selector;\n if (!patch.target) return null;\n return patch.target.startsWith('#') ? patch.target : `#${cssEscape(patch.target)}`;\n};\n\nconst clipsOverflow = (element: Element): boolean => {\n const style = getComputedStyle(element);\n return [style.overflow, style.overflowX, style.overflowY].some((value) => value && value !== 'visible');\n};\n\nconst nearestClippingAncestor = (element: Element): Element | null => {\n let current = element.parentElement;\n while (current && current !== document.body && current !== document.documentElement) {\n if (clipsOverflow(current)) return current;\n current = current.parentElement;\n }\n return null;\n};\n\nconst isZeroRect = (rect: DOMRect): boolean => (\n rect.width === 0 && rect.height === 0 && rect.top === 0 && rect.left === 0\n);\n\nconst isComfortablyInsideClip = (element: Element): boolean => {\n const clip = nearestClippingAncestor(element);\n if (!clip) return true;\n\n const rect = element.getBoundingClientRect();\n const clipRect = clip.getBoundingClientRect();\n if (isZeroRect(rect) && isZeroRect(clipRect)) return true;\n\n const movementGuard = Math.min(rect.height, 160);\n return (\n rect.top >= clipRect.top\n && rect.left < clipRect.right\n && rect.right > clipRect.left\n && rect.bottom + movementGuard <= clipRect.bottom\n );\n};\n\nconst streamTargetsFromPatches = (patches: StreamPatchLike[]): MotionTarget[] => {\n const targets: MotionTarget[] = [];\n\n patches.forEach((patch) => {\n const selector = targetSelectorForPatch(patch);\n const target = selector ? document.querySelector(selector) : null;\n if (!target) return;\n\n const patchTargets: MotionTarget[] = [];\n const rootKey = target.getAttribute('data-ui-motion-key');\n target.querySelectorAll('[data-ui-motion-key]').forEach((element) => {\n const key = element.getAttribute('data-ui-motion-key');\n if (key && isComfortablyInsideClip(element)) {\n const selector = keySelector(key);\n patchTargets.push({from: {selector}, to: {selector}});\n }\n });\n if ((rootKey || target.hasAttribute('data-ui-motion-layout')) && isComfortablyInsideClip(target)) {\n const rootSelector = rootKey ? keySelector(rootKey) : selector as string;\n patchTargets.unshift({from: {selector: rootSelector}, to: {selector: rootSelector}});\n }\n\n targets.push(...patchTargets);\n });\n\n return targets;\n};\n\nconst animateStreamPatch = <AlpineInstance>(\n _Alpine: AlpineInstance,\n patchOrPatches: StreamPatchLike | StreamPatchLike[],\n options: AnimateStreamPatchOptions = {},\n): MotionHandle => {\n const update = options.update;\n if (!update) return noopHandle();\n\n const patches = Array.isArray(patchOrPatches) ? patchOrPatches : [patchOrPatches];\n const targets = streamTargetsFromPatches(patches);\n if (targets.length === 0 || shouldReduceMotion(options.reducedMotion)) {\n return noopHandle(update);\n }\n\n const viewOptions: AnimateViewOptions = {\n ...options,\n preset: 'stream',\n };\n if (options.scope && options.scope !== 'target') viewOptions.scope = options.scope;\n\n return animateView(update, targets, viewOptions);\n};\n\nexport {animateStreamPatch, streamTargetsFromPatches};\nexport type {AnimateStreamPatchOptions, StreamPatchLike};\n","import type {Alpine as AlpineType} from 'alpinejs';\n\nimport {registerBoundsDirective} from '../directives/bounds';\nimport {motion} from '../motion';\nimport {animateStreamPatch} from '../motion/stream';\nimport {configureViewFlush} from '../motion/view';\nimport {registerStreamPatchAnimator} from '../runtime/engine/stream';\nimport {registerUiMotion} from '../runtime/ui';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerMotionCapability = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerBoundsDirective(AlpineInstance);\n configureViewFlush(() => AlpineInstance.nextTick());\n registerUiMotion(motion);\n registerStreamPatchAnimator((Alpine, patches, update) => {\n animateStreamPatch(Alpine, patches, {scope: 'target', update});\n });\n};\n\nexport {motion, registerBoundsDirective, registerMotionCapability};\nexport type * from '../motion';\n"],"mappings":"oKA0BA,IAAM,EAAY,GAAiC,CAC/C,GAAM,CAAC,SAAQ,SAAS,EAAQ,sBAAsB,EACtD,MAAO,CAAC,SAAQ,OAAK,CACzB,EAEM,GAAW,EAAc,EAAY,IACvC,EAAW,KAAM,GACwC,KAAK,IAAzD,IAAa,UAAY,IAAa,YAAuB,EAAK,OAAS,EAAG,OAAmB,EAAK,MAAQ,EAAG,KAAK,GAAM,CAChI,EAGC,G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CAAC,CACvF,CAEA,EAAQ,KAAK,GAAG,CAAY,CAChC,CAAC,EAEM,CACX,EAEM,GACF,EACA,EACA,EAAqC,CAAC,IACvB,CACf,IAAM,EAAS,EAAQ,OACvB,GAAI,CAAC,EAAQ,OAAO,EAAW,EAG/B,IAAM,EAAU,EADA,MAAM,QAAQ,CAAc,EAAI,EAAiB,CAAC,CAAc,CAChC,EAChD,GAAI,EAAQ,SAAW,GAAK,EAAmB,EAAQ,aAAa,EAChE,OAAO,EAAW,CAAM,EAG5B,IAAM,EAAkC,CACpC,GAAG,EACH,OAAQ,QACZ,EAGA,OAFI,EAAQ,OAAS,EAAQ,QAAU,WAAU,EAAY,MAAQ,EAAQ,OAEtE,EAAY,EAAQ,EAAS,CAAW,CACnD,EClGM,EAAa,IAAI,QAEjB,EAA4B,GAAqC,CAC/D,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAC7B,EAAwB,CAAc,EACtC,MAAyB,EAAe,SAAS,CAAC,EAClD,EAAiB,CAAM,EACvB,GAA6B,EAAQ,EAAS,IAAW,CACrD,EAAmB,EAAQ,EAAS,CAAC,MAAO,SAAU,QAAM,CAAC,CACjE,CAAC,EACL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{_ as e,b as t,c as n,h as r,u as i,x as a}from"./element-adapter-native-data-key-DrqJDAVH.js";import{r as o}from"./dom-DiTFTWeR.js";import{g as s,h as c,r as l}from"./ui-B3f-Nt9P.js";import{t as u}from"./motion-fU4E5Q4w.js";import{n as d}from"./morph-Cq3V_23_.js";import{c as f,f as p,l as m,n as h,o as g,s as _}from"./codecs-CQ7olTJL.js";import{i as v,t as y}from"./alpine-machine-CE2UN4Qu.js";import{n as b}from"./dom-invalidation-Dw6clnS4.js";import{t as x}from"./focus-pk_lz9sg.js";import{t as S}from"./machine-CNnHDbyo.js";import{a as C,i as ee,n as te,o as ne,r as re,t as ie}from"./pdd-BG5sXFGF.js";import{R as w,y as ae}from"./common-De1R7Xh6.js";var T=e=>e!==null&&Number.isInteger(e)&&e>0,E=4,D=(e,t)=>e===t||!!(e&&t&&e.destination.groupId===t.destination.groupId&&e.anchor?.id===t.anchor?.id&&e.anchor?.edge===t.anchor?.edge&&e.index===t.index),O=({point:e,start:t,end:n})=>{let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return Math.hypot(e.x-t.x,e.y-t.y);let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a));return Math.hypot(e.x-(t.x+o*r),e.y-(t.y+o*i))},k=e=>e.length===0?[]:[{anchor:{id:e[0].id,edge:`before`},index:0,distance:t=>Math.abs(t.clientY-e[0].rect.top)},...e.slice(1).map((t,n)=>{let r=(e[n].rect.bottom+t.rect.top)/2;return{anchor:{id:t.id,edge:`before`},index:n+1,distance:e=>Math.abs(e.clientY-r)}}),{anchor:{id:e.at(-1).id,edge:`after`},index:e.length,distance:t=>Math.abs(t.clientY-e.at(-1).rect.bottom)}],oe=(e,t)=>{if(e.length===0)return[];let n=e=>t===`rtl`?e.rect.right:e.rect.left,r=e=>t===`rtl`?e.rect.left:e.rect.right;return[{anchor:{id:e[0].id,edge:`before`},index:0,distance:t=>Math.abs(t.clientX-n(e[0]))},...e.slice(1).map((t,i)=>{let a=e[i],o=(r(a)+n(t))/2;return{anchor:{id:t.id,edge:`before`},index:i+1,distance:e=>Math.abs(e.clientX-o)}}),{anchor:{id:e.at(-1).id,edge:`after`},index:e.length,distance:t=>Math.abs(t.clientX-r(e.at(-1)))}]},se=({columns:e,direction:t,groupRect:n,items:r})=>{if(!T(e))throw TypeError(`Grid sortable groups require a positive integer columns value.`);if(r.length===0)return[];let i=e=>t===`rtl`?e.rect.right:e.rect.left,a=e=>t===`rtl`?e.rect.left:e.rect.right,o=t=>r.slice(t*e,(t+1)*e),s=e=>Math.min(...o(e).map(e=>e.rect.top)),c=e=>Math.max(...o(e).map(e=>e.rect.bottom)),l=(e,t,n,r)=>({anchor:n,index:r,distance:n=>O({point:{x:n.clientX,y:n.clientY},start:{x:e,y:s(t)},end:{x:e,y:c(t)}})}),u=(e,t,r)=>({anchor:t,index:r,distance:t=>O({point:{x:t.clientX,y:t.clientY},start:{x:n.left,y:e},end:{x:n.right,y:e}})}),d=[l(i(r[0]),0,{id:r[0].id,edge:`before`},0)];for(let t=1;t<r.length;t+=1){let n=r[t],o=r[t-1];if(t%e===0){let r=t/e;d.push(u((c(r-1)+s(r))/2,{id:n.id,edge:`before`},t))}else{let r=Math.floor(t/e);d.push(l((a(o)+i(n))/2,r,{id:n.id,edge:`before`},t))}}let f=r.length-1,p=r[f],m=Math.floor(f/e),h=r.length%e;if(h===0)d.push(u(c(m),{id:p.id,edge:`after`},r.length));else{let e=r[h],t=e===void 0?a(p):(a(p)+i(e))/2;d.push(l(t,m,{id:p.id,edge:`after`},r.length))}return d},A=(e,t)=>e.reduce((e,n)=>n.distance(t)<e.distance(t)?n:e),ce=e=>{if(e.items.length===0)return{destination:{groupId:e.groupId},anchor:null,index:0};let t=A(e.orientation===`horizontal`?oe(e.items,e.direction):e.orientation===`grid`?se(e):k(e.items),e.input);return{destination:{groupId:e.groupId},anchor:t.anchor,index:t.index}},le=e=>{if(e.items.length===0||e.orientation===`grid`)return ce(e);let t=e.orientation===`vertical`?e.input.clientY:e.input.clientX*(e.direction===`rtl`?-1:1),n=e.items.findIndex(({rect:n})=>{let r=e.orientation===`vertical`?n.top+n.height/2:(n.left+n.width/2)*(e.direction===`rtl`?-1:1);return t<r}),r=n<0?e.items.length:n,i=r===e.items.length?{id:e.items.at(-1).id,edge:`after`}:{id:e.items[r].id,edge:`before`};return{destination:{groupId:e.groupId},anchor:i,index:r}},ue=({placement:e,sourceId:t,sourceGroupId:n,itemIds:r})=>{if(n!==e.destination.groupId)return e;let i=r.indexOf(t);if(i<0)return e;let a=r.filter(e=>e!==t),o=Math.max(0,Math.min(a.length,e.index>i?e.index-1:e.index)),s=a.length===0?null:o===a.length?{id:a.at(-1),edge:`after`}:{id:a[o],edge:`before`};return{destination:e.destination,anchor:s,index:o}},de=(e,t)=>{let{groupRect:n,items:r,orientation:i,direction:a}=e;if(r.length===0||t.anchor===null)return i===`horizontal`?{x:a===`rtl`?n.right-E:n.left+E,y:n.top,width:0,height:n.height,kind:`inline-boundary`}:{x:n.left,y:n.top+E,width:n.width,height:0,kind:`block-boundary`};let o=t.index,s=o>0?r[o-1]:void 0,c=o<r.length?r[o]:void 0;if(i===`vertical`){let e=s&&c?(s.rect.bottom+c.rect.top)/2:c?c.rect.top-E:s.rect.bottom+E;return{x:n.left,y:e,width:n.width,height:0,kind:`block-boundary`}}let l=e=>a===`rtl`?e.rect.right:e.rect.left,u=e=>a===`rtl`?e.rect.left:e.rect.right;if(i===`horizontal`)return{x:s&&c?(u(s)+l(c))/2:c?l(c)+(a===`rtl`?E:-4):u(s)+(a===`rtl`?-4:E),y:n.top,width:0,height:n.height,kind:`inline-boundary`};let d=e.columns;if(!T(d))throw TypeError(`Grid sortable groups require a positive integer columns value.`);if(o>0&&o%d===0){let e=c?(s.rect.bottom+c.rect.top)/2:s.rect.bottom+E;return{x:n.left,y:e,width:n.width,height:0,kind:`block-boundary`}}let f;if(s&&c)f=(u(s)+l(c))/2;else if(c)f=l(c)+(a===`rtl`?E:-4);else{let e=r.length%d,t=e===0?void 0:r[e];f=t?(u(s)+l(t))/2:u(s)+(a===`rtl`?-4:E)}let p=Math.floor(Math.min(o,r.length-1)/d)*d,m=r.slice(p,p+d);return{x:f,y:Math.min(...m.map(e=>e.rect.top)),width:0,height:Math.max(...m.map(e=>e.rect.bottom))-Math.min(...m.map(e=>e.rect.top)),kind:`inline-boundary`}};function fe(e){var t=e.list,n=e.startIndex,r=e.finishIndex;if(n===-1||r===-1)return Array.from(t);var i=Array.from(t),o=i.splice(n,1),s=a(o,1)[0];return i.splice(r,0,s),i}var j=(e,t,n)=>({groupId:e,id:t.id,x:n.left-t.rect.left,y:n.top-t.rect.top}),M=({x:e,y:t})=>e!==0||t!==0,N=(e,t,n)=>({left:e.left+t,top:e.top+n,right:e.right+t,bottom:e.bottom+n,width:e.width,height:e.height}),pe=e=>{let{items:t,orientation:n,direction:r,columns:i}=e,a=t.at(-1);if(!a)return null;let o=t.at(-2);if(n===`vertical`){let e=o?a.rect.top-o.rect.top:a.rect.height+8;return N(a.rect,0,e)}if(n===`horizontal`){let e=o?a.rect.left-o.rect.left:(a.rect.width+8)*(r===`rtl`?-1:1);return N(a.rect,e,0)}if(i&&t.length>=i){let e=t[t.length-i];return N(e.rect,0,a.rect.top-e.rect.top||a.rect.height+8)}let s=o?a.rect.left-o.rect.left:(a.rect.width+8)*(r===`rtl`?-1:1);return N(a.rect,s,0)},P=e=>{let t=pe(e);return t?[...e.items.map(({rect:e})=>e),t]:[]},me=({source:e,placement:t,sourceLayout:n,destinationLayout:r=n})=>{if(!r)return null;let i=Math.max(0,Math.min(r.items.length,t.index));return e.groupId===r.groupId&&n?n.items[Math.min(i,n.items.length-1)]?.rect??r.groupRect:P(r)[i]??r.groupRect},he=({source:e,placement:t,sourceLayout:n,destinationLayout:r=n})=>{if(!r)return[];let i=Math.max(0,Math.min(r.items.length,t.index));if(e.groupId===r.groupId&&n){let t=n.items.findIndex(({id:t})=>t===e.id);if(t<0)return[];let r=fe({list:[...n.items],startIndex:t,finishIndex:i}),a=new Map;return r.forEach((e,t)=>{let r=e.id,i=n.items[t]?.rect;i&&!a.has(r)&&a.set(r,i)}),n.items.map(e=>{let t=a.get(e.id);return t?j(n.groupId,e,t):null}).filter(e=>e!==null).filter(M)}let a=P(r),o=r.items.map((e,t)=>j(r.groupId,e,a[t<i?t:t+1])).filter(M);if(!n||e.groupId===null)return o;let s=n.items.findIndex(({id:t})=>t===e.id);if(s<0)return o;let c=n.items[s],l=j(n.groupId,c,a[i]??r.groupRect);return M(l)&&o.push(l),n.items.slice(s+1).forEach((e,t)=>{o.push(j(n.groupId,e,n.items[s+t].rect))}),o},ge=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:px)?$/,F=(e,t,n,r,i)=>e===r?t:e===`center`?t-n/2:e===i?t-n:ge.test(e)?t+Number.parseFloat(e):null,I=({value:e,input:t,initialInput:n,sourceRect:r,previewSize:i})=>{let a={x:t.clientX-(n.clientX-r.left),y:t.clientY-(n.clientY-r.top)},o=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(o.length===0||o.length===1&&o[0]===`preserve`||o.length!==2)return a;let s=F(o[0],t.clientX,i.width,`left`,`right`),c=F(o[1],t.clientY,i.height,`top`,`bottom`);return s===null||c===null?a:{x:s,y:c}},_e=e=>{e.setAttribute(`x-ignore`,``),[e,...e.querySelectorAll(`*`)].forEach(e=>{e.removeAttribute(`id`),(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&(e.disabled=!0),(e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&(e.disabled=!0)})},ve=(e,t)=>{let n=[e,...e.querySelectorAll(`input, textarea, select`)],r=[t,...t.querySelectorAll(`input, textarea, select`)];n.forEach((e,t)=>{let n=r[t];e instanceof HTMLInputElement&&n instanceof HTMLInputElement?(n.value=e.value,n.checked=e.checked):e instanceof HTMLTextAreaElement&&n instanceof HTMLTextAreaElement?n.value=e.value:e instanceof HTMLSelectElement&&n instanceof HTMLSelectElement&&(n.selectedIndex=e.selectedIndex)})},ye=e=>({x:e.left,y:e.top,width:e.width,height:e.height}),be=({source:e,input:t,preview:n,previewPosition:r=`preserve`,opacity:i=.92,color:a=`neutral`,interaction:o=`edge`})=>{let s=e.getBoundingClientRect(),c=document.createElement(`div`),l=document.createElement(`div`),d=document.createElement(`div`),f=n?.content.firstElementChild?.cloneNode(!0),p=f instanceof HTMLElement,m=p?f:e.cloneNode(!0);p||ve(e,m),_e(m),c.setAttribute(`data-ui-sortable-overlay`,``),c.setAttribute(`popover`,`manual`),l.setAttribute(`data-ui-sortable-ghost-positioner`,``),d.setAttribute(`data-ui-sortable-ghost`,``),d.setAttribute(`aria-hidden`,`true`),d.setAttribute(`inert`,``),p||(d.setAttribute(`data-ui-sortable-default-preview`,``),d.setAttribute(`data-ui-selection-color`,``),d.dataset.color=a,d.dataset.uiInteraction=o,d.dataset.selected=`true`,d.dataset.uiSurface=`+1`,d.dataset.uiElevation=`2`);let h=e.closest(`[data-theme], .dark, .light`);h?.classList.contains(`dark`)&&c.classList.add(`dark`),h?.classList.contains(`light`)&&c.classList.add(`light`),h?.dataset.theme&&(c.dataset.theme=h.dataset.theme),Object.assign(c.style,{position:`fixed`,inset:`0`,width:`100vw`,height:`100vh`,maxWidth:`none`,maxHeight:`none`,margin:`0`,padding:`0`,border:`0`,background:`transparent`,overflow:`clip`,contain:`strict`,zIndex:`2147483647`,pointerEvents:`none`}),Object.assign(l.style,{position:`absolute`,left:`0`,top:`0`,width:p?`max-content`:`${s.width}px`,height:p?`max-content`:`${s.height}px`,pointerEvents:`none`}),Object.assign(d.style,{width:p?`max-content`:`100%`,height:p?`max-content`:`100%`,opacity:`${i}`,pointerEvents:`none`,...p?{}:{overflow:`hidden`,borderRadius:`var(--radius-overlay-sm)`}}),d.append(m),l.append(d),c.append(l),document.body.append(c),c.showPopover?.();let g=l.getBoundingClientRect(),_=p?{width:g.width,height:g.height}:{width:s.width,height:s.height},v=e=>I({value:r,input:e,initialInput:t,sourceRect:s,previewSize:_}),y=e=>I({value:`preserve`,input:e,initialInput:t,sourceRect:s,previewSize:{width:s.width,height:s.height}}),b=v(t),x=u.createController({values:{x:{initial:b.x,transition:u.roles.layout},y:{initial:b.y,transition:u.roles.layout}},style:({x:e,y:t})=>({transform:`translate3d(${e}px, ${t}px, 0)`})});return x.mount(l),{positioner:l,visual:d,frame:()=>({...x.current(),..._}),projectedFrame:e=>({...v(e),..._}),projectedSourceFrame:e=>({...y(e),width:s.width,height:s.height}),move(e){x.set(v(e))},async finish(e){e&&await x.animate({x:e.x,y:e.y}).finished},remove:()=>{x.destroy(),c.remove()}}},L=t(),xe=1e3,Se=null,R=`1px`,Ce={width:R,height:R,padding:`0`,position:`absolute`,border:`0`,clip:`rect(${R}, ${R}, ${R}, ${R})`,overflow:`hidden`,whiteSpace:`nowrap`,marginTop:`-${R}`,pointerEvents:`none`};function we(){var e=document.createElement(`div`);return e.setAttribute(`role`,`status`),Object.assign(e.style,Ce),document.body.append(e),e}function Te(){return Se===null&&(Se=we()),Se}var z=null;function Ee(){z!==null&&clearTimeout(z),z=null}function De(e){Te(),Ee(),z=setTimeout(function(){z=null;var t=Te();t.textContent=e},xe)}var Oe=new WeakMap,B=(e,t)=>`${e}\u0000${t}`,ke=(e,t)=>{let n={destination:Object.freeze({...t.destination}),anchor:t.anchor===null?null:Object.freeze({...t.anchor}),index:t.index};return e.operation===`insert`?Object.freeze({operation:`insert`,source:Object.freeze({...e}),...n}):Object.freeze({operation:`move`,source:Object.freeze({...e}),...n})},Ae=()=>{let e=new Map,t=new Map,n=(e,t,n,r,i)=>{let a=t,o=!0,s=e.get(a);if(s&&(s.element.isConnected||!r.element.isConnected))throw Error(`Duplicate sortable ${i} identity: ${a.replace(`\0`,`/`)}`);return e.set(a,r),Object.assign(()=>{o&&(o=!1,e.get(a)===r&&e.delete(a))},{refresh:()=>{if(!o)return;let t=n();if(t===a)return;let s=e.get(t);if(s&&s!==r&&(s.element.isConnected||!r.element.isConnected))throw Error(`Duplicate sortable ${i} identity: ${t.replace(`\0`,`/`)}`);e.get(a)===r&&e.delete(a),e.set(t,r),a=t}})},r=(t,n)=>e.get(B(t,n))??null,i=(e,n)=>t.get(B(e,n))??null,a=(e,t,n=null)=>{let a=r(e.scopeId,t),o=i(e.scopeId,e.id);if(!a||!o||o.isDisabled())return!1;let s=a.getGroup();if(s.disabled||s.readOnly||s.orientation===`grid`&&!T(s.columns)||!s.accepts.includes(e.type))return!1;let c=a.getItemIds().filter(n=>e.operation!==`move`||e.groupId!==t||n!==e.id),l=Object.freeze({source:e,destination:s,itemIds:Object.freeze(c),input:n===null?null:Object.freeze({...n})});return a.canDrop?.(l)!==!1},s=(e,t)=>{let n=r(e.scopeId,t.destination.groupId);if(!n)return null;let i=n.getItemIds(),a=e.operation===`move`&&e.groupId===t.destination.groupId?i.filter(t=>t!==e.id):[...i];if(t.anchor!==null&&!a.includes(t.anchor.id))return null;let o=t.anchor===null?0:a.indexOf(t.anchor.id)+ +(t.anchor.edge===`after`);return{originalIds:i,placement:{destination:t.destination,anchor:t.anchor,index:o}}},c=(e,t,n)=>e.operation===`move`&&e.groupId===n.destination.groupId&&t.indexOf(e.id)===n.index,l=(e,t)=>{let n=s(e,t);return n!==null&&c(e,n.originalIds,n.placement)},u=(e,t,n=null)=>{let i=r(e.scopeId,t.destination.groupId);if(!i||!a(e,t.destination.groupId,n))return null;let l=i.getGroup(),u=s(e,t);if(!u||c(e,u.originalIds,u.placement))return null;let d=ke(e,u.placement),f=!1;return Object.freeze({placement:u.placement,commit:()=>{f||(f=!0,o({el:i.element,name:`ui:sortable-drop`,composed:!0,detail:d}),e.label&&l.label&&De(`${e.label} moved to ${l.label}.`))}})},d=(e,t,n=null)=>{let r=u(e,t,n);return r?(r.commit(),!0):!1},f=(e,t)=>{let n=i(t.scope,t.sourceId);if(!n)return!1;let r=n.getSource(),a=t.destinationGroupId??r.groupId;return!a||t.anchorId===t.sourceId?!1:d(r,{destination:{groupId:a},anchor:{id:t.anchorId,edge:e}})},p=(e,t)=>{let n=i(t.scope,t.sourceId),a=r(t.scope,t.destinationGroupId);if(!n||!a)return!1;let o=n.getSource(),s=a.getItemIds().filter(e=>o.groupId!==t.destinationGroupId||e!==o.id),c=s.length===0?null:e===`start`?{id:s[0],edge:`before`}:{id:s.at(-1),edge:`after`};return d(o,{destination:{groupId:t.destinationGroupId},anchor:c})},m={registerGroup:t=>{let r=t.getGroup();return n(e,B(r.scopeId,r.id),()=>{let e=t.getGroup();return B(e.scopeId,e.id)},t,`group`)},registerSource:e=>{let r=e.getSource();return n(t,B(r.scopeId,r.id),()=>{let t=e.getSource();return B(t.scopeId,t.id)},e,`source`)},group:r,source:i,canDrop:a,isNoop:l,emitDrop:d,moveBefore:e=>f(`before`,e),moveAfter:e=>f(`after`,e),moveToStart:e=>p(`start`,e),moveToEnd:e=>p(`end`,e)};return Oe.set(m,u),m},je=(e,t,n,r=null)=>Oe.get(e)?.(t,n,r)??null,V=`--ui-sortable-drag-cursor`,H=`data-ui-sortable-dragging`,Me=e=>{let t=document.documentElement,n=t.getAttribute(H),r=t.style.getPropertyValue(V);return t.setAttribute(H,``),t.style.setProperty(V,e.trim()||`default`),()=>{n===null?t.removeAttribute(H):t.setAttribute(H,n),r?t.style.setProperty(V,r):t.style.removeProperty(V)}},Ne=({props:e,effects:t})=>S({type:`parallel`,on:{PROPS_CHANGED:{reduce:`props`,effects:`reconcile`},DOM_INVALIDATED:{effects:`reconcile`}},states:{interaction:{initial:`idle`,on:{POINTER_MOVED:{reduce:`pointer`}},states:{idle:{on:{START:{target:`starting`,reduce:`start`}}},starting:{on:{STARTING_DONE:{target:`dragging`},END:{target:`ending`,reduce:`data`}}},dragging:{on:{END:{target:`ending`,reduce:`data`}}},ending:{on:{ENDING_DONE:{target:`idle`,effects:`complete`}}}}},layout:{initial:`inactive`,states:{inactive:{on:{START:{target:`calculating`}}},calculating:{entry:`resolvePlacement`,on:{POINTER_MOVED:{effects:`resolvePlacement`},LAYOUT_PROPOSED:{target:`syncing`,reduce:`data`},END:{target:`inactive`}}},syncing:{on:{RECTS_SYNCED:{target:`calculating`,effects:`synced`},END:{target:`inactive`,effects:`synced`}}}}}}},{props:e,context:{data:{},pointer:null},reducers:{start:({event:e})=>({context:{data:e.data,pointer:null}}),data:({context:e,event:t})=>({context:{...e,data:t.data}}),pointer:({context:e,event:t})=>({context:{...e,pointer:t.pointer}}),props:({context:e,event:t})=>({context:e,props:t.props})},effects:t}),Pe=`data-pdnd-honey-pot`;function Fe(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function Ie(e){var t=document.elementsFromPoint(e.x,e.y),n=a(t,2),r=n[0],i=n[1];return r?Fe(r)?i??null:r:null}var Le=2147483647,Re={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function U(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var ze=U(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ve(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?Be(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var W=2,He=W/2;function Ue(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function We(e){return{x:e.x-He,y:e.y-He}}function Ge(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function Ke(e){return{x:Math.min(e.x,window.innerWidth-W),y:Math.min(e.y,window.innerHeight-W)}}function qe(e){var t=e.client,n=Ke(Ge(We(Ue(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:W,height:W})}function Je(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function Ye(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function Xe(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(Pe,`true`),ze()&&n.setAttribute(`popover`,`manual`);var r=qe({client:t});Object.assign(n.style,Ve(Ve({position:`fixed`},ze()?Re:{zIndex:Le}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},Je({clientRect:r}))),document.body.appendChild(n),ze()&&n.showPopover();var i=(0,L.bind)(window,{type:`pointermove`,listener:function(e){r=qe({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,Je({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),Ye({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,L.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function Ze(){var e=null;function t(){return e=null,(0,L.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=Xe({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}var Qe=U(function(){return navigator.userAgent.includes(`Firefox`)}),$e=U(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)});function et(e){return`nodeName`in e}function tt(e){return et(e)&&e.ownerDocument!==document}var nt={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};(function(){if(typeof window>`u`||!$e())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,L.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[nt.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[nt.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function rt(e){var t=e.dragLeave;return $e()?t.hasOwnProperty(nt.isLeavingWindow):!1}function it(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?$e()?rt({dragLeave:t}):r==null?!0:Qe()?tt(r):r instanceof HTMLIFrameElement:!1}function at(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function G(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var ot=n(function(e){return e()}),K=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function st(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),K.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;K.flush(),ot.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;ot(function(){K.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;K.flush(),ot.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var ct={isActive:!1};function lt(){return!ct.isActive}function ut(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function dt(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function ft(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,a=e.dispatchEvent;if(!lt())return;var o=mt({event:t,dragType:n,getDropTargetsOver:i});ct.isActive=!0;var s={current:o};pt({event:t,current:o.dropTargets});var c=st({source:n.payload,dispatchEvent:a,initial:o});function l(e){var t=dt({current:s.current.dropTargets,next:e.dropTargets});s.current=e,t&&c.dragUpdate({current:s.current})}function u(e){var t=G(e),r=i({target:Fe(e.target)?Ie({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:s.current.dropTargets});r.length&&(e.preventDefault(),pt({event:e,current:r})),l({dropTargets:r,input:t})}function d(){s.current.dropTargets.length&&l({dropTargets:[],input:s.current.input}),c.drop({current:s.current,updatedSourcePayload:null}),f()}function f(){ct.isActive=!1,p()}var p=(0,L.bindAll)(window,[{type:`dragover`,listener:function(e){u(e),c.drag({current:s.current})}},{type:`dragenter`,listener:u},{type:`dragleave`,listener:function(e){it({dragLeave:e})&&(l({input:s.current.input,dropTargets:[]}),n.startedFrom===`external`&&d())}},{type:`drop`,listener:function(e){if(s.current={dropTargets:s.current.dropTargets,input:G(e)},!s.current.dropTargets.length){d();return}e.preventDefault(),pt({event:e,current:s.current.dropTargets}),c.drop({current:s.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),f()}},{type:`dragend`,listener:function(e){s.current={dropTargets:s.current.dropTargets,input:G(e)},d()}}].concat(r(at({onDragEnd:d}))),{capture:!0});c.start({nativeSetDragImage:ut(t)})}function pt(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function mt(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=G(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var ht={canStart:lt,start:ft},gt=new Map;function _t(e){var t=e.typeKey,n=e.mount,r=gt.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return gt.set(t,i),i}function vt(e){var t=_t(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),gt.delete(e.typeKey))}}function yt(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function bt(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?xt(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function St(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Ct(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1
|
+
import{_ as e,b as t,c as n,h as r,u as i,x as a}from"./element-adapter-native-data-key-DrqJDAVH.js";import{r as o}from"./dom-DiTFTWeR.js";import{g as s,h as c,r as l}from"./ui-CTQoglp3.js";import{t as u}from"./motion-DI5H1Js0.js";import{n as d}from"./morph-Cq3V_23_.js";import{c as f,f as p,l as m,n as h,o as g,s as _}from"./codecs-CQ7olTJL.js";import{i as v,t as y}from"./alpine-machine-CE2UN4Qu.js";import{n as b}from"./dom-invalidation-Dw6clnS4.js";import{t as x}from"./focus-pk_lz9sg.js";import{t as S}from"./machine-CNnHDbyo.js";import{a as C,i as ee,n as te,o as ne,r as re,t as ie}from"./pdd-BG5sXFGF.js";import{R as w,y as ae}from"./common-CBK89mIt.js";var T=e=>e!==null&&Number.isInteger(e)&&e>0,E=4,D=(e,t)=>e===t||!!(e&&t&&e.destination.groupId===t.destination.groupId&&e.anchor?.id===t.anchor?.id&&e.anchor?.edge===t.anchor?.edge&&e.index===t.index),O=({point:e,start:t,end:n})=>{let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return Math.hypot(e.x-t.x,e.y-t.y);let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a));return Math.hypot(e.x-(t.x+o*r),e.y-(t.y+o*i))},k=e=>e.length===0?[]:[{anchor:{id:e[0].id,edge:`before`},index:0,distance:t=>Math.abs(t.clientY-e[0].rect.top)},...e.slice(1).map((t,n)=>{let r=(e[n].rect.bottom+t.rect.top)/2;return{anchor:{id:t.id,edge:`before`},index:n+1,distance:e=>Math.abs(e.clientY-r)}}),{anchor:{id:e.at(-1).id,edge:`after`},index:e.length,distance:t=>Math.abs(t.clientY-e.at(-1).rect.bottom)}],oe=(e,t)=>{if(e.length===0)return[];let n=e=>t===`rtl`?e.rect.right:e.rect.left,r=e=>t===`rtl`?e.rect.left:e.rect.right;return[{anchor:{id:e[0].id,edge:`before`},index:0,distance:t=>Math.abs(t.clientX-n(e[0]))},...e.slice(1).map((t,i)=>{let a=e[i],o=(r(a)+n(t))/2;return{anchor:{id:t.id,edge:`before`},index:i+1,distance:e=>Math.abs(e.clientX-o)}}),{anchor:{id:e.at(-1).id,edge:`after`},index:e.length,distance:t=>Math.abs(t.clientX-r(e.at(-1)))}]},se=({columns:e,direction:t,groupRect:n,items:r})=>{if(!T(e))throw TypeError(`Grid sortable groups require a positive integer columns value.`);if(r.length===0)return[];let i=e=>t===`rtl`?e.rect.right:e.rect.left,a=e=>t===`rtl`?e.rect.left:e.rect.right,o=t=>r.slice(t*e,(t+1)*e),s=e=>Math.min(...o(e).map(e=>e.rect.top)),c=e=>Math.max(...o(e).map(e=>e.rect.bottom)),l=(e,t,n,r)=>({anchor:n,index:r,distance:n=>O({point:{x:n.clientX,y:n.clientY},start:{x:e,y:s(t)},end:{x:e,y:c(t)}})}),u=(e,t,r)=>({anchor:t,index:r,distance:t=>O({point:{x:t.clientX,y:t.clientY},start:{x:n.left,y:e},end:{x:n.right,y:e}})}),d=[l(i(r[0]),0,{id:r[0].id,edge:`before`},0)];for(let t=1;t<r.length;t+=1){let n=r[t],o=r[t-1];if(t%e===0){let r=t/e;d.push(u((c(r-1)+s(r))/2,{id:n.id,edge:`before`},t))}else{let r=Math.floor(t/e);d.push(l((a(o)+i(n))/2,r,{id:n.id,edge:`before`},t))}}let f=r.length-1,p=r[f],m=Math.floor(f/e),h=r.length%e;if(h===0)d.push(u(c(m),{id:p.id,edge:`after`},r.length));else{let e=r[h],t=e===void 0?a(p):(a(p)+i(e))/2;d.push(l(t,m,{id:p.id,edge:`after`},r.length))}return d},A=(e,t)=>e.reduce((e,n)=>n.distance(t)<e.distance(t)?n:e),ce=e=>{if(e.items.length===0)return{destination:{groupId:e.groupId},anchor:null,index:0};let t=A(e.orientation===`horizontal`?oe(e.items,e.direction):e.orientation===`grid`?se(e):k(e.items),e.input);return{destination:{groupId:e.groupId},anchor:t.anchor,index:t.index}},le=e=>{if(e.items.length===0||e.orientation===`grid`)return ce(e);let t=e.orientation===`vertical`?e.input.clientY:e.input.clientX*(e.direction===`rtl`?-1:1),n=e.items.findIndex(({rect:n})=>{let r=e.orientation===`vertical`?n.top+n.height/2:(n.left+n.width/2)*(e.direction===`rtl`?-1:1);return t<r}),r=n<0?e.items.length:n,i=r===e.items.length?{id:e.items.at(-1).id,edge:`after`}:{id:e.items[r].id,edge:`before`};return{destination:{groupId:e.groupId},anchor:i,index:r}},ue=({placement:e,sourceId:t,sourceGroupId:n,itemIds:r})=>{if(n!==e.destination.groupId)return e;let i=r.indexOf(t);if(i<0)return e;let a=r.filter(e=>e!==t),o=Math.max(0,Math.min(a.length,e.index>i?e.index-1:e.index)),s=a.length===0?null:o===a.length?{id:a.at(-1),edge:`after`}:{id:a[o],edge:`before`};return{destination:e.destination,anchor:s,index:o}},de=(e,t)=>{let{groupRect:n,items:r,orientation:i,direction:a}=e;if(r.length===0||t.anchor===null)return i===`horizontal`?{x:a===`rtl`?n.right-E:n.left+E,y:n.top,width:0,height:n.height,kind:`inline-boundary`}:{x:n.left,y:n.top+E,width:n.width,height:0,kind:`block-boundary`};let o=t.index,s=o>0?r[o-1]:void 0,c=o<r.length?r[o]:void 0;if(i===`vertical`){let e=s&&c?(s.rect.bottom+c.rect.top)/2:c?c.rect.top-E:s.rect.bottom+E;return{x:n.left,y:e,width:n.width,height:0,kind:`block-boundary`}}let l=e=>a===`rtl`?e.rect.right:e.rect.left,u=e=>a===`rtl`?e.rect.left:e.rect.right;if(i===`horizontal`)return{x:s&&c?(u(s)+l(c))/2:c?l(c)+(a===`rtl`?E:-4):u(s)+(a===`rtl`?-4:E),y:n.top,width:0,height:n.height,kind:`inline-boundary`};let d=e.columns;if(!T(d))throw TypeError(`Grid sortable groups require a positive integer columns value.`);if(o>0&&o%d===0){let e=c?(s.rect.bottom+c.rect.top)/2:s.rect.bottom+E;return{x:n.left,y:e,width:n.width,height:0,kind:`block-boundary`}}let f;if(s&&c)f=(u(s)+l(c))/2;else if(c)f=l(c)+(a===`rtl`?E:-4);else{let e=r.length%d,t=e===0?void 0:r[e];f=t?(u(s)+l(t))/2:u(s)+(a===`rtl`?-4:E)}let p=Math.floor(Math.min(o,r.length-1)/d)*d,m=r.slice(p,p+d);return{x:f,y:Math.min(...m.map(e=>e.rect.top)),width:0,height:Math.max(...m.map(e=>e.rect.bottom))-Math.min(...m.map(e=>e.rect.top)),kind:`inline-boundary`}};function fe(e){var t=e.list,n=e.startIndex,r=e.finishIndex;if(n===-1||r===-1)return Array.from(t);var i=Array.from(t),o=i.splice(n,1),s=a(o,1)[0];return i.splice(r,0,s),i}var j=(e,t,n)=>({groupId:e,id:t.id,x:n.left-t.rect.left,y:n.top-t.rect.top}),M=({x:e,y:t})=>e!==0||t!==0,N=(e,t,n)=>({left:e.left+t,top:e.top+n,right:e.right+t,bottom:e.bottom+n,width:e.width,height:e.height}),pe=e=>{let{items:t,orientation:n,direction:r,columns:i}=e,a=t.at(-1);if(!a)return null;let o=t.at(-2);if(n===`vertical`){let e=o?a.rect.top-o.rect.top:a.rect.height+8;return N(a.rect,0,e)}if(n===`horizontal`){let e=o?a.rect.left-o.rect.left:(a.rect.width+8)*(r===`rtl`?-1:1);return N(a.rect,e,0)}if(i&&t.length>=i){let e=t[t.length-i];return N(e.rect,0,a.rect.top-e.rect.top||a.rect.height+8)}let s=o?a.rect.left-o.rect.left:(a.rect.width+8)*(r===`rtl`?-1:1);return N(a.rect,s,0)},P=e=>{let t=pe(e);return t?[...e.items.map(({rect:e})=>e),t]:[]},me=({source:e,placement:t,sourceLayout:n,destinationLayout:r=n})=>{if(!r)return null;let i=Math.max(0,Math.min(r.items.length,t.index));return e.groupId===r.groupId&&n?n.items[Math.min(i,n.items.length-1)]?.rect??r.groupRect:P(r)[i]??r.groupRect},he=({source:e,placement:t,sourceLayout:n,destinationLayout:r=n})=>{if(!r)return[];let i=Math.max(0,Math.min(r.items.length,t.index));if(e.groupId===r.groupId&&n){let t=n.items.findIndex(({id:t})=>t===e.id);if(t<0)return[];let r=fe({list:[...n.items],startIndex:t,finishIndex:i}),a=new Map;return r.forEach((e,t)=>{let r=e.id,i=n.items[t]?.rect;i&&!a.has(r)&&a.set(r,i)}),n.items.map(e=>{let t=a.get(e.id);return t?j(n.groupId,e,t):null}).filter(e=>e!==null).filter(M)}let a=P(r),o=r.items.map((e,t)=>j(r.groupId,e,a[t<i?t:t+1])).filter(M);if(!n||e.groupId===null)return o;let s=n.items.findIndex(({id:t})=>t===e.id);if(s<0)return o;let c=n.items[s],l=j(n.groupId,c,a[i]??r.groupRect);return M(l)&&o.push(l),n.items.slice(s+1).forEach((e,t)=>{o.push(j(n.groupId,e,n.items[s+t].rect))}),o},ge=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:px)?$/,F=(e,t,n,r,i)=>e===r?t:e===`center`?t-n/2:e===i?t-n:ge.test(e)?t+Number.parseFloat(e):null,I=({value:e,input:t,initialInput:n,sourceRect:r,previewSize:i})=>{let a={x:t.clientX-(n.clientX-r.left),y:t.clientY-(n.clientY-r.top)},o=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(o.length===0||o.length===1&&o[0]===`preserve`||o.length!==2)return a;let s=F(o[0],t.clientX,i.width,`left`,`right`),c=F(o[1],t.clientY,i.height,`top`,`bottom`);return s===null||c===null?a:{x:s,y:c}},_e=e=>{e.setAttribute(`x-ignore`,``),[e,...e.querySelectorAll(`*`)].forEach(e=>{e.removeAttribute(`id`),(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&(e.disabled=!0),(e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&(e.disabled=!0)})},ve=(e,t)=>{let n=[e,...e.querySelectorAll(`input, textarea, select`)],r=[t,...t.querySelectorAll(`input, textarea, select`)];n.forEach((e,t)=>{let n=r[t];e instanceof HTMLInputElement&&n instanceof HTMLInputElement?(n.value=e.value,n.checked=e.checked):e instanceof HTMLTextAreaElement&&n instanceof HTMLTextAreaElement?n.value=e.value:e instanceof HTMLSelectElement&&n instanceof HTMLSelectElement&&(n.selectedIndex=e.selectedIndex)})},ye=e=>({x:e.left,y:e.top,width:e.width,height:e.height}),be=({source:e,input:t,preview:n,previewPosition:r=`preserve`,opacity:i=.92,color:a=`neutral`,interaction:o=`edge`})=>{let s=e.getBoundingClientRect(),c=document.createElement(`div`),l=document.createElement(`div`),d=document.createElement(`div`),f=n?.content.firstElementChild?.cloneNode(!0),p=f instanceof HTMLElement,m=p?f:e.cloneNode(!0);p||ve(e,m),_e(m),c.setAttribute(`data-ui-sortable-overlay`,``),c.setAttribute(`popover`,`manual`),l.setAttribute(`data-ui-sortable-ghost-positioner`,``),d.setAttribute(`data-ui-sortable-ghost`,``),d.setAttribute(`aria-hidden`,`true`),d.setAttribute(`inert`,``),p||(d.setAttribute(`data-ui-sortable-default-preview`,``),d.setAttribute(`data-ui-selection-color`,``),d.dataset.color=a,d.dataset.uiInteraction=o,d.dataset.selected=`true`,d.dataset.uiSurface=`+1`,d.dataset.uiElevation=`2`);let h=e.closest(`[data-theme], .dark, .light`);h?.classList.contains(`dark`)&&c.classList.add(`dark`),h?.classList.contains(`light`)&&c.classList.add(`light`),h?.dataset.theme&&(c.dataset.theme=h.dataset.theme),Object.assign(c.style,{position:`fixed`,inset:`0`,width:`100vw`,height:`100vh`,maxWidth:`none`,maxHeight:`none`,margin:`0`,padding:`0`,border:`0`,background:`transparent`,overflow:`clip`,contain:`strict`,zIndex:`2147483647`,pointerEvents:`none`}),Object.assign(l.style,{position:`absolute`,left:`0`,top:`0`,width:p?`max-content`:`${s.width}px`,height:p?`max-content`:`${s.height}px`,pointerEvents:`none`}),Object.assign(d.style,{width:p?`max-content`:`100%`,height:p?`max-content`:`100%`,opacity:`${i}`,pointerEvents:`none`,...p?{}:{overflow:`hidden`,borderRadius:`var(--radius-overlay-sm)`}}),d.append(m),l.append(d),c.append(l),document.body.append(c),c.showPopover?.();let g=l.getBoundingClientRect(),_=p?{width:g.width,height:g.height}:{width:s.width,height:s.height},v=e=>I({value:r,input:e,initialInput:t,sourceRect:s,previewSize:_}),y=e=>I({value:`preserve`,input:e,initialInput:t,sourceRect:s,previewSize:{width:s.width,height:s.height}}),b=v(t),x=u.createController({values:{x:{initial:b.x,transition:u.roles.layout},y:{initial:b.y,transition:u.roles.layout}},style:({x:e,y:t})=>({transform:`translate3d(${e}px, ${t}px, 0)`})});return x.mount(l),{positioner:l,visual:d,frame:()=>({...x.current(),..._}),projectedFrame:e=>({...v(e),..._}),projectedSourceFrame:e=>({...y(e),width:s.width,height:s.height}),move(e){x.set(v(e))},async finish(e){e&&await x.animate({x:e.x,y:e.y}).finished},remove:()=>{x.destroy(),c.remove()}}},L=t(),xe=1e3,Se=null,R=`1px`,Ce={width:R,height:R,padding:`0`,position:`absolute`,border:`0`,clip:`rect(${R}, ${R}, ${R}, ${R})`,overflow:`hidden`,whiteSpace:`nowrap`,marginTop:`-${R}`,pointerEvents:`none`};function we(){var e=document.createElement(`div`);return e.setAttribute(`role`,`status`),Object.assign(e.style,Ce),document.body.append(e),e}function Te(){return Se===null&&(Se=we()),Se}var z=null;function Ee(){z!==null&&clearTimeout(z),z=null}function De(e){Te(),Ee(),z=setTimeout(function(){z=null;var t=Te();t.textContent=e},xe)}var Oe=new WeakMap,B=(e,t)=>`${e}\u0000${t}`,ke=(e,t)=>{let n={destination:Object.freeze({...t.destination}),anchor:t.anchor===null?null:Object.freeze({...t.anchor}),index:t.index};return e.operation===`insert`?Object.freeze({operation:`insert`,source:Object.freeze({...e}),...n}):Object.freeze({operation:`move`,source:Object.freeze({...e}),...n})},Ae=()=>{let e=new Map,t=new Map,n=(e,t,n,r,i)=>{let a=t,o=!0,s=e.get(a);if(s&&(s.element.isConnected||!r.element.isConnected))throw Error(`Duplicate sortable ${i} identity: ${a.replace(`\0`,`/`)}`);return e.set(a,r),Object.assign(()=>{o&&(o=!1,e.get(a)===r&&e.delete(a))},{refresh:()=>{if(!o)return;let t=n();if(t===a)return;let s=e.get(t);if(s&&s!==r&&(s.element.isConnected||!r.element.isConnected))throw Error(`Duplicate sortable ${i} identity: ${t.replace(`\0`,`/`)}`);e.get(a)===r&&e.delete(a),e.set(t,r),a=t}})},r=(t,n)=>e.get(B(t,n))??null,i=(e,n)=>t.get(B(e,n))??null,a=(e,t,n=null)=>{let a=r(e.scopeId,t),o=i(e.scopeId,e.id);if(!a||!o||o.isDisabled())return!1;let s=a.getGroup();if(s.disabled||s.readOnly||s.orientation===`grid`&&!T(s.columns)||!s.accepts.includes(e.type))return!1;let c=a.getItemIds().filter(n=>e.operation!==`move`||e.groupId!==t||n!==e.id),l=Object.freeze({source:e,destination:s,itemIds:Object.freeze(c),input:n===null?null:Object.freeze({...n})});return a.canDrop?.(l)!==!1},s=(e,t)=>{let n=r(e.scopeId,t.destination.groupId);if(!n)return null;let i=n.getItemIds(),a=e.operation===`move`&&e.groupId===t.destination.groupId?i.filter(t=>t!==e.id):[...i];if(t.anchor!==null&&!a.includes(t.anchor.id))return null;let o=t.anchor===null?0:a.indexOf(t.anchor.id)+ +(t.anchor.edge===`after`);return{originalIds:i,placement:{destination:t.destination,anchor:t.anchor,index:o}}},c=(e,t,n)=>e.operation===`move`&&e.groupId===n.destination.groupId&&t.indexOf(e.id)===n.index,l=(e,t)=>{let n=s(e,t);return n!==null&&c(e,n.originalIds,n.placement)},u=(e,t,n=null)=>{let i=r(e.scopeId,t.destination.groupId);if(!i||!a(e,t.destination.groupId,n))return null;let l=i.getGroup(),u=s(e,t);if(!u||c(e,u.originalIds,u.placement))return null;let d=ke(e,u.placement),f=!1;return Object.freeze({placement:u.placement,commit:()=>{f||(f=!0,o({el:i.element,name:`ui:sortable-drop`,composed:!0,detail:d}),e.label&&l.label&&De(`${e.label} moved to ${l.label}.`))}})},d=(e,t,n=null)=>{let r=u(e,t,n);return r?(r.commit(),!0):!1},f=(e,t)=>{let n=i(t.scope,t.sourceId);if(!n)return!1;let r=n.getSource(),a=t.destinationGroupId??r.groupId;return!a||t.anchorId===t.sourceId?!1:d(r,{destination:{groupId:a},anchor:{id:t.anchorId,edge:e}})},p=(e,t)=>{let n=i(t.scope,t.sourceId),a=r(t.scope,t.destinationGroupId);if(!n||!a)return!1;let o=n.getSource(),s=a.getItemIds().filter(e=>o.groupId!==t.destinationGroupId||e!==o.id),c=s.length===0?null:e===`start`?{id:s[0],edge:`before`}:{id:s.at(-1),edge:`after`};return d(o,{destination:{groupId:t.destinationGroupId},anchor:c})},m={registerGroup:t=>{let r=t.getGroup();return n(e,B(r.scopeId,r.id),()=>{let e=t.getGroup();return B(e.scopeId,e.id)},t,`group`)},registerSource:e=>{let r=e.getSource();return n(t,B(r.scopeId,r.id),()=>{let t=e.getSource();return B(t.scopeId,t.id)},e,`source`)},group:r,source:i,canDrop:a,isNoop:l,emitDrop:d,moveBefore:e=>f(`before`,e),moveAfter:e=>f(`after`,e),moveToStart:e=>p(`start`,e),moveToEnd:e=>p(`end`,e)};return Oe.set(m,u),m},je=(e,t,n,r=null)=>Oe.get(e)?.(t,n,r)??null,V=`--ui-sortable-drag-cursor`,H=`data-ui-sortable-dragging`,Me=e=>{let t=document.documentElement,n=t.getAttribute(H),r=t.style.getPropertyValue(V);return t.setAttribute(H,``),t.style.setProperty(V,e.trim()||`default`),()=>{n===null?t.removeAttribute(H):t.setAttribute(H,n),r?t.style.setProperty(V,r):t.style.removeProperty(V)}},Ne=({props:e,effects:t})=>S({type:`parallel`,on:{PROPS_CHANGED:{reduce:`props`,effects:`reconcile`},DOM_INVALIDATED:{effects:`reconcile`}},states:{interaction:{initial:`idle`,on:{POINTER_MOVED:{reduce:`pointer`}},states:{idle:{on:{START:{target:`starting`,reduce:`start`}}},starting:{on:{STARTING_DONE:{target:`dragging`},END:{target:`ending`,reduce:`data`}}},dragging:{on:{END:{target:`ending`,reduce:`data`}}},ending:{on:{ENDING_DONE:{target:`idle`,effects:`complete`}}}}},layout:{initial:`inactive`,states:{inactive:{on:{START:{target:`calculating`}}},calculating:{entry:`resolvePlacement`,on:{POINTER_MOVED:{effects:`resolvePlacement`},LAYOUT_PROPOSED:{target:`syncing`,reduce:`data`},END:{target:`inactive`}}},syncing:{on:{RECTS_SYNCED:{target:`calculating`,effects:`synced`},END:{target:`inactive`,effects:`synced`}}}}}}},{props:e,context:{data:{},pointer:null},reducers:{start:({event:e})=>({context:{data:e.data,pointer:null}}),data:({context:e,event:t})=>({context:{...e,data:t.data}}),pointer:({context:e,event:t})=>({context:{...e,pointer:t.pointer}}),props:({context:e,event:t})=>({context:e,props:t.props})},effects:t}),Pe=`data-pdnd-honey-pot`;function Fe(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function Ie(e){var t=document.elementsFromPoint(e.x,e.y),n=a(t,2),r=n[0],i=n[1];return r?Fe(r)?i??null:r:null}var Le=2147483647,Re={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function U(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var ze=U(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ve(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?Be(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var W=2,He=W/2;function Ue(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function We(e){return{x:e.x-He,y:e.y-He}}function Ge(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function Ke(e){return{x:Math.min(e.x,window.innerWidth-W),y:Math.min(e.y,window.innerHeight-W)}}function qe(e){var t=e.client,n=Ke(Ge(We(Ue(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:W,height:W})}function Je(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function Ye(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function Xe(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(Pe,`true`),ze()&&n.setAttribute(`popover`,`manual`);var r=qe({client:t});Object.assign(n.style,Ve(Ve({position:`fixed`},ze()?Re:{zIndex:Le}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},Je({clientRect:r}))),document.body.appendChild(n),ze()&&n.showPopover();var i=(0,L.bind)(window,{type:`pointermove`,listener:function(e){r=qe({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,Je({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),Ye({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,L.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function Ze(){var e=null;function t(){return e=null,(0,L.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=Xe({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}var Qe=U(function(){return navigator.userAgent.includes(`Firefox`)}),$e=U(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)});function et(e){return`nodeName`in e}function tt(e){return et(e)&&e.ownerDocument!==document}var nt={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};(function(){if(typeof window>`u`||!$e())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,L.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[nt.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[nt.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function rt(e){var t=e.dragLeave;return $e()?t.hasOwnProperty(nt.isLeavingWindow):!1}function it(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?$e()?rt({dragLeave:t}):r==null?!0:Qe()?tt(r):r instanceof HTMLIFrameElement:!1}function at(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function G(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var ot=n(function(e){return e()}),K=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function st(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),K.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;K.flush(),ot.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;ot(function(){K.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;K.flush(),ot.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var ct={isActive:!1};function lt(){return!ct.isActive}function ut(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function dt(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function ft(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,a=e.dispatchEvent;if(!lt())return;var o=mt({event:t,dragType:n,getDropTargetsOver:i});ct.isActive=!0;var s={current:o};pt({event:t,current:o.dropTargets});var c=st({source:n.payload,dispatchEvent:a,initial:o});function l(e){var t=dt({current:s.current.dropTargets,next:e.dropTargets});s.current=e,t&&c.dragUpdate({current:s.current})}function u(e){var t=G(e),r=i({target:Fe(e.target)?Ie({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:s.current.dropTargets});r.length&&(e.preventDefault(),pt({event:e,current:r})),l({dropTargets:r,input:t})}function d(){s.current.dropTargets.length&&l({dropTargets:[],input:s.current.input}),c.drop({current:s.current,updatedSourcePayload:null}),f()}function f(){ct.isActive=!1,p()}var p=(0,L.bindAll)(window,[{type:`dragover`,listener:function(e){u(e),c.drag({current:s.current})}},{type:`dragenter`,listener:u},{type:`dragleave`,listener:function(e){it({dragLeave:e})&&(l({input:s.current.input,dropTargets:[]}),n.startedFrom===`external`&&d())}},{type:`drop`,listener:function(e){if(s.current={dropTargets:s.current.dropTargets,input:G(e)},!s.current.dropTargets.length){d();return}e.preventDefault(),pt({event:e,current:s.current.dropTargets}),c.drop({current:s.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),f()}},{type:`dragend`,listener:function(e){s.current={dropTargets:s.current.dropTargets,input:G(e)},d()}}].concat(r(at({onDragEnd:d}))),{capture:!0});c.start({nativeSetDragImage:ut(t)})}function pt(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function mt(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=G(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var ht={canStart:lt,start:ft},gt=new Map;function _t(e){var t=e.typeKey,n=e.mount,r=gt.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return gt.set(t,i),i}function vt(e){var t=_t(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),gt.delete(e.typeKey))}}function yt(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function bt(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?xt(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function St(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Ct(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Ct(e,t){if(e){if(typeof e==`string`)return wt(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wt(e,t):void 0}}function wt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tt(e){return e.slice(0).reverse()}function Et(e){var t=e.typeKey,n=e.defaultDropEffect,i=new WeakMap,a=`data-drop-target-for-${t}`,o=`[${a}]`;function s(e){return i.set(e.element,e),function(){return i.delete(e.element)}}function c(e){return U(yt(bt(e.element,{attribute:a,value:`true`}),s(e)))}function l(e){var t=e.source,a=e.target,s=e.input,c=e.result,u=c===void 0?[]:c;if(a==null)return u;if(!(a instanceof Element))return a instanceof Node?l({source:t,target:a.parentElement,input:s,result:u}):u;var d=a.closest(o);if(d==null)return u;var f=i.get(d);if(f==null)return u;var p={input:s,source:t,element:f.element};if(f.canDrop&&!f.canDrop(p))return l({source:t,target:f.element.parentElement,input:s,result:u});var m=f.getData?.call(f,p)??{},h=f.getDropEffect?.call(f,p)??n,g={data:m,element:f.element,dropEffect:h,isActiveDueToStickiness:!1};return l({source:t,target:f.element.parentElement,input:s,result:[].concat(r(u),[g])})}function u(e){var t=e.eventName,n=e.payload,r=St(n.location.current.dropTargets),a;try{for(r.s();!(a=r.n()).done;){var o,s=a.value,c=i.get(s.element),l=q(q({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){r.e(e)}finally{r.f()}}var d={onGenerateDragPreview:u,onDrag:u,onDragStart:u,onDrop:u,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),r=new Set,a=St(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;r.add(c.element);var l=i.get(c.element),u=n.has(c.element),d=q(q({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=St(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!r.has(_.element)){var v=q(q({},t),{},{self:_}),y=i.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function f(e){d[e.eventName](e)}function p(e){var t=e.source,n=e.target,r=e.input,a=e.current,o=l({source:t,target:n,input:r});if(o.length>=a.length)return o;for(var s=Tt(a),c=Tt(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=c[d];if(m!=null){u.push(m);continue}var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=i.get(p.element);if(!_)break;var v={input:r,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(q(q({},p),{},{isActiveDueToStickiness:!0}))}return Tt(u)}return{dropTargetForConsumers:c,getIsOver:p,dispatchEvent:f}}function Dt(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Ot(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Ot(e,t){if(e){if(typeof e==`string`)return kt(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kt(e,t):void 0}}function kt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jt(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?At(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Mt(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=jt({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return U(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=Dt(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function Nt(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=Mt(),s=Et({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;ht.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:ht.canStart,start:l})}return vt({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var Pt=U(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),Ft=`pdnd:android-fallback`,It=`text/plain`,Lt=`application/vnd.pdnd`,Rt=new WeakMap,zt=Ze(),Bt=Nt({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return yt(zt.bindEvents(),(0,L.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=Rt.get(n);if(r){var i=G(t),o={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(o)){t.preventDefault();return}if(r.dragHandle){var s=Ie({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(s)){t.preventDefault();return}}var c=r.getInitialDataForExternal?.call(r,o)??null;if(c)for(var l=0,u=Object.entries(c);l<u.length;l++){var d=a(u[l],2),f=d[0],p=d[1];t.dataTransfer.setData(f,p??``)}Pt()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(It,Ft),t.dataTransfer.setData(Lt,``);var m={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,o)??{}},startedFrom:`internal`};e.start({event:t,dragType:m})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=Rt.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:zt.getOnPostDispatch()});Bt.dropTarget;var Vt=Bt.monitor,J=new Map,Y=new Set;function Ht(e){Ut(e);var t=J.get(e);if(t)return t;var n={timeOfEngagementStart:Date.now()};return J.set(e,n),n}function Ut(e){Y.add(e)}function Wt(e){Y.clear(),e(),J.forEach(function(e,t){Y.has(t)||J.delete(t)}),Y.clear()}function Gt(){J.clear()}var Kt=new Map;function qt(e){var t=Kt.get(e);if(t)return t;var n=Jt(e);return Kt.set(e,n),n}function Jt(e){var t={type:`idle`},n=[];function r(e){if(t.type===`running`){var i=e-t.timeLastFrameFinished,a=t.latestArgs,o=Ie({x:a.location.current.input.clientX,y:a.location.current.input.clientY});Wt(function(){n.forEach(function(e){return e({underUsersPointer:o,latestArgs:a,timeSinceLastFrame:i})})}),t.timeLastFrameFinished=e,t.frameId=requestAnimationFrame(r)}}function i(){t.type!==`idle`&&(cancelAnimationFrame(t.frameId),Gt(),t={type:`idle`})}function a(e){t.type===`idle`&&(t={type:`initializing`,latestArgs:e,frameId:requestAnimationFrame(function(e){t.type===`initializing`&&(t={type:`running`,timeLastFrameFinished:e,latestArgs:t.latestArgs,frameId:requestAnimationFrame(r)})})})}function o(e){if(t.type===`idle`){a(e);return}t.latestArgs=e}return e({onDragStart:a,onDropTargetChange:o,onDrag:o,onDrop:i}),{onFrame:function(e){n.push(e)}}}var Yt=`data-auto-scrollable`,Xt=`[${Yt}="true"]`;function Zt(e){return e.setAttribute(Yt,`true`),function(){return e.removeAttribute(Yt)}}function Qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $t(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?Qt(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var en={startHitboxAtPercentageRemainingOfElement:{top:.25,right:.25,bottom:.25,left:.25},maxScrollAtPercentageRemainingOfHitbox:{top:.5,right:.5,bottom:.5,left:.5},timeDampeningDurationMs:400,maxMainAxisHitboxSize:180},tn={standard:900,fast:1500};function nn(e){return $t($t({},en),{},{maxPixelScrollPerSecond:tn[e?.maxScrollSpeed??`standard`]})}var rn={top:function(e){return e.scrollTop>0},right:function(e){return Math.ceil(e.scrollLeft)+e.clientWidth<e.scrollWidth},bottom:function(e){return Math.ceil(e.scrollTop)+e.clientHeight<e.scrollHeight},left:function(e){return e.scrollLeft>0}},an=[`top`,`right`,`bottom`,`left`],on={top:`vertical`,right:`horizontal`,bottom:`vertical`,left:`horizontal`},sn={start:`top`,end:`bottom`,point:`y`,size:`height`},cn={start:`left`,end:`right`,point:`x`,size:`width`},ln={vertical:{mainAxis:sn,crossAxis:cn},horizontal:{mainAxis:cn,crossAxis:sn}},un={top:`start`,right:`end`,bottom:`end`,left:`start`};function X(t){var n=t.edge,r=t.axis;return function(t){var i=t.clientRect,a=t.config,o=ln[r],s=o.mainAxis,c=o.crossAxis,l=un[n],u=Math.min(a.startHitboxAtPercentageRemainingOfElement[n]*i[s.size],a.maxMainAxisHitboxSize);return DOMRect.fromRect(e(e(e(e({},s.point,l===`start`?i[s.point]:i[s.point]+i[s.size]-u),c.point,i[c.point]),s.size,u),c.size,i[c.size]))}}var dn={top:X({axis:`vertical`,edge:`top`}),right:X({axis:`horizontal`,edge:`right`}),bottom:X({axis:`vertical`,edge:`bottom`}),left:X({axis:`horizontal`,edge:`left`})};function fn(e){var t=e.startOfRange,n=e.endOfRange,r=e.value;if(!(t<n)||r<t)return 0;if(r>n)return 1;var i=n-t;return(r-t)/i}function pn(e){var t=e.timeSinceLastFrame,n=e.config,r=n.maxPixelScrollPerSecond/1e3,i=Math.ceil(r*t),a=n.maxPixelScrollPerSecond/60;return Math.min(i,a)}function mn(e){var t=e.client,n=e.axis,r=e.edge,i=e.hitbox,a=e.config,o=ln[n].mainAxis,s=un[r],c=i[o.size]*a.maxScrollAtPercentageRemainingOfHitbox[r];return s===`end`?fn({startOfRange:i[o.start],endOfRange:i[o.end]-c,value:t[o.point]}):1-fn({startOfRange:i[o.start]+c,endOfRange:i[o.end],value:t[o.point]})}function Z(e){var t=e.client,n=e.timeSinceLastFrame,r=e.engagement,i=e.axis,a=e.hitbox,o=e.edge,s=e.isDistanceDampeningEnabled,c=e.config,l=pn({timeSinceLastFrame:n,config:c}),u=(s?mn({client:t,edge:o,hitbox:a,axis:i,config:c}):1)*fn({startOfRange:r.timeOfEngagementStart,endOfRange:r.timeOfEngagementStart+c.timeDampeningDurationMs,value:Date.now()}),d=Math.max(l*u,1);return un[o]===`end`?d:-1*d}function hn(e,t){return t===`all`||e===t}function gn(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function _n(e){return e.getBoundingClientRect()}function vn(e){var t=e.element,n=e.input,r=e.timeSinceLastFrame,i=e.engagement,a=e.config,o=e.allowedAxis,s=e.getRect,c=s===void 0?_n:s,l={x:n.clientX,y:n.clientY},u=c(t),d=an.reduce(function(e,n){var r=dn[n]({clientRect:u,config:a}),i=on[n];return!hn(i,o)||!gn({client:l,clientRect:r})||!rn[n](t)||e.set(n,{edge:n,hitbox:r}),e},new Map);return{left:function(){var e=`horizontal`,t=d.get(`left`);if(t)return Z({client:l,edge:t.edge,hitbox:t.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a});var n=d.get(`right`);return n?Z({client:l,edge:n.edge,hitbox:n.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a}):0}(),top:function(){var e=`vertical`,t=d.get(`bottom`);if(t)return Z({client:l,edge:t.edge,hitbox:t.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a});var n=d.get(`top`);return n?Z({client:l,edge:n.edge,hitbox:n.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a}):0}()}}function yn(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=bn(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function bn(e,t){if(e){if(typeof e==`string`)return xn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xn(e,t):void 0}}function xn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sn(e){return!!(e.top||e.left)}function Cn(e){var t=e.target,n=e.input,r=e.source,i=e.findEntry,a=e.timeSinceLastFrame,o=e.available,s=o===void 0?{top:!0,left:!0}:o;if(!Sn(s)||!t)return s;var c=t.closest(Xt);if(!c)return s;var l=i(c);if(!l)return s;function u(){return Cn({target:c?.parentElement??null,findEntry:i,source:r,timeSinceLastFrame:a,input:n,available:s})}var d={input:n,source:r,element:c};if(l.canScroll&&!l.canScroll(d))return u();var f=Ht(c),p=nn(l.getConfiguration?.call(l,d)),m=vn({element:c,engagement:f,input:n,timeSinceLastFrame:a,allowedAxis:l.getAllowedAxis?.call(l,d)??`all`,config:p}),h={top:0,left:0};return s.top&&m.top!==0&&(h.top=m.top,s.top=!1),s.left&&m.left!==0&&(h.left=m.left,s.left=!1),(h.top!==0||h.left!==0)&&c.scrollBy(h),u()}function wn(e){var t=e.input,n=e.timeSinceLastFrame,r=e.available,i=e.source,a=e.entries,o=document.documentElement,s={input:t,source:i,element:o},c=yn(a),l;try{for(c.s();!(l=c.n()).done;){var u=l.value;if(!u.canScroll||u.canScroll(s)){var d=vn({element:o,engagement:Ht(o),input:t,config:nn(u.getConfiguration?.call(u,s)),allowedAxis:u.getAllowedAxis?.call(u,s)??`all`,getRect:function(e){return DOMRect.fromRect({y:0,x:0,width:e.clientWidth,height:e.clientHeight})},timeSinceLastFrame:n}),f={top:r.top?d.top:0,left:r.left?d.left:0};(f.top!==0||f.left!==0)&&o.scrollBy(f);break}}}catch(e){c.e(e)}finally{c.f()}}function Tn(e){var t=e.input,n=e.findEntry,r=e.timeSinceLastFrame,i=e.source,a=e.getWindowScrollEntries,o=e.underUsersPointer,s=Cn({target:o,timeSinceLastFrame:r,input:t,source:i,findEntry:n});Sn(s)&&wn({input:t,source:i,entries:a(),timeSinceLastFrame:r,available:s})}function En(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dn(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?En(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function On(e){var t=e.monitor,n=new Map,r=new Set;function i(e){return n.set(e.element,e),U(yt(Zt(e.element),function(){return n.delete(e.element)}))}function a(){var e=Dn({},arguments.length>0&&arguments[0]!==void 0?arguments[0]:{});r.add(e);function t(){r.delete(e)}return U(t)}function o(e){return n.get(e)??null}function s(){return Array.from(r)}function c(e){var t=e.latestArgs,n=e.underUsersPointer,r=e.timeSinceLastFrame;Tn({input:t.location.current.input,source:t.source,findEntry:o,underUsersPointer:n,timeSinceLastFrame:r,getWindowScrollEntries:s})}return qt(t).onFrame(c),{autoScroll:i,autoScrollWindow:a}}var kn=On({monitor:Vt}),An=kn.autoScroll,jn=kn.autoScrollWindow;function Mn(e){e.defaultPrevented||(e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.preventDefault())}var Nn=null;function Pn(){Q(),Nn=(0,L.bindAll)(window,[{type:`dragover`,listener:Mn},{type:`dragenter`,listener:Mn},{type:`drop`,listener:function(e){e.preventDefault(),Q()}},{type:`dragend`,listener:Q}].concat(r(i({onDragEnd:Q}))),{capture:!1})}function Q(){var e;(e=Nn)==null||e(),Nn=null}function Fn(){if(window.event?.type===`drop`){var e;(e=window.event)==null||e.preventDefault()}Q()}var In={start:Pn,stop:Fn},$=`[data-ui-sortable]`,Ln=`[data-ui-sortable-item]`,Rn=`[data-ui-sortable-source]`,zn=`[x-ui-sortable\\:handle], [data-ui-sortable-handle]`,Bn=`[x-ui-sortable\\:preview], [data-ui-sortable-preview]`,Vn=`[x-ui-sortable\\:indicator], [data-ui-sortable-indicator]`,Hn=`ui-sortable`,Un=2,Wn=`a, button, input, select, textarea, summary, [contenteditable], [role="button"], [role="link"]`,Gn={sortableScope:p.trim,sortableId:p.trim,orientation:m([`vertical`,`horizontal`,`grid`],`vertical`),columns:f.default(0),accepts:_.array([]),disabled:h,readonly:h,feedback:m([`indicator`,`reorder`],`indicator`),sourceOpacity:f.clamp(0,1).default(.4),ghostOpacity:f.clamp(0,1).default(.92),dragCursor:p.trim.default(`default`),previewPosition:p.trim.default(`preserve`),color:m(w,`neutral`),interaction:m(ae,`edge`),label:p.trim,sortableData:_.object({})},Kn={sortableScope:p.trim,sortableId:p.trim,sortableType:p.trim,label:p.trim,disabled:h,sortableData:_.object({}),sourceOpacity:f.clamp(0,1).default(.4),ghostOpacity:f.clamp(0,1).default(.92),dragCursor:p.trim.default(`default`),previewPosition:p.trim.default(`12px 12px`),color:m(w,`neutral`),interaction:m(ae,`edge`)},qn=[v({name:`starting`,state:`interaction.starting`,project:({context:e})=>e.data,onDone:`STARTING_DONE`,onError:`STARTING_DONE`}),v({name:`placing`,state:`layout.syncing`,project:({context:e})=>e.data,onDone:`RECTS_SYNCED`,onError:`RECTS_SYNCED`}),v({name:`ending`,state:`interaction.ending`,project:({context:e})=>e.data,onDone:`ENDING_DONE`,onError:`ENDING_DONE`})],Jn=e=>queueMicrotask(e),Yn=(e,t)=>{let n=0,r=new WeakMap,i=new Set,a=new WeakMap,l=null,f=0,p=null,m=0,h=null,_=()=>(m+=1,h??=jn(),()=>{--m,m===0&&(h?.(),h=null)}),v=(e,t)=>e.closest(t),S=e=>[...e.querySelectorAll(Ln)].filter(t=>v(t.parentElement??t,$)===e),w=(e,t=e.dataset.sortableId)=>c(e,t)??``,ae=e=>{let t=e.group(),n=S(e.el);return{controller:e,translateBaselines:new Map(n.map(e=>[w(e),e.style.translate])),layout:{groupId:t.id,orientation:t.orientation,direction:getComputedStyle(e.el).direction===`rtl`?`rtl`:`ltr`,columns:t.columns,groupRect:e.el.getBoundingClientRect(),items:n.map(e=>({id:w(e),rect:e.getBoundingClientRect()}))}}},E=e=>{let t=e.controller.group(),n=e.controller.el.getBoundingClientRect(),r=n.left-e.layout.groupRect.left,i=n.top-e.layout.groupRect.top,a=e=>({left:e.left+r,right:e.right+r,top:e.top+i,bottom:e.bottom+i,width:e.width,height:e.height});return{...e.layout,orientation:t.orientation,columns:t.columns,groupRect:n,items:e.layout.items.map(e=>({...e,rect:a(e.rect)}))}},O=(e,t,n)=>{if(t.target===n)return null;let r=p;if(!r)return null;let i=t.target,a=t.handle!==null;t.target=n;let o=u(e).animate({translate:a?n||`none`:[i||`none`,n||`none`]}).role(`layout`).play();return t.handle=o,o.finished.then(()=>{p===r&&t.handle===o&&(t.handle=null,e.style.translate=t.target,e.getBoundingClientRect(),t.target===t.baseline&&(e.removeAttribute(`data-reordering`),r.projections.delete(e)))}),o},k=(e=!1)=>{let t=p;if(t){if(t.projections.forEach((t,n)=>{if(e){let e=t.handle;t.handle=null,e?.stop(),u.stop(n),n.style.translate=t.baseline}else O(n,t,t.baseline);n.removeAttribute(`data-reordering`)}),e){t.projections.clear();let e=()=>{t.layouts.forEach(({controller:e,translateBaselines:t})=>{S(e.el).forEach(e=>{let n=t.get(w(e));n!==void 0&&(u.stop(e),e.getAnimations().forEach(e=>{let t=e.effect;t instanceof KeyframeEffect&&t.getKeyframes().some(e=>`translate`in e)&&e.cancel()}),e.style.translate=n,e.removeAttribute(`data-reordering`))}),e.el.removeAttribute(`data-reordering`)})};e();let n=l,r=n?()=>{n(),e()}:e;l=r;let i=f;Jn(()=>{f===i&&(e(),requestAnimationFrame(()=>{f===i&&(e(),l===r&&(l=null))}))})}i.forEach(({el:e})=>e.removeAttribute(`data-reordering`))}},oe=(e=null)=>{i.forEach(({el:t})=>{t!==e&&t.removeAttribute(`data-drag-rejected`)})},se=e=>{let t=p;if(!t)return;let n=new Map;e.forEach(({groupId:e,id:r,x:i,y:a})=>{let o=t.layouts.get(e),s=o&&S(o.controller.el).find(e=>w(e)===r);s&&n.set(s,{x:i,y:a,group:o.controller})}),t.projections.forEach((e,t)=>{n.has(t)||(O(t,e,e.baseline),t.removeAttribute(`data-reordering`))});let r=new Set;n.forEach(({x:e,y:n,group:i},a)=>{let o=t.projections.get(a);o||(o={baseline:a.style.translate,target:a.style.translate,handle:null},t.projections.set(a,o));let s=`${e}px ${n}px`;O(a,o,s),a.setAttribute(`data-reordering`,``),r.add(i)}),i.forEach(e=>e.el.toggleAttribute(`data-reordering`,r.has(e)))},A=(e,t,n,r=null)=>{let i=e.indicator();if(!i)return;if(!t||!r){i.hidden=!0;return}Object.assign(i.style,{position:`absolute`,left:`0`,top:`0`}),i.hidden=!1;let a=t.anchor?.edge??`empty`,o=i.offsetParent,s=o instanceof Element?o.getBoundingClientRect():{left:-window.scrollX,top:-window.scrollY},c=o instanceof HTMLElement?o.scrollLeft:0,l=o instanceof HTMLElement?o.scrollTop:0,u=r.kind===`inline-boundary`,d=r.kind===`block-boundary`,f=r.x-s.left+c-(u?Un/2:0),p=r.y-s.top+l-(d?Un/2:0);Object.assign(i.style,{transform:`translate3d(${f}px, ${p}px, 0)`,width:`${u?Un:r.width}px`,height:`${d?Un:r.height}px`,pointerEvents:`none`,zIndex:`2147483646`}),i.dataset.orientation=e.group().orientation,i.dataset.edge=a,i.dataset.index=String(t.index),i.dataset.operation=n??``,i.dataset.indicatorKind=r.kind},fe=()=>{p?.group&&(p.group.el.removeAttribute(`data-drag-over`),p.group.el.removeAttribute(`data-drop-edge`),p.group.el.removeAttribute(`data-drop-effect`),p.group.el.removeAttribute(`data-drop-noop`),p.group.el.removeAttribute(`data-placing`),A(p.group,null),p.group=null)},j=(e=!1)=>{p&&(k(e),fe(),p.placement=null)},M=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),N=()=>{let e=p,r=e?.placement,i=e?.group,a=e?.controller.el,o=e?.source.groupId===null?null:e?.layouts.get(e.source.groupId)??null,s=r?e?.layouts.get(r.destination.groupId)??null:null;if(!e||!r||!i||!a?.isConnected||!s||e.source.operation!==`move`||i.group().feedback!==`reorder`)return;let c=new Set([...e.layouts.values()].flatMap(({controller:e})=>S(e.el).filter(e=>e.getAttribute(`data-active`)===`true`).map(e=>w(e)))),l=[...e.layouts.values()].flatMap(({controller:e})=>S(e.el)).find(e=>e===document.activeElement||e.contains(document.activeElement))?.dataset.sortableId,u=()=>{if(e.layouts.forEach(({controller:e})=>{S(e.el).forEach(e=>{c.has(w(e))?e.setAttribute(`data-active`,`true`):e.removeAttribute(`data-active`)})}),!l)return;let t=[...e.layouts.values()].flatMap(({controller:e})=>S(e.el)).find(e=>w(e)===l);x(t??null)},d=o?.layout.items.map(({id:e})=>e)??[],f=s.layout.items.map(({id:e})=>e);Jn(()=>{if(n!==e.id||p!==null&&p!==e||!a.isConnected||!i.el.isConnected)return;let s=o?!M(o.controller.itemIds(),d):!1,c=!M(i.itemIds(),f);!s&&!c&&t(()=>{let e=r.anchor?.id;if(e){let t=S(i.el).find(t=>w(t)===e);if(!t?.parentNode)return;t.parentNode.insertBefore(a,r.anchor?.edge===`after`?t.nextSibling:t);return}let t=i.indicator();t?.parentNode?t.parentNode.insertBefore(a,t):i.el.append(a)}),u()})},pe=e=>{e.controller.el.style.opacity=e.previousOpacity},P=e=>{e.settled||(e.settled=!0,e.ghost.remove(),p===e&&(p=null))},ge=e=>{p!==e||e.settled||e.endSent||!e.terminalData||(e.endSent=!0,e.controller.machine.send({type:`END`,data:e.terminalData}))},F=(e,t=`outside`,n=p,r={})=>{let i=n;if(!i||p!==i||i.phase!==`dragging`)return;i.phase=`ending`,In.stop();let a=r.placement??i.placement,s=i.source.groupId===null?null:i.layouts.get(i.source.groupId)??null,c=a?i.layouts.get(a.destination.groupId)??null:null,l=e===`drop`&&a&&c?me({source:i.source,placement:a,sourceLayout:s?E(s):null,destinationLayout:E(c)}):null,u=l?{x:l.left,y:l.top,width:l.width,height:l.height}:ye(i.controller.el.getBoundingClientRect());e===`drop`&&N(),j(!0),i.controller.el.removeAttribute(`data-dragging`),i.controller.el.removeAttribute(`data-drag-operation`),i.controller.el.removeAttribute(`data-sortable-phase`),pe(i),i.restoreCursor(),oe();let d=i.ghost.frame();i.terminalData={operationId:i.id,outcome:e,source:i.source,placement:e===`drop`?a:null,...e===`cancel`?{reason:t}:{},fromFrame:d,toFrame:u??d,fromTransform:i.ghost.positioner.style.transform,toTransform:u?`translate3d(${u.x}px, ${u.y}px, 0)`:i.ghost.positioner.style.transform},e===`cancel`&&o({el:i.controller.el,name:`ui:sortable-cancel`,composed:!0,detail:Object.freeze({source:i.source,reason:t})}),r.dispatchTerminalEvent?.(),!(p!==i||i.settled)&&ge(i)},I=e=>{p===e&&(e.phase===`dragging`&&F(`cancel`,`outside`,e),!(p!==e||e.settled)&&(ge(e),!(p!==e||e.settled)&&(e.controller.machine.send(`ENDING_DONE`),P(e))))},_e=(t,n)=>{if(!p)return;let r=p.placement,i=p.group!==t;i&&fe();let a=t.group(),s=p.source.operation===`insert`?`indicator`:a.feedback,c=p.layouts.get(a.id),l=c?E(c):ae(t).layout,u=l.items,d=u.map(({id:e})=>e),f=p.source.id,m=s===`reorder`&&a.id===p.source.groupId?u.filter(({id:e})=>e!==f):u,h={groupId:a.id,orientation:a.orientation,direction:l.direction,columns:a.columns,groupRect:l.groupRect,items:m},g=p.ghost.projectedSourceFrame(n),_=s===`reorder`?{clientX:a.orientation===`vertical`?n.clientX:g.x+g.width/2,clientY:a.orientation===`horizontal`?n.clientY:g.y+g.height/2}:n,v=(s===`reorder`?le:ce)({...h,input:_}),y=s===`indicator`?de({...h,items:u},v):null,b=s===`reorder`?v:ue({placement:v,sourceId:p.source.id,sourceGroupId:p.source.groupId,itemIds:d});if(!i&&D(r,b))return;let x=p.source.groupId===null?null:p.layouts.get(p.source.groupId)??null,S=p.layouts.get(a.id),C=e.isNoop(p.source,{destination:b.destination,anchor:b.anchor}),ee=s===`reorder`&&!C?he({source:p.source,placement:b,sourceLayout:x?E(x):null,destinationLayout:S?E(S):null}):[];p.group=t,p.placement=b,t.el.setAttribute(`data-drag-over`,``),t.el.dataset.dropEdge=b.anchor?.edge??`empty`,t.el.dataset.dropEffect=p.source.operation===`insert`?`copy`:`move`,t.el.toggleAttribute(`data-drop-noop`,C),o({el:t.el,name:`ui:sortable-placement-change`,composed:!0,detail:Object.freeze({source:p.source,previous:r,placement:b})}),p.controller.machine.send({type:`LAYOUT_PROPOSED`,data:{operationId:p.id,source:p.source,previous:r,placement:b,feedback:s,offsets:ee,indicatorFrame:y,noop:C}})},ve=e=>{let t=p;t?.group&&t.id===e.operationId&&D(t.placement,e.placement)&&(t.controller.el.dataset.sortablePhase=`placing`,t.group.el.setAttribute(`data-placing`,``),e.feedback===`reorder`&&!e.noop?se(e.offsets):k(),e.feedback===`reorder`&&!e.noop?A(t.group,null):A(t.group,e.noop?null:e.placement,t.source.operation,e.indicatorFrame))};return{registerGroup:(t,n)=>{let o=_();t.setAttribute(`data-ui-sortable`,``),d(t,`data-ui-sortable`,`data-drop-target-for-element`,`data-auto-scrollable`);let c=()=>void 0,l=g({el:t,schema:Gn,onChange:()=>c()}),u={el:t,group:()=>Object.freeze({scopeId:l.sortableScope,id:w(t,l.sortableId),orientation:l.orientation,columns:l.orientation===`grid`?l.columns:null,accepts:l.accepts,disabled:l.disabled,readOnly:l.readonly,...l.label?{label:l.label}:{},feedback:l.feedback,sourceOpacity:l.sourceOpacity,ghostOpacity:l.ghostOpacity,dragCursor:l.dragCursor,previewPosition:l.previewPosition,color:l.color,interaction:l.interaction,...Object.keys(l.sortableData).length?{data:Object.freeze({...l.sortableData})}:{}}),itemIds:()=>S(t).map(e=>w(e)).filter(Boolean),indicator:()=>[...t.querySelectorAll(Vn)].find(e=>v(e.parentElement??e,$)===t)??null,refresh:()=>c()};(!l.sortableScope||!u.group().id||l.accepts.length===0)&&s(`Invalid sortable group props`,t),l.orientation===`grid`&&!T(l.columns)&&s(`Grid sortable groups require positive data-columns`,t),r.set(t,u),i.add(u);let f=e.registerGroup({element:t,getGroup:u.group,getItemIds:u.itemIds,canDrop:e=>a.get(t)?.(e)!==!1});c=()=>{p?.group===u&&F(`cancel`,`removed`),f.refresh()};let m=b(t,{invalidateDom:u.refresh}),h=ne({element:t,canDrop:({source:n,input:r})=>{let i=p,a=n.data.marker===Hn&&i!==null,o=a&&e.canDrop(i.source,u.group().id,{clientX:r.clientX,clientY:r.clientY});return t.toggleAttribute(`data-drag-rejected`,a&&!o),o},getDropEffect:()=>`move`,onDrop:()=>{let t=p,n=t?.placement;if(!t||t.group!==u||!n)return;let r=u.group(),i=je(e,t.source,{destination:n.destination,anchor:n.anchor},t.input);if(!i){F(`cancel`,r.disabled||r.readOnly?`disabled`:`outside`,t);return}F(`drop`,`outside`,t,{placement:i.placement,dispatchTerminalEvent:i.commit})}}),y=An({element:t});n.cleanup(()=>{let e=p;e?.phase===`dragging`&&(e.group===u||e.layouts.get(u.group().id)?.controller===u)&&F(`cancel`,`removed`,e),y(),h(),m(),f(),l.disconnect(),r.delete(t),i.delete(u),t.removeAttribute(`data-drag-rejected`),o()})},registerSource:(t,a,c)=>{let u=_(),m=a===`item`?`data-ui-sortable-item`:`data-ui-sortable-source`;t.setAttribute(m,``),d(t,m,`draggable`);let h=()=>a===`item`?v(t.parentElement??t,$):null,g,b=y({schema:Kn,hooks:qn,createMachine:({props:e})=>Ne({props:e,effects:{resolvePlacement:({context:e})=>{let t=p,n=e.pointer;if(!t||t.controller!==g||t.phase!==`dragging`||!n)return;let r=n.destinationId===null?null:t.layouts.get(n.destinationId)?.controller??null;r?_e(r,n.input):j()},synced:()=>{p?.controller===g&&p.phase===`dragging`&&(t.removeAttribute(`data-sortable-phase`),p.group?.el.removeAttribute(`data-placing`))},complete:({context:e})=>{let t=e.data.operationId,n=p;n&&n.id===t&&n.controller===g&&P(n)},reconcile:()=>g.refresh()}}),resolveTransitionElement:({name:e,data:t})=>{let n=t.operationId,r=p?.controller===g&&(n===void 0||p.id===n)?p:null;return e===`starting`?r?.ghost.visual:e===`placing`?r?.group?.el:r?.ghost.positioner}});b.connect(t);let x=()=>b.getCommittedSnapshot().props;g={el:t,owner:h,source:()=>{let e=x(),n=h(),i=n?r.get(n)?.group():null,o={scopeId:a===`item`?i?.scopeId??``:e.sortableScope,id:w(t,e.sortableId),type:e.sortableType,...e.label?{label:e.label}:{},...Object.keys(e.sortableData).length?{data:Object.freeze({...e.sortableData})}:{}};return Object.freeze(a===`item`?{operation:`move`,groupId:i?.id??``,...o}:{operation:`insert`,groupId:null,...o})},disabled:()=>{let e=h(),t=e?r.get(e)?.group():null;return x().disabled||t?.disabled===!0||t?.readOnly===!0},appearance:()=>{let e=x(),t=h(),n=t?r.get(t)?.group():null;return{sourceOpacity:n?.sourceOpacity??e.sourceOpacity,ghostOpacity:n?.ghostOpacity??e.ghostOpacity,dragCursor:n?.dragCursor??e.dragCursor,previewPosition:n?.previewPosition??e.previewPosition,color:n?.color??e.color,interaction:n?.interaction??e.interaction}},refresh:()=>void 0,machine:b};let S=b.onTransition(`placing`,e=>ve(e.data)),ne=t.getAttributeNames().some(e=>e===`x-ui-transition:ending`)?()=>void 0:b.onTransition(`ending`,e=>{let t=e.data.toFrame??null,n=e.data.operationId,r=p;if(r&&r.id===n&&r.controller===g)return r.ghost.finish(t)}),T=g.source();(!T.scopeId||!T.id||!T.type)&&s(`Invalid sortable source props`,t);let E=e.registerSource({element:t,getSource:g.source,isDisabled:g.disabled});g.refresh=()=>{p?.controller===g&&F(`cancel`,`removed`),E.refresh()};let D=[...t.querySelectorAll(zn)].find(e=>v(e,`${Ln}, ${Rn}`)===t),O=[...t.querySelectorAll(Bn)].find(e=>v(e,`${Ln}, ${Rn}`)===t),k=ie(t,`move`),se=C({element:t,...D?{dragHandle:D}:{},canDrag:({input:e})=>{let n=document.elementFromPoint(e.clientX,e.clientY)?.closest(Wn)??null;return!g.disabled()&&(!!D||n===null||n===t)},getInitialData:()=>{let e=g.source();return{marker:Hn,scopeId:e.scopeId,sortableId:e.id,sortableType:e.type}},onGenerateDragPreview:ee,onDragStart:e=>{p&&I(p),l?.(),l=null,f+=1,In.start();let r=g.source(),a=te(e),s=g.appearance(),c=be({source:t,input:re(e),preview:O??null,previewPosition:O?.dataset.previewPosition||s.previewPosition,opacity:s.ghostOpacity,color:s.color,interaction:s.interaction});c.move(a);let u=t.style.opacity;t.style.opacity=`${s.sourceOpacity}`;let d=Me(s.dragCursor);p={id:++n,phase:`dragging`,controller:g,source:r,ghost:c,placement:null,group:null,layouts:new Map([...i].flatMap(e=>{let t=e.group();return t.scopeId===r.scopeId?[[t.id,ae(e)]]:[]})),projections:new Map,input:a,timestamp:performance.now(),restoreCursor:d,previousOpacity:u,settled:!1,endSent:!1,terminalData:null},t.setAttribute(`data-dragging`,``),t.dataset.dragOperation=r.operation,o({el:t,name:`ui:sortable-start`,composed:!0,detail:Object.freeze({source:r})}),b.send({type:`START`,data:{operationId:p.id,source:r,sourceFrame:ye(t.getBoundingClientRect()),ghostFrame:c.frame()}})},onDrag:e=>{if(p?.controller!==g)return;let n=te(e),i=p.input,a=performance.now(),s=Math.max(a-p.timestamp,1);p.input=n,p.timestamp=a,p.ghost.move(n);let c=e.location.current.dropTargets.map(({element:e})=>e instanceof HTMLElement?r.get(e):void 0).find(e=>e!==void 0);b.send({type:`POINTER_MOVED`,pointer:{destinationId:c?.group().id??null,input:n}});let l=document.elementFromPoint(n.clientX,n.clientY)?.closest($)??null;oe(l),o({el:t,name:`ui:sortable-drag`,composed:!0,detail:Object.freeze({source:p.source,input:Object.freeze(n),previousInput:Object.freeze(i),delta:Object.freeze({x:n.clientX-i.clientX,y:n.clientY-i.clientY}),velocity:Object.freeze({x:(n.clientX-i.clientX)/s,y:(n.clientY-i.clientY)/s}),ghostFrame:Object.freeze({...p.ghost.frame()})})})},onDrop:()=>{let e=p?.controller===g?p:null;queueMicrotask(()=>{p===e&&e?.phase===`dragging`&&F(`cancel`,g.disabled()?`disabled`:`outside`,e)})}});c.cleanup(()=>{if(p?.controller===g){let e=p;e.phase===`dragging`&&F(`cancel`,`removed`,e),I(e)}se(),k(),S(),ne(),E(),b.disconnect(),u()})},canDropPolicies:a}},Xn=e=>{e.addInitSelector(()=>`[x-ui-sortable], [x-ui-sortable\\:item], [x-ui-sortable\\:source]`);let t=Ae(),n=Yn(t,t=>e.mutateDom(t));return e.directive(`ui-sortable`,e.skipDuringClone((e,{value:t,expression:r},i)=>{e instanceof HTMLElement&&(t?t===`item`||t===`source`?n.registerSource(e,t,i):t===`handle`?(e.setAttribute(`data-ui-sortable-handle`,``),d(e,`data-ui-sortable-handle`)):t===`indicator`?(e.setAttribute(`data-ui-sortable-indicator`,``),d(e,`data-ui-sortable-indicator`,`aria-hidden`,`hidden`),e.setAttribute(`aria-hidden`,`true`),e.hidden=!0):t===`preview`?(e.setAttribute(`data-ui-sortable-preview`,``),d(e,`data-ui-sortable-preview`,`data-preview-position`)):t===`can-drop`&&r?.trim()&&(n.canDropPolicies.set(e,e=>i.evaluate(r,{scope:{$sortable:e}})!==!1),i.cleanup(()=>n.canDropPolicies.delete(e))):n.registerGroup(e,i))})),t},Zn=new WeakSet,Qn=e=>{if(Zn.has(e))return;Zn.add(e);let t=Xn(e);l(e,t)};export{Xn as n,Ae as r,Qn as t};
|
|
5
|
-
//# sourceMappingURL=capability-sortable-
|
|
5
|
+
//# sourceMappingURL=capability-sortable-ehmPfdn1.js.map
|