@flarehr/salpac-finops-admin 1.0.1007 → 1.0.1008
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/dist/salpac-finops-admin.js +1 -1
- package/package.json +14 -5
|
@@ -10,7 +10,7 @@ var e=Object.defineProperty,t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exp
|
|
|
10
10
|
${({disabled:e})=>e&&{cursor:`not-allowed`,"--tw-bg-opacity":`1`,backgroundColor:`rgb(156 163 175 / var(--tw-bg-opacity, 1))`,":hover":{"--tw-bg-opacity":`1`,backgroundColor:`rgb(156 163 175 / var(--tw-bg-opacity, 1))`}}}
|
|
11
11
|
`,Va=({as:e,download:t,href:n,disabled:r,children:i,onClick:a,type:o})=>U(Ba,{as:e||`button`,download:t,href:n,type:o||`button`,disabled:r,onClick:a,children:i}),Ha=({blob:e,children:t,fileName:n})=>{let[r,i]=P();return F(()=>{let t=URL.createObjectURL(e);return i(t),()=>{URL.revokeObjectURL(t),i(void 0)}},[e]),U(Va,{as:`a`,href:r??`#`,download:n,children:t})},Ua=di.div`
|
|
12
12
|
${()=>({height:`1.5rem`,width:`1.5rem`,"@keyframes spin":{to:{transform:`rotate(360deg)`}},animation:`spin 1s linear infinite`,borderRadius:`9999px`,borderWidth:`2px`,borderColor:`var(--fl-color-primary-600)`,borderLeftColor:`transparent`,borderTopColor:`transparent`})}
|
|
13
|
-
`,Wa=async e=>{try{let t=await e.response?.text();return JSON.parse(t)}catch{return{}}},Ga=e=>new Date(Date.now()+e*24*60*60*1e3).toISOString().split(`T`)[0],Ka=15e3,qa=class e extends Error{_response;get response(){return this._response}constructor(t,n){super(t),this._response=n,Object.setPrototypeOf(this,e.prototype)}},Ja=async(e,t,n,r)=>{let i=r instanceof FormData,a={"x-app-version":`1.0.1007`,authorization:`Bearer ${t}`};r&&!i&&(a[`content-type`]=`application/json`);let o=await fetch(e,{method:n,body:r&&!i?JSON.stringify(r):r,headers:{"x-app-version":`1.0.1007`,authorization:`Bearer ${t}`},signal:AbortSignal?.timeout?.(Ka)});if(!o.ok)throw new qa(`[API Error] Status: ${o.status}, ${o.statusText}`,o);return o},Ya=async(e,t,n,r)=>{let i=await Ja(e,t,n,r);return i.headers.get(`Content-Type`)?.includes(`application/json`)?await i.json():await i.blob()},Xa=ve({backend:{url:``,accessToken:``}}),Za=()=>Je(Xa),Qa=e=>{let t=Za();return Ke(()=>e(t),[e,t])},$a=e=>async t=>{let n=new FormData;return n.append(`source`,t.source),n.append(`transactionFile`,t.transactionsFile),Ya(new URL(`${e.backend.url}/salary-packaging/admin/v1.0/catche/receipt-batch`),e.backend.accessToken,`POST`,n)},eo=e=>async t=>Ya(new URL(`${e.backend.url}/salary-packaging/admin/v1.0/reports/${t.report}?startDate=${t.startDate||``}&endDate=${t.endDate||``}&groupCode=${t.groupCode||``}&clientId=${t.clientId||``}`),e.backend.accessToken,`GET`),to=(e,t)=>async n=>{let r=Ga(2);return Ja(new URL(`${e.backend.url}${t}`),e.backend.accessToken,`POST`,{startDate:n,endDate:r})},no=e=>to(e,`/salary-packaging/admin/v1.0/ingest/clients`),ro=e=>to(e,`/salary-packaging/admin/v1.0/ingest/drivers`),io=e=>to(e,`/salary-packaging/admin/v1.0/ingest/contract-budgets`),ao=e=>to(e,`/salary-packaging/admin/v1.0/ingest/invoice-items`),oo=e=>to(e,`/salary-packaging/admin/v1.0/ingest/deleted-invoice-items`),so=e=>to(e,`/salary-packaging/admin/v1.0/ingest/vehicle-contracts`),co=()=>({postCatcheReceiptBatch:Qa($a),getCatcheReport:Qa(eo),ingestClients:Qa(no),ingestDrivers:Qa(ro),ingestContractBudgets:Qa(io),ingestInvoiceItems:Qa(ao),ingestDeletedInvoiceItems:Qa(oo),ingestVehicleContracts:Qa(so)}),lo=Object.defineProperty,uo=(e,t,n)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fo=(e,t,n)=>(uo(e,typeof t==`symbol`?t:t+``,n),n),po=new class{constructor(){fo(this,`current`,this.detect()),fo(this,`handoffState`,`pending`),fo(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}},mo=(e,t)=>{po.isServer?F(e,t):We(e,t)};function ho(e){let t=I(e);return mo(()=>{t.current=e},[e]),t}function go(e,t){let[n,r]=P(e),i=ho(e);return mo(()=>r(i.current),[i,r,...t]),n}var Z=function(e){let t=ho(e);return L.useCallback((...e)=>t.current(...e),[t])};function _o(e,t,n){let[r,i]=P(n),a=e!==void 0,o=I(a),s=I(!1),c=I(!1);return a&&!o.current&&!s.current?(s.current=!0,o.current=a,console.error(`A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.`)):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,console.error(`A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.`)),[a?e:r,Z(e=>(a||i(e),t?.(e)))]}function vo(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function yo(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return vo(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=yo();return e(t),this.add(()=>t.dispose())},add(t){return e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function bo(){let[e]=P(yo);return F(()=>()=>e.dispose(),[e]),e}function xo(){let e=typeof document>`u`;return`useSyncExternalStore`in ot?(e=>e.useSyncExternalStore)(ot)(()=>()=>{},()=>!1,()=>!e):!1}function So(){let e=xo(),[t,n]=P(po.isHandoffComplete);return t&&po.isHandoffComplete===!1&&n(!1),F(()=>{t!==!0&&n(!0)},[t]),F(()=>po.handoff(),[]),e?!1:t}var Co=L.useId??function(){let e=So(),[t,n]=L.useState(e?()=>po.nextId():null);return mo(()=>{t===null&&n(po.nextId())},[t]),t==null?void 0:``+t};function Q(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Q),r}function wo(e){return po.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty(`current`)&&e.current instanceof Node?e.current.ownerDocument:document}var To=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),Eo=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e))(Eo||{}),Do=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(Do||{}),Oo=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(Oo||{}),ko=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(ko||{});function Ao(e,t=0){return e===wo(e)?.body?!1:Q(t,{0(){return e.matches(To)},1(){let t=e;for(;t!==null;){if(t.matches(To))return!0;t=t.parentElement}return!1}})}var jo=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(jo||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0)),[`textarea`,`input`].join(`,`);function Mo(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function No(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Po(){return/Android/gi.test(window.navigator.userAgent)}function Fo(){return No()||Po()}function Io(e,t,n){let r=ho(t);F(()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}function Lo(e,t,n){let r=ho(t);F(()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}function Ro(e,t,n=!0){let r=I(!1);F(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(n,i){if(!r.current||n.defaultPrevented)return;let a=i(n);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let o=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e);for(let e of o){if(e===null)continue;let t=e instanceof HTMLElement?e:e.current;if(t!=null&&t.contains(a)||n.composed&&n.composedPath().includes(t))return}return!Ao(a,ko.Loose)&&a.tabIndex!==-1&&n.preventDefault(),t(n,a)}let a=I(null);Io(`pointerdown`,e=>{r.current&&(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),Io(`mousedown`,e=>{r.current&&(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),Io(`click`,e=>{Fo()||(a.current&&=(i(e,()=>a.current),null))},!0),Io(`touchend`,e=>i(e,()=>e.target instanceof HTMLElement?e.target:null),!0),Lo(`blur`,e=>i(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function zo(e){if(e.type)return e.type;let t=e.as??`button`;if(typeof t==`string`&&t.toLowerCase()===`button`)return`button`}function Bo(e,t){let[n,r]=P(()=>zo(e));return mo(()=>{r(zo(e))},[e.type,e.as]),mo(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute(`type`)&&r(`button`)},[n,t]),n}var Vo=Symbol();function Ho(...e){let t=I(e);F(()=>{t.current=e},[e]);let n=Z(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[Vo])?void 0:n}function Uo(e){return[e.screenX,e.screenY]}function Wo(){let e=I([-1,-1]);return{wasMoved(t){let n=Uo(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Uo(t)}}}function Go(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}var Ko=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(Ko||{}),qo=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(qo||{});function Jo({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=Xo;let c=Zo(t,e);if(a)return Yo(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return Yo(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return Q(e?0:1,{0(){return null},1(){return Yo({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return Yo(c,n,r,o,s)}function Yo(e,t={},n,r,i){let{as:a=n,children:o,refName:s=`ref`,...c}=es(e,[`unmount`,`static`]),l=e.ref===void 0?{}:{[s]:e.ref},u=typeof o==`function`?o(t):o;`className`in c&&c.className&&typeof c.className==`function`&&(c.className=c.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r);e&&(d[`data-headlessui-state`]=n.join(` `))}if(a===w&&Object.keys($o(c)).length>0){if(!Zt(u)||Array.isArray(u)&&u.length>1)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(c).map(e=>` - ${e}`).join(`
|
|
13
|
+
`,Wa=async e=>{try{let t=await e.response?.text();return JSON.parse(t)}catch{return{}}},Ga=e=>new Date(Date.now()+e*24*60*60*1e3).toISOString().split(`T`)[0],Ka=15e3,qa=class e extends Error{_response;get response(){return this._response}constructor(t,n){super(t),this._response=n,Object.setPrototypeOf(this,e.prototype)}},Ja=async(e,t,n,r)=>{let i=r instanceof FormData,a={"x-app-version":`1.0.1008`,authorization:`Bearer ${t}`};r&&!i&&(a[`content-type`]=`application/json`);let o=await fetch(e,{method:n,body:r&&!i?JSON.stringify(r):r,headers:{"x-app-version":`1.0.1008`,authorization:`Bearer ${t}`},signal:AbortSignal?.timeout?.(Ka)});if(!o.ok)throw new qa(`[API Error] Status: ${o.status}, ${o.statusText}`,o);return o},Ya=async(e,t,n,r)=>{let i=await Ja(e,t,n,r);return i.headers.get(`Content-Type`)?.includes(`application/json`)?await i.json():await i.blob()},Xa=ve({backend:{url:``,accessToken:``}}),Za=()=>Je(Xa),Qa=e=>{let t=Za();return Ke(()=>e(t),[e,t])},$a=e=>async t=>{let n=new FormData;return n.append(`source`,t.source),n.append(`transactionFile`,t.transactionsFile),Ya(new URL(`${e.backend.url}/salary-packaging/admin/v1.0/catche/receipt-batch`),e.backend.accessToken,`POST`,n)},eo=e=>async t=>Ya(new URL(`${e.backend.url}/salary-packaging/admin/v1.0/reports/${t.report}?startDate=${t.startDate||``}&endDate=${t.endDate||``}&groupCode=${t.groupCode||``}&clientId=${t.clientId||``}`),e.backend.accessToken,`GET`),to=(e,t)=>async n=>{let r=Ga(2);return Ja(new URL(`${e.backend.url}${t}`),e.backend.accessToken,`POST`,{startDate:n,endDate:r})},no=e=>to(e,`/salary-packaging/admin/v1.0/ingest/clients`),ro=e=>to(e,`/salary-packaging/admin/v1.0/ingest/drivers`),io=e=>to(e,`/salary-packaging/admin/v1.0/ingest/contract-budgets`),ao=e=>to(e,`/salary-packaging/admin/v1.0/ingest/invoice-items`),oo=e=>to(e,`/salary-packaging/admin/v1.0/ingest/deleted-invoice-items`),so=e=>to(e,`/salary-packaging/admin/v1.0/ingest/vehicle-contracts`),co=()=>({postCatcheReceiptBatch:Qa($a),getCatcheReport:Qa(eo),ingestClients:Qa(no),ingestDrivers:Qa(ro),ingestContractBudgets:Qa(io),ingestInvoiceItems:Qa(ao),ingestDeletedInvoiceItems:Qa(oo),ingestVehicleContracts:Qa(so)}),lo=Object.defineProperty,uo=(e,t,n)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fo=(e,t,n)=>(uo(e,typeof t==`symbol`?t:t+``,n),n),po=new class{constructor(){fo(this,`current`,this.detect()),fo(this,`handoffState`,`pending`),fo(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}},mo=(e,t)=>{po.isServer?F(e,t):We(e,t)};function ho(e){let t=I(e);return mo(()=>{t.current=e},[e]),t}function go(e,t){let[n,r]=P(e),i=ho(e);return mo(()=>r(i.current),[i,r,...t]),n}var Z=function(e){let t=ho(e);return L.useCallback((...e)=>t.current(...e),[t])};function _o(e,t,n){let[r,i]=P(n),a=e!==void 0,o=I(a),s=I(!1),c=I(!1);return a&&!o.current&&!s.current?(s.current=!0,o.current=a,console.error(`A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.`)):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,console.error(`A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.`)),[a?e:r,Z(e=>(a||i(e),t?.(e)))]}function vo(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function yo(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return vo(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=yo();return e(t),this.add(()=>t.dispose())},add(t){return e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function bo(){let[e]=P(yo);return F(()=>()=>e.dispose(),[e]),e}function xo(){let e=typeof document>`u`;return`useSyncExternalStore`in ot?(e=>e.useSyncExternalStore)(ot)(()=>()=>{},()=>!1,()=>!e):!1}function So(){let e=xo(),[t,n]=P(po.isHandoffComplete);return t&&po.isHandoffComplete===!1&&n(!1),F(()=>{t!==!0&&n(!0)},[t]),F(()=>po.handoff(),[]),e?!1:t}var Co=L.useId??function(){let e=So(),[t,n]=L.useState(e?()=>po.nextId():null);return mo(()=>{t===null&&n(po.nextId())},[t]),t==null?void 0:``+t};function Q(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Q),r}function wo(e){return po.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty(`current`)&&e.current instanceof Node?e.current.ownerDocument:document}var To=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),Eo=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e))(Eo||{}),Do=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(Do||{}),Oo=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(Oo||{}),ko=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(ko||{});function Ao(e,t=0){return e===wo(e)?.body?!1:Q(t,{0(){return e.matches(To)},1(){let t=e;for(;t!==null;){if(t.matches(To))return!0;t=t.parentElement}return!1}})}var jo=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(jo||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0)),[`textarea`,`input`].join(`,`);function Mo(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function No(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Po(){return/Android/gi.test(window.navigator.userAgent)}function Fo(){return No()||Po()}function Io(e,t,n){let r=ho(t);F(()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}function Lo(e,t,n){let r=ho(t);F(()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}function Ro(e,t,n=!0){let r=I(!1);F(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(n,i){if(!r.current||n.defaultPrevented)return;let a=i(n);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let o=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e);for(let e of o){if(e===null)continue;let t=e instanceof HTMLElement?e:e.current;if(t!=null&&t.contains(a)||n.composed&&n.composedPath().includes(t))return}return!Ao(a,ko.Loose)&&a.tabIndex!==-1&&n.preventDefault(),t(n,a)}let a=I(null);Io(`pointerdown`,e=>{r.current&&(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),Io(`mousedown`,e=>{r.current&&(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),Io(`click`,e=>{Fo()||(a.current&&=(i(e,()=>a.current),null))},!0),Io(`touchend`,e=>i(e,()=>e.target instanceof HTMLElement?e.target:null),!0),Lo(`blur`,e=>i(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function zo(e){if(e.type)return e.type;let t=e.as??`button`;if(typeof t==`string`&&t.toLowerCase()===`button`)return`button`}function Bo(e,t){let[n,r]=P(()=>zo(e));return mo(()=>{r(zo(e))},[e.type,e.as]),mo(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute(`type`)&&r(`button`)},[n,t]),n}var Vo=Symbol();function Ho(...e){let t=I(e);F(()=>{t.current=e},[e]);let n=Z(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[Vo])?void 0:n}function Uo(e){return[e.screenX,e.screenY]}function Wo(){let e=I([-1,-1]);return{wasMoved(t){let n=Uo(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Uo(t)}}}function Go(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}var Ko=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(Ko||{}),qo=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(qo||{});function Jo({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=Xo;let c=Zo(t,e);if(a)return Yo(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return Yo(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return Q(e?0:1,{0(){return null},1(){return Yo({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return Yo(c,n,r,o,s)}function Yo(e,t={},n,r,i){let{as:a=n,children:o,refName:s=`ref`,...c}=es(e,[`unmount`,`static`]),l=e.ref===void 0?{}:{[s]:e.ref},u=typeof o==`function`?o(t):o;`className`in c&&c.className&&typeof c.className==`function`&&(c.className=c.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r);e&&(d[`data-headlessui-state`]=n.join(` `))}if(a===w&&Object.keys($o(c)).length>0){if(!Zt(u)||Array.isArray(u)&&u.length>1)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(c).map(e=>` - ${e}`).join(`
|
|
14
14
|
`),``,`You can apply a few solutions:`,['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',`Render a single element as the child so that we can forward the props onto that element.`].map(e=>` - ${e}`).join(`
|
|
15
15
|
`)].join(`
|
|
16
16
|
`));let e=u.props,t=typeof e?.className==`function`?(...t)=>Go(e?.className(...t),c.className):Go(e?.className,c.className),n=t?{className:t}:{};return en(u,Object.assign({},Zo(u.props,$o(es(c,[`ref`]))),d,l,{ref:i(u.ref,l.ref)},n))}return x(a,Object.assign({},es(c,[`ref`]),a!==w&&l,a!==w&&d),u)}function Xo(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function Zo(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])return Object.assign(t,Object.fromEntries(Object.keys(n).map(e=>[e,void 0])));for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function Qo(e){return Object.assign(yt(e),{displayName:e.displayName??e.name})}function $o(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function es(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}var ts=`div`,ns=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(ns||{});function rs(e,t){let{features:n=1,...r}=e;return Jo({ourProps:{ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}},theirProps:r,slot:{},defaultTag:ts,name:`Hidden`})}var is=Qo(rs),as=ve(null);as.displayName=`OpenClosedContext`;var os=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(os||{});function ss(){return Je(as)}function cs({value:e,children:t}){return L.createElement(as.Provider,{value:e},t)}function ls(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=t?.getAttribute(`disabled`)===``;return r&&us(n)?!1:r}function us(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function ds(e){throw Error(`Unexpected object: `+e)}var fs=(e=>(e[e.First=0]=`First`,e[e.Previous=1]=`Previous`,e[e.Next=2]=`Next`,e[e.Last=3]=`Last`,e[e.Specific=4]=`Specific`,e[e.Nothing=5]=`Nothing`,e))(fs||{});function ps(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 1:for(let e=i-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 2:for(let e=i+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 4:for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return r;case 5:return null;default:ds(e)}}function ms(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))gs(n,hs(t,r),i);return n}function hs(e,t){return e?e+`[`+t+`]`:t}function gs(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())gs(e,hs(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n==`boolean`?e.push([t,n?`1`:`0`]):typeof n==`string`?e.push([t,n]):typeof n==`number`?e.push([t,`${n}`]):n==null?e.push([t,``]):ms(n,t,e)}var $=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))($||{});function _s(){let e=I(!1);return mo(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var vs=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function ys(e){let t=e.innerText??``,n=e.cloneNode(!0);if(!(n instanceof HTMLElement))return t;let r=!1;for(let e of n.querySelectorAll(`[hidden],[aria-hidden],[role="img"]`))e.remove(),r=!0;let i=r?n.innerText??``:t;return vs.test(i)&&(i=i.replace(vs,``)),i}function bs(e){let t=e.getAttribute(`aria-label`);if(typeof t==`string`)return t.trim();let n=e.getAttribute(`aria-labelledby`);if(n){let e=n.split(` `).map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute(`aria-label`);return typeof e==`string`?e.trim():ys(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(`, `)}return ys(e).trim()}function xs(e){let t=I(``),n=I(``);return Z(()=>{let r=e.current;if(!r)return``;let i=r.innerText;if(t.current===i)return n.current;let a=bs(r).trim().toLowerCase();return t.current=i,n.current=a,a})}var Ss=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(Ss||{}),Cs=(e=>(e[e.Single=0]=`Single`,e[e.Multi=1]=`Multi`,e))(Cs||{}),ws=(e=>(e[e.Pointer=0]=`Pointer`,e[e.Other=1]=`Other`,e))(ws||{}),Ts=(e=>(e[e.OpenListbox=0]=`OpenListbox`,e[e.CloseListbox=1]=`CloseListbox`,e[e.GoToOption=2]=`GoToOption`,e[e.Search=3]=`Search`,e[e.ClearSearch=4]=`ClearSearch`,e[e.RegisterOption=5]=`RegisterOption`,e[e.UnregisterOption=6]=`UnregisterOption`,e[e.RegisterLabel=7]=`RegisterLabel`,e))(Ts||{});function Es(e,t=e=>e){let n=e.activeOptionIndex===null?null:e.options[e.activeOptionIndex],r=Mo(t(e.options.slice()),e=>e.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{options:r,activeOptionIndex:i}}var Ds={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(e=>n(e.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=Es(e),r=ps(t,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...n,searchQuery:``,activeOptionIndex:r,activationTrigger:t.trigger??1}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery===``?1:0,r=e.searchQuery+t.value.toLowerCase(),i=(e.activeOptionIndex===null?e.options:e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n))).find(e=>!e.dataRef.current.disabled&&e.dataRef.current.textValue?.startsWith(r)),a=i?e.options.indexOf(i):-1;return a===-1||a===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:a,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===``?e:{...e,searchQuery:``}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=Es(e,e=>[...e,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=Es(e,e=>{let n=e.findIndex(e=>e.id===t.id);return n!==-1&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},Os=ve(null);Os.displayName=`ListboxActionsContext`;function ks(e){let t=Je(Os);if(t===null){let t=Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ks),t}return t}var As=ve(null);As.displayName=`ListboxDataContext`;function js(e){let t=Je(As);if(t===null){let t=Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,js),t}return t}function Ms(e,t){return Q(t.type,Ds,e,t)}var Ns=w;function Ps(e,t){let{value:n,defaultValue:r,form:i,name:a,onChange:o,by:s=(e,t)=>e===t,disabled:c=!1,horizontal:l=!1,multiple:u=!1,...d}=e,f=l?`horizontal`:`vertical`,p=Ho(t),[m=u?[]:void 0,h]=_o(n,o,r),[g,_]=Ue(Ms,{dataRef:C(),listboxState:1,options:[],searchQuery:``,labelId:null,activeOptionIndex:null,activationTrigger:1}),v=I({static:!1,hold:!1}),y=I(null),b=I(null),x=I(null),S=Z(typeof s==`string`?(e,t)=>{let n=s;return e?.[n]===t?.[n]}:s),w=qe(e=>Q(T.mode,{1:()=>m.some(t=>S(t,e)),0:()=>S(m,e)}),[m]),T=Ke(()=>({...g,value:m,disabled:c,mode:u?1:0,orientation:f,compare:S,isSelected:w,optionsPropsRef:v,labelRef:y,buttonRef:b,optionsRef:x}),[m,c,u,g]);mo(()=>{g.dataRef.current=T},[T]),Ro([T.buttonRef,T.optionsRef],(e,t)=>{var n;_({type:1}),Ao(t,ko.Loose)||(e.preventDefault(),(n=T.buttonRef.current)==null||n.focus())},T.listboxState===0);let E=Ke(()=>({open:T.listboxState===0,disabled:c,value:m}),[T,c,m]),D=Z(e=>{let t=T.options.find(t=>t.id===e);t&&j(t.dataRef.current.value)}),ee=Z(()=>{if(T.activeOptionIndex!==null){let{dataRef:e,id:t}=T.options[T.activeOptionIndex];j(e.current.value),_({type:2,focus:fs.Specific,id:t})}}),O=Z(()=>_({type:0})),te=Z(()=>_({type:1})),ne=Z((e,t,n)=>e===fs.Specific?_({type:2,focus:fs.Specific,id:t,trigger:n}):_({type:2,focus:e,trigger:n})),k=Z((e,t)=>(_({type:5,id:e,dataRef:t}),()=>_({type:6,id:e}))),A=Z(e=>(_({type:7,id:e}),()=>_({type:7,id:null}))),j=Z(e=>Q(T.mode,{0(){return h?.(e)},1(){let t=T.value.slice(),n=t.findIndex(t=>S(t,e));return n===-1?t.push(e):t.splice(n,1),h?.(t)}})),re=Z(e=>_({type:3,value:e})),ie=Z(()=>_({type:4})),ae=Ke(()=>({onChange:j,registerOption:k,registerLabel:A,goToOption:ne,closeListbox:te,openListbox:O,selectActiveOption:ee,selectOption:D,search:re,clearSearch:ie}),[]),oe={ref:p},se=I(null),ce=bo();return F(()=>{se.current&&r!==void 0&&ce.addEventListener(se.current,`reset`,()=>{h?.(r)})},[se,h]),L.createElement(Os.Provider,{value:ae},L.createElement(As.Provider,{value:T},L.createElement(cs,{value:Q(T.listboxState,{0:os.Open,1:os.Closed})},a!=null&&m!=null&&ms({[a]:m}).map(([e,t],n)=>L.createElement(is,{features:ns.Hidden,ref:n===0?e=>{se.current=e?.closest(`form`)??null}:void 0,...$o({key:e,as:`input`,type:`hidden`,hidden:!0,readOnly:!0,form:i,disabled:c,name:e,value:t})})),Jo({ourProps:oe,theirProps:d,slot:E,defaultTag:Ns,name:`Listbox`}))))}var Fs=`button`;function Is(e,t){let n=Co(),{id:r=`headlessui-listbox-button-${n}`,...i}=e,a=js(`Listbox.Button`),o=ks(`Listbox.Button`),s=Ho(a.buttonRef,t),c=bo(),l=Z(e=>{switch(e.key){case $.Space:case $.Enter:case $.ArrowDown:e.preventDefault(),o.openListbox(),c.nextFrame(()=>{a.value||o.goToOption(fs.First)});break;case $.ArrowUp:e.preventDefault(),o.openListbox(),c.nextFrame(()=>{a.value||o.goToOption(fs.Last)});break}}),u=Z(e=>{switch(e.key){case $.Space:e.preventDefault();break}}),d=Z(e=>{if(ls(e.currentTarget))return e.preventDefault();a.listboxState===0?(o.closeListbox(),c.nextFrame(()=>a.buttonRef.current?.focus({preventScroll:!0}))):(e.preventDefault(),o.openListbox())}),f=go(()=>{if(a.labelId)return[a.labelId,r].join(` `)},[a.labelId,r]),p=Ke(()=>({open:a.listboxState===0,disabled:a.disabled,value:a.value}),[a]);return Jo({ourProps:{ref:s,id:r,type:Bo(e,a.buttonRef),"aria-haspopup":`listbox`,"aria-controls":a.optionsRef.current?.id,"aria-expanded":a.listboxState===0,"aria-labelledby":f,disabled:a.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:i,slot:p,defaultTag:Fs,name:`Listbox.Button`})}var Ls=`label`;function Rs(e,t){let n=Co(),{id:r=`headlessui-listbox-label-${n}`,...i}=e,a=js(`Listbox.Label`),o=ks(`Listbox.Label`),s=Ho(a.labelRef,t);mo(()=>o.registerLabel(r),[r]);let c=Z(()=>a.buttonRef.current?.focus({preventScroll:!0})),l=Ke(()=>({open:a.listboxState===0,disabled:a.disabled}),[a]);return Jo({ourProps:{ref:s,id:r,onClick:c},theirProps:i,slot:l,defaultTag:Ls,name:`Listbox.Label`})}var zs=`ul`,Bs=Ko.RenderStrategy|Ko.Static;function Vs(e,t){var n;let r=Co(),{id:i=`headlessui-listbox-options-${r}`,...a}=e,o=js(`Listbox.Options`),s=ks(`Listbox.Options`),c=Ho(o.optionsRef,t),l=bo(),u=bo(),d=ss(),f=d===null?o.listboxState===0:(d&os.Open)===os.Open;F(()=>{let e=o.optionsRef.current;e&&o.listboxState===0&&e!==wo(e)?.activeElement&&e.focus({preventScroll:!0})},[o.listboxState,o.optionsRef]);let p=Z(e=>{switch(u.dispose(),e.key){case $.Space:if(o.searchQuery!==``)return e.preventDefault(),e.stopPropagation(),s.search(e.key);case $.Enter:if(e.preventDefault(),e.stopPropagation(),o.activeOptionIndex!==null){let{dataRef:e}=o.options[o.activeOptionIndex];s.onChange(e.current.value)}o.mode===0&&(s.closeListbox(),yo().nextFrame(()=>o.buttonRef.current?.focus({preventScroll:!0})));break;case Q(o.orientation,{vertical:$.ArrowDown,horizontal:$.ArrowRight}):return e.preventDefault(),e.stopPropagation(),s.goToOption(fs.Next);case Q(o.orientation,{vertical:$.ArrowUp,horizontal:$.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),s.goToOption(fs.Previous);case $.Home:case $.PageUp:return e.preventDefault(),e.stopPropagation(),s.goToOption(fs.First);case $.End:case $.PageDown:return e.preventDefault(),e.stopPropagation(),s.goToOption(fs.Last);case $.Escape:return e.preventDefault(),e.stopPropagation(),s.closeListbox(),l.nextFrame(()=>o.buttonRef.current?.focus({preventScroll:!0}));case $.Tab:e.preventDefault(),e.stopPropagation();break;default:e.key.length===1&&(s.search(e.key),u.setTimeout(()=>s.clearSearch(),350));break}}),m=go(()=>o.buttonRef.current?.id,[o.buttonRef.current]),h=Ke(()=>({open:o.listboxState===0}),[o]);return Jo({ourProps:{"aria-activedescendant":o.activeOptionIndex===null||(n=o.options[o.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":o.mode===1?!0:void 0,"aria-labelledby":m,"aria-orientation":o.orientation,id:i,onKeyDown:p,role:`listbox`,tabIndex:0,ref:c},theirProps:a,slot:h,defaultTag:zs,features:Bs,visible:f,name:`Listbox.Options`})}var Hs=`li`;function Us(e,t){let n=Co(),{id:r=`headlessui-listbox-option-${n}`,disabled:i=!1,value:a,...o}=e,s=js(`Listbox.Option`),c=ks(`Listbox.Option`),l=s.activeOptionIndex===null?!1:s.options[s.activeOptionIndex].id===r,u=s.isSelected(a),d=I(null),f=xs(d),p=ho({disabled:i,value:a,domRef:d,get textValue(){return f()}}),m=Ho(t,d);mo(()=>{if(s.listboxState!==0||!l||s.activationTrigger===0)return;let e=yo();return e.requestAnimationFrame(()=>{var e,t;(t=(e=d.current)?.scrollIntoView)==null||t.call(e,{block:`nearest`})}),e.dispose},[d,l,s.listboxState,s.activationTrigger,s.activeOptionIndex]),mo(()=>c.registerOption(r,p),[p,r]);let h=Z(e=>{if(i)return e.preventDefault();c.onChange(a),s.mode===0&&(c.closeListbox(),yo().nextFrame(()=>s.buttonRef.current?.focus({preventScroll:!0})))}),g=Z(()=>{if(i)return c.goToOption(fs.Nothing);c.goToOption(fs.Specific,r)}),_=Wo(),v=Z(e=>_.update(e)),y=Z(e=>{_.wasMoved(e)&&(i||l||c.goToOption(fs.Specific,r,0))}),b=Z(e=>{_.wasMoved(e)&&(i||l&&c.goToOption(fs.Nothing))}),x=Ke(()=>({active:l,selected:u,disabled:i}),[l,u,i]);return Jo({ourProps:{id:r,ref:m,role:`option`,tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":u,disabled:void 0,onClick:h,onFocus:g,onPointerEnter:v,onMouseEnter:v,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b},theirProps:o,slot:x,defaultTag:Hs,name:`Listbox.Option`})}var Ws=Qo(Ps),Gs=Qo(Is),Ks=Qo(Rs),qs=Qo(Vs),Js=Qo(Us),Ys=Object.assign(Ws,{Button:Gs,Label:Ks,Options:qs,Option:Js});function Xs(e=0){let[t,n]=P(e),r=_s();return{flags:t,addFlag:qe(e=>{r.current&&n(t=>t|e)},[t,r]),hasFlag:qe(e=>!!(t&e),[t]),removeFlag:qe(e=>{r.current&&n(t=>t&~e)},[n,r]),toggleFlag:qe(e=>{r.current&&n(t=>t^e)},[n])}}function Zs(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Qs(e,...t){e&&t.length>0&&e.classList.add(...t)}function $s(e,...t){e&&t.length>0&&e.classList.remove(...t)}function ec(e,t){let n=yo();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[a,o]=[r,i].map(e=>{let[t=0]=e.split(`,`).filter(Boolean).map(e=>e.includes(`ms`)?parseFloat(e):parseFloat(e)*1e3).sort((e,t)=>t-e);return t}),s=a+o;if(s!==0){n.group(n=>{n.setTimeout(()=>{t(),n.dispose()},s),n.addEventListener(e,`transitionrun`,e=>{e.target===e.currentTarget&&n.dispose()})});let r=n.addEventListener(e,`transitionend`,e=>{e.target===e.currentTarget&&(t(),r())})}else t();return n.add(()=>t()),n.dispose}function tc(e,t,n,r){let i=n?`enter`:`leave`,a=yo(),o=r===void 0?()=>{}:Zs(r);i===`enter`&&(e.removeAttribute(`hidden`),e.style.display=``);let s=Q(i,{enter:()=>t.enter,leave:()=>t.leave}),c=Q(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=Q(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return $s(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Qs(e,...t.base,...s,...l),a.nextFrame(()=>{$s(e,...t.base,...s,...l),Qs(e,...t.base,...s,...c),ec(e,()=>($s(e,...t.base,...s),Qs(e,...t.base,...t.entered),o()))}),a.dispose}function nc({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:a}){let o=_s(),s=bo(),c=ho(n);mo(()=>{e&&(c.current=`enter`)},[e]),mo(()=>{let e=yo();s.add(e.dispose);let n=t.current;if(n&&c.current!==`idle`&&o.current)return e.dispose(),i.current(c.current),e.add(tc(n,r.current,c.current===`enter`,()=>{e.dispose(),a.current(c.current)})),e.dispose},[n])}function rc(e=``){return e.split(/\s+/).filter(e=>e.length>1)}var ic=ve(null);ic.displayName=`TransitionContext`;var ac=(e=>(e.Visible=`visible`,e.Hidden=`hidden`,e))(ac||{});function oc(){let e=Je(ic);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}function sc(){let e=Je(cc);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}var cc=ve(null);cc.displayName=`NestingContext`;function lc(e){return`children`in e?lc(e.children):e.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e===`visible`).length>0}function uc(e,t){let n=ho(e),r=I([]),i=_s(),a=bo(),o=Z((e,t=qo.Hidden)=>{let o=r.current.findIndex(({el:t})=>t===e);o!==-1&&(Q(t,{[qo.Unmount](){r.current.splice(o,1)},[qo.Hidden](){r.current[o].state=`hidden`}}),a.microTask(()=>{var e;!lc(r)&&i.current&&((e=n.current)==null||e.call(n))}))}),s=Z(e=>{let t=r.current.find(({el:t})=>t===e);return t?t.state!==`visible`&&(t.state=`visible`):r.current.push({el:e,state:`visible`}),()=>o(e,qo.Unmount)}),c=I([]),l=I(Promise.resolve()),u=I({enter:[],leave:[],idle:[]}),d=Z((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),t?.chains.current[n].push([e,new Promise(e=>{c.current.push(e)})]),t?.chains.current[n].push([e,new Promise(e=>{Promise.all(u.current[n].map(([e,t])=>t)).then(()=>e())})]),n===`enter`?l.current=l.current.then(()=>t?.wait.current).then(()=>r(n)):r(n)}),f=Z((e,t,n)=>{Promise.all(u.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;(e=c.current.shift())==null||e()}).then(()=>n(t))});return Ke(()=>({children:r,register:s,unregister:o,onStart:d,onStop:f,wait:l,chains:u}),[s,o,r,d,f,u,l])}function dc(){}var fc=[`beforeEnter`,`afterEnter`,`beforeLeave`,`afterLeave`];function pc(e){let t={};for(let n of fc)t[n]=e[n]??dc;return t}function mc(e){let t=I(pc(e));return F(()=>{t.current=pc(e)},[e]),t}var hc=`div`,gc=Ko.RenderStrategy;function _c(e,t){var n;let{beforeEnter:r,afterEnter:i,beforeLeave:a,afterLeave:o,enter:s,enterFrom:c,enterTo:l,entered:u,leave:d,leaveFrom:f,leaveTo:p,...m}=e,h=I(null),g=Ho(h,t),_=(n=m.unmount)==null||n?qo.Unmount:qo.Hidden,{show:v,appear:y,initial:b}=oc(),[x,S]=P(v?`visible`:`hidden`),C=sc(),{register:w,unregister:T}=C;F(()=>w(h),[w,h]),F(()=>{if(_===qo.Hidden&&h.current){if(v&&x!==`visible`){S(`visible`);return}return Q(x,{hidden:()=>T(h),visible:()=>w(h)})}},[x,h,w,T,v,_]);let E=ho({base:rc(m.className),enter:rc(s),enterFrom:rc(c),enterTo:rc(l),entered:rc(u),leave:rc(d),leaveFrom:rc(f),leaveTo:rc(p)}),D=mc({beforeEnter:r,afterEnter:i,beforeLeave:a,afterLeave:o}),ee=So();F(()=>{if(ee&&x===`visible`&&h.current===null)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[h,x,ee]);let O=b&&!y,te=y&&v&&b,ne=!ee||O?`idle`:v?`enter`:`leave`,k=Xs(0),A=Z(e=>Q(e,{enter:()=>{k.addFlag(os.Opening),D.current.beforeEnter()},leave:()=>{k.addFlag(os.Closing),D.current.beforeLeave()},idle:()=>{}})),j=Z(e=>Q(e,{enter:()=>{k.removeFlag(os.Opening),D.current.afterEnter()},leave:()=>{k.removeFlag(os.Closing),D.current.afterLeave()},idle:()=>{}})),re=uc(()=>{S(`hidden`),T(h)},C),ie=I(!1);nc({immediate:te,container:h,classes:E,direction:ne,onStart:ho(e=>{ie.current=!0,re.onStart(h,e,A)}),onStop:ho(e=>{ie.current=!1,re.onStop(h,e,j),e===`leave`&&!lc(re)&&(S(`hidden`),T(h))})});let ae=m,oe={ref:g};return te?ae={...ae,className:Go(m.className,...E.current.enter,...E.current.enterFrom)}:ie.current&&(ae.className=Go(m.className,h.current?.className),ae.className===``&&delete ae.className),L.createElement(cc.Provider,{value:re},L.createElement(cs,{value:Q(x,{visible:os.Open,hidden:os.Closed})|k.flags},Jo({ourProps:oe,theirProps:ae,defaultTag:hc,features:gc,visible:x===`visible`,name:`Transition.Child`})))}function vc(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=I(null),s=Ho(o,t);So();let c=ss();if(n===void 0&&c!==null&&(n=(c&os.Open)===os.Open),![!0,!1].includes(n))throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,u]=P(n?`visible`:`hidden`),d=uc(()=>{u(`hidden`)}),[f,p]=P(!0),m=I([n]);mo(()=>{f!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),p(!1))},[m,n]);let h=Ke(()=>({show:n,appear:r,initial:f}),[n,r,f]);F(()=>{if(n)u(`visible`);else if(!lc(d))u(`hidden`);else{let e=o.current;if(!e)return;let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&u(`hidden`)}},[n,d]);let g={unmount:i},_=Z(()=>{var t;f&&p(!1),(t=e.beforeEnter)==null||t.call(e)}),v=Z(()=>{var t;f&&p(!1),(t=e.beforeLeave)==null||t.call(e)});return L.createElement(cc.Provider,{value:d},L.createElement(ic.Provider,{value:h},Jo({ourProps:{...g,as:w,children:L.createElement(xc,{ref:s,...g,...a,beforeEnter:_,beforeLeave:v})},theirProps:{},defaultTag:w,features:gc,visible:l===`visible`,name:`Transition`})))}function yc(e,t){let n=Je(ic)!==null,r=ss()!==null;return L.createElement(L.Fragment,null,!n&&r?L.createElement(bc,{ref:t,...e}):L.createElement(xc,{ref:t,...e}))}var bc=Qo(vc),xc=Qo(_c),Sc=Qo(yc),Cc=Object.assign(bc,{Child:Sc,Root:bc}),wc=di(Ys.Button)`
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flarehr/salpac-finops-admin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1008",
|
|
4
4
|
"description": "Salpac FinOps Admin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/"
|
|
8
8
|
],
|
|
9
9
|
"type": "module",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=24.14.0",
|
|
12
|
+
"npm": ">=11.11.1"
|
|
13
|
+
},
|
|
10
14
|
"babelMacros": {
|
|
11
15
|
"twin": {
|
|
12
16
|
"preset": "emotion"
|
|
@@ -46,18 +50,18 @@
|
|
|
46
50
|
"@testing-library/user-event": "^14.6.1",
|
|
47
51
|
"@types/jest": "^29.5.14",
|
|
48
52
|
"@types/preact-custom-element": "^4.0.4",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
50
|
-
"@typescript-eslint/parser": "^
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
54
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
51
55
|
"babel-plugin-macros": "^3.1.0",
|
|
52
56
|
"babel-plugin-twin": "^1.1.0",
|
|
53
57
|
"eslint": "^8.57.0",
|
|
54
58
|
"eslint-config-preact": "^1.4.0",
|
|
55
59
|
"eslint-config-prettier": "^9.1.0",
|
|
56
|
-
"eslint-plugin-jest": "^
|
|
60
|
+
"eslint-plugin-jest": "^29.15.0",
|
|
57
61
|
"eslint-plugin-prettier": "^5.1.3",
|
|
58
62
|
"husky": "^8.0.3",
|
|
59
63
|
"jest": "^29.7.0",
|
|
60
|
-
"jest-
|
|
64
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
61
65
|
"jsdom": "^24.1.0",
|
|
62
66
|
"prettier": "^3.3.2",
|
|
63
67
|
"tailwindcss": "^3.4.4",
|
|
@@ -66,5 +70,10 @@
|
|
|
66
70
|
"typescript": "^5.5.2",
|
|
67
71
|
"vite": "^8.0.1",
|
|
68
72
|
"vite-plugin-svgr": "^4.2.0"
|
|
73
|
+
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"jest-environment-jsdom": {
|
|
76
|
+
"jsdom": "^26.1.0"
|
|
77
|
+
}
|
|
69
78
|
}
|
|
70
79
|
}
|