dev-process-kit 0.0.13 → 0.0.15
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/README.md +1 -1
- package/dist/chunks/{shared-CirHYajF.js → shared-BJvnqK51.js} +1 -1
- package/dist/chunks/{shared-0MFKKPnB.js → shared-BS9TMOvt.js} +11 -11
- package/dist/chunks/{shared-Cd8A5TjZ.js → shared-BYoX4LxS.js} +174 -157
- package/dist/chunks/shared-B_nvELQt.js +572 -0
- package/dist/chunks/{shared-C1KQ5iU8.js → shared-Bp3FCPZj.js} +15 -21
- package/dist/chunks/shared-BtEAASxQ.js +1049 -0
- package/dist/chunks/shared-CBRj9Yll.js +2692 -0
- package/dist/chunks/{shared-DjmQsa0n.js → shared-CLabLKYD.js} +1 -1
- package/dist/chunks/{shared-B2YRwZ0P.js → shared-CRpGBd1Z.js} +139 -128
- package/dist/chunks/{shared-D7poXZ0z.js → shared-CVI7znpk.js} +6 -5
- package/dist/chunks/{shared-DklLt1Sc.js → shared-CeM-gXAw.js} +1 -1
- package/dist/chunks/{shared-CQG0dnvb.js → shared-D0PnnUir.js} +5 -4
- package/dist/chunks/shared-DsUcMhpJ.js +1104 -0
- package/dist/chunks/{shared-DrMSORn-.js → shared-m1HXI5YR.js} +176 -168
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -1
- package/dist/templates/usm.js +1 -1
- package/dist/templates/whiteboard.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-B4Mwapvi.js +0 -1043
- package/dist/chunks/shared-BDUe3aT-.js +0 -1
- package/dist/chunks/shared-CSC14I4g.js +0 -2370
- package/dist/chunks/shared-DO0pUSjw.js +0 -571
- package/dist/chunks/shared-DxAiavwJ.js +0 -1102
- package/dist/chunks/shared-aDPp8Vry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const I=Math.min,T=Math.max,J=Math.round,Q=Math.floor,P=t=>({x:t,y:t}),Wt={left:"right",right:"left",bottom:"top",top:"bottom"};function kt(t,e,n){return T(t,I(e,n))}function U(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function Y(t){return t.split("-")[1]}function wt(t){return t==="x"?"y":"x"}function xt(t){return t==="y"?"height":"width"}function D(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function yt(t){return wt(D(t))}function Nt(t,e,n){n===void 0&&(n=!1);const o=Y(t),i=yt(t),s=xt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=Z(r)),[r,Z(r)]}function $t(t){const e=Z(t);return[ct(t),e,ct(e)]}function ct(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const vt=["left","right"],bt=["right","left"],Vt=["top","bottom"],_t=["bottom","top"];function Ht(t,e,n){switch(t){case"top":case"bottom":return n?e?bt:vt:e?vt:bt;case"left":case"right":return e?Vt:_t;default:return[]}}function Bt(t,e,n,o){const i=Y(t);let s=Ht(_(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ct)))),s}function Z(t){const e=_(t);return Wt[e]+t.slice(e.length)}function zt(t){var e,n,o,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(i=t.left)!=null?i:0}}function It(t){return typeof t!="number"?zt(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Rt(t,e,n){let{reference:o,floating:i}=t;const s=D(e),r=yt(e),c=xt(r),l=_(e),f=s==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[c]/2-i[c]/2;let d;switch(l){case"top":d={x:a,y:o.y-i.height};break;case"bottom":d={x:a,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}const m=Y(e);return m&&(d[r]+=h*(m==="end"?1:-1)*(n&&f?-1:1)),d}async function Xt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:a="viewport",elementContext:u="floating",altBoundary:h=!1,padding:d=0}=U(e,t),m=It(d),w=c[h?u==="floating"?"reference":"floating":u],g=tt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:a,strategy:l})),x=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},C=tt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:l}):x);return{top:(g.top-C.top+m.top)/v.y,bottom:(C.bottom-g.bottom+m.bottom)/v.y,left:(g.left-C.left+m.left)/v.x,right:(C.right-g.right+m.right)/v.x}}const jt=50,qt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Xt},l=await(r.isRTL==null?void 0:r.isRTL(e));let f=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:u}=Rt(f,o,l),h=o,d=0;const m={};for(let p=0;p<s.length;p++){const w=s[p];if(!w)continue;const{name:g,fn:x}=w,{x:y,y:v,data:C,reset:b}=await x({x:a,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:m,rects:f,platform:c,elements:{reference:t,floating:e}});a=y??a,u=v??u,m[g]={...m[g],...C},b&&d<jt&&(d++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(f=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:a,y:u}=Rt(f,h,l)),p=-1)}return{x:a,y:u,placement:h,strategy:i,middlewareData:m}},Ut=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:f}=e,{mainAxis:a=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...w}=U(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=_(i),x=D(c),y=_(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(f.floating)),C=h||(y||!p?[Z(c)]:$t(c)),b=m!=="none";!h&&b&&C.push(...Bt(c,p,m,v));const F=[c,...C],S=await l.detectOverflow(e,w),N=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(a&&N.push(S[g]),u){const $=Nt(i,r,v);N.push(S[$[0]],S[$[1]])}if(O=[...O,{placement:i,overflows:N}],!N.every($=>$<=0)){var mt,gt;const $=(((mt=s.flip)==null?void 0:mt.index)||0)+1,rt=F[$];if(rt&&(!(u==="alignment"?x!==D(rt):!1)||O.every(A=>D(A.placement)===x?A.overflows[0]>0:!0)))return{data:{index:$,overflows:O},reset:{placement:rt}};let q=(gt=O.filter(V=>V.overflows[0]<=0).sort((V,A)=>V.overflows[1]-A.overflows[1])[0])==null?void 0:gt.placement;if(!q)switch(d){case"bestFit":{var pt;const V=(pt=O.filter(A=>{if(b){const W=D(A.placement);return W===x||W==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(W=>W>0).reduce((W,Ft)=>W+Ft,0)]).sort((A,W)=>A[1]-W[1])[0])==null?void 0:pt[0];V&&(q=V);break}case"initialPlacement":q=c;break}if(i!==q)return{reset:{placement:q}}}return{}}}},Yt=new Set(["left","top"]);async function Kt(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=_(n),c=Y(n),l=D(n)==="y",f=Yt.has(r)?-1:1,a=s&&l?-1:1,u=U(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),l?{x:d*a,y:h*f}:{x:h*f,y:d*a}}const Gt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=e,l=await Kt(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},Jt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:y,y:v}=x;return{x:y,y:v}}},...f}=U(t,e),a={x:n,y:o},u=await s.detectOverflow(e,f),h=D(i),d=wt(h);let m=a[d],p=a[h];const w=(x,y)=>kt(y+u[x==="y"?"top":"left"],y,y-u[x==="y"?"bottom":"right"]);r&&(m=w(d,m)),c&&(p=w(h,p));const g=l.fn({...e,[d]:m,[h]:p});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:r,[h]:c}}}}}},Qt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:s}=e,{apply:r=()=>{},...c}=U(t,e),l=await i.detectOverflow(e,c),f=_(n),a=Y(n),u=D(n)==="y",{width:h,height:d}=o.floating;let m,p;f==="top"||f==="bottom"?(m=f,p=a===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(p=f,m=a==="end"?"top":"bottom");const w=d-l.top-l.bottom,g=h-l.left-l.right,x=I(d-l[m],w),y=I(h-l[p],g),v=e.middlewareData.shift,C=!v;let b=x,F=y;v!=null&&v.enabled.x&&(F=g),v!=null&&v.enabled.y&&(b=w),C&&!a&&(u?F=h-2*T(l.left,l.right):b=d-2*T(l.top,l.bottom)),await r({...e,availableWidth:F,availableHeight:b});const S=await i.getDimensions(s.floating);return h!==S.width||d!==S.height?{reset:{rects:!0}}:{}}}};function et(){return typeof window<"u"}function X(t){return Ct(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function M(t){var e;return(e=(Ct(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ct(t){return et()?t instanceof Node||t instanceof R(t).Node:!1}function L(t){return et()?t instanceof Element||t instanceof R(t).Element:!1}function k(t){return et()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function At(t){return!et()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Zt(t){return/^(table|td|th)$/.test(X(t))}function ot(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const te=/transform|translate|scale|rotate|perspective|filter/,ee=/paint|layout|strict|content/,H=t=>!!t&&t!=="none";let lt;function ft(t){const e=L(t)?E(t):t;return H(e.transform)||H(e.translate)||H(e.scale)||H(e.rotate)||H(e.perspective)||!at()&&(H(e.backdropFilter)||H(e.filter))||te.test(e.willChange||"")||ee.test(e.contain||"")}function ne(t){let e=B(t);for(;k(e)&&!K(e);){if(ft(e))return e;if(ot(e))return null;e=B(e)}return null}function at(){return lt==null&&(lt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),lt}function K(t){return/^(html|body|#document)$/.test(X(t))}function E(t){return R(t).getComputedStyle(t)}function it(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||At(t)&&t.host||M(t);return At(e)?e.host:e}function Ot(t){const e=B(t);return K(e)?(t.ownerDocument||t).body:k(e)&&nt(e)?e:Ot(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ot(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const c=ut(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],c&&n?G(c):[])}else return e.concat(i,G(i,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Lt(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=k(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=J(n)!==s||J(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function dt(t){return L(t)?t:t.contextElement}function j(t){const e=dt(t);if(!k(e))return P(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Lt(e);let r=(s?J(n.width):n.width)/o,c=(s?J(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const oe=P(0);function Et(t){const e=R(t);return!at()||!e.visualViewport?oe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ie(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===R(t)}function z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=dt(t);let r=P(1);e&&(o?L(o)&&(r=j(o)):r=j(t));const c=ie(s,n,o)?Et(s):P(0);let l=(i.left+c.x)/r.x,f=(i.top+c.y)/r.y,a=i.width/r.x,u=i.height/r.y;if(s&&o){const h=R(s),d=L(o)?R(o):o;let m=h,p=ut(m);for(;p&&d!==m;){const w=j(p),g=p.getBoundingClientRect(),x=E(p),y=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,v=g.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,f*=w.y,a*=w.x,u*=w.y,l+=y,f+=v,m=R(p),p=ut(m)}}return tt({width:a,height:u,x:l,y:f})}function st(t,e){const n=it(t).scrollLeft;return e?e.left+n:z(M(t)).left+n}function St(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-st(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function se(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=M(o),c=e?ot(e.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},f=P(1);const a=P(0),u=k(o);if((u||!s)&&((X(o)!=="body"||nt(r))&&(l=it(o)),u)){const d=z(o);f=j(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const h=r&&!u&&!s?St(r,l):P(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+a.x+h.x,y:n.y*f.y-l.scrollTop*f.y+a.y+h.y}}function re(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ce(t){const e=it(t),n=t.ownerDocument.body,o=T(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=T(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+st(t);const r=-e.scrollTop;return E(n).direction==="rtl"&&(s+=T(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const le=25;function fe(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=R(t),s=M(t),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,f=0,a=0;if(r){const h=!at()||e==="fixed";o?h||(f=-r.offsetLeft,a=-r.offsetTop):(c=r.width,l=r.height,h&&(f=r.offsetLeft,a=r.offsetTop))}if(st(s)<=0){const h=s.ownerDocument,d=h.body,m=getComputedStyle(d),p=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(s.clientWidth-d.clientWidth-p),g=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;g<=le&&(c-=g)}return{width:c,height:l,x:f,y:a}}function ae(t,e){const n=z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,f=o*s.y;return{width:r,height:c,x:l,y:f}}function Tt(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=fe(t,n,e);else if(e==="document")o=ce(M(t));else if(L(e))o=ae(e,n);else{const i=Et(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function ue(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(c=>L(c)&&X(c)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?B(t):t;for(;L(r)&&!K(r);){const c=E(r),l=ft(r),f=i?i.position:s?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(u=>u!==r):i=c,r=B(r)}return e.set(t,o),o}function de(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?ot(e)?[]:ue(e,this._c):[].concat(n),o],c=Tt(e,r[0],i);let l=c.top,f=c.right,a=c.bottom,u=c.left;for(let h=1;h<r.length;h++){const d=Tt(e,r[h],i);l=T(d.top,l),f=I(d.right,f),a=I(d.bottom,a),u=T(d.left,u)}return{width:f-u,height:a-l,x:u,y:l}}function he(t){const{width:e,height:n}=Lt(t);return{width:e,height:n}}function me(t,e,n){const o=k(e),i=M(e),s=n==="fixed",r=z(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=P(0);if((o||!s)&&((X(e)!=="body"||nt(i))&&(c=it(e)),o)){const h=z(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}!o&&i&&(l.x=st(i));const f=i&&!o&&!s?St(i,c):P(0),a=r.left+c.scrollLeft-l.x-f.x,u=r.top+c.scrollTop-l.y-f.y;return{x:a,y:u,width:r.width,height:r.height}}function ht(t){return E(t).position==="static"}function Pt(t,e){if(!k(t)||E(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return M(t)===n&&(n=n.ownerDocument.body),n}function Dt(t,e){const n=R(t);if(ot(t))return n;if(!k(t)){let i=B(t);for(;i&&!K(i);){if(L(i)&&!ht(i))return i;i=B(i)}return n}let o=Pt(t,e);for(;o&&Zt(o)&&ht(o);)o=Pt(o,e);return o&&K(o)&&ht(o)&&!ft(o)?n:o||ne(t)||n}const ge=async function(t){const e=this.getOffsetParent||Dt,n=this.getDimensions,o=await n(t.floating);return{reference:me(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function pe(t){return E(t).direction==="rtl"}const we={convertOffsetParentRelativeRectToViewportRelativeRect:se,getDocumentElement:M,getClippingRect:de,getOffsetParent:Dt,getElementRects:ge,getClientRects:re,getDimensions:he,getScale:j,isElement:L,isRTL:pe};function Mt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function xe(t,e,n){let o=null,i;const s=M(t);function r(){var a;clearTimeout(i),(a=o)==null||a.disconnect(),o=null}function c(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),r();const h=t.getBoundingClientRect(),{left:d,top:m,width:p,height:w}=h;if(a||e(),!p||!w)return;const g=Q(m),x=Q(s.clientWidth-(d+p)),y=Q(s.clientHeight-(m+w)),v=Q(d),b={rootMargin:-g+"px "+-x+"px "+-y+"px "+-v+"px",threshold:T(0,I(1,u))||1};let F=!0;function S(N){const O=N[0].intersectionRatio;if(!Mt(h,t.getBoundingClientRect()))return c();if(O!==u){if(!F)return c();O?c(!1,O):i=setTimeout(()=>{c(!1,1e-7)},1e3)}F=!1}try{o=new IntersectionObserver(S,{...b,root:s.ownerDocument})}catch{o=new IntersectionObserver(S,b)}o.observe(t)}const l=R(t),f=()=>c(n);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),r()}}function ye(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=dt(t),a=i||s?[...f?G(f):[],...e?G(e):[]]:[];a.forEach(g=>{i&&g.addEventListener("scroll",n),s&&g.addEventListener("resize",n)});const u=f&&c?xe(f,n,s):null;let h=-1,d=null;r&&(d=new ResizeObserver(g=>{let[x]=g;x&&x.target===f&&d&&e&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(e)})),n()}),f&&!l&&d.observe(f),e&&d.observe(e));let m,p=l?z(t):null;l&&w();function w(){const g=z(t);p&&!Mt(p,g)&&n(),p=g,m=requestAnimationFrame(w)}return n(),()=>{var g;a.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u?.(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const ve=Gt,be=Jt,Re=Ut,Ce=Qt,Ae=(t,e,n)=>{const o=new Map,i=n??{},s={...we,...i.platform,_c:o};return qt(t,e,{...i,platform:s})},Oe=(t,e)=>({top:e,bottom:e,right:t}),Le=(t,e,n,o={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,s=0;const r=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=ye(r,t,()=>{const f=++s;Ae(r,t,{strategy:"fixed",placement:o.placement??"bottom-end",middleware:[ve(8),Re({padding:8,fallbackAxisSideDirection:"end"}),be({padding:8}),Ce({padding:8,apply:({availableWidth:a,availableHeight:u})=>{!i||f!==s||(t.style.width=`${Math.max(0,Math.min(n.width,a))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,u))}px`)}})]}).then(({x:a,y:u})=>{!i||f!==s||!t.isConnected||(t.style.left=`${a}px`,t.style.top=`${u}px`)}).catch(()=>{})},{animationFrame:o.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},Ee=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Se{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,o,i){this.#t.get(e)?.(),this.#t.set(e,Le(e,n,o,i))}}export{Se as P,Ee as c,Oe as p};
|