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vC,MACZV,aAAciD,EAAKjD,aACnBsD,eAAgBL,EAAKK,eACrB0C,UAA0B,YAAf/C,EAAKhD,OAAsC,gBAAfgD,EAAKhD,OAA0C,YAAfgD,EAAKhD,OAAsC,cAAfgD,EAAKhD,MACxGgG,aAAchD,EAAKhD,MACnBgE,MAAOhB,EAAKgB,MACZ9D,WAAY8C,EAAK9C,WACjB+F,QAASzF,GACEwC,EAAKvC,MAAMyF,MAAMvF,GAAOd,EAAOc,KAAUH,IAEpD,MAAA2F,GACIhB,EAAc,CACVjC,KAAM,WACP4B,EACP,EACA,QAAAsB,GAEuB,gBAAfpD,EAAKhD,OAA0C,cAAfgD,EAAKhD,OAAwC,MAAfgD,EAAKpD,QACvEuF,EAAc,CACVjC,KAAM,eACP4B,EACP,EACA,IAAA3C,CAAMkB,GACF8B,EAAc,CACVjC,KAAM,UACNG,eAAgBA,GACjBlB,GAAQ2C,EACf,KACOrF,EAA2C,IAC3CoF,EACHhF,OAAQA,EACRD,OAAQoD,EAAKpD,SACbyF,IACA1F,EAAS,CACLuD,KAAM,SACNM,QAAS6B,GACX,IAEN,aAAApF,CAAeC,GACXiF,EAAc,CACVjC,KAAM,YACNhD,WAAYA,GACb4E,EACP,EAER,C","sources":["webpack://react-app/./node_modules/.pnpm/@react-stately+data@3.12.1_react@19.0.0/node_modules/@react-stately/data/dist/useListData.mjs","webpack://react-app/./node_modules/.pnpm/@react-stately+data@3.12.1_react@19.0.0/node_modules/@react-stately/data/dist/useAsyncList.mjs"],"sourcesContent":["import {useState as $bc4N1$useState, useMemo as $bc4N1$useMemo} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \nfunction $0d86e9c8f07f9a7b$export$762f73dccccd255d(options) {\n let { initialItems: initialItems = [], initialSelectedKeys: initialSelectedKeys, getKey: getKey = (item)=>{\n var _item_id;\n return (_item_id = item.id) !== null && _item_id !== void 0 ? _item_id : item.key;\n }, filter: filter, initialFilterText: initialFilterText = '' } = options;\n // Store both items and filteredItems in state so we can go back to the unfiltered list\n let [state, setState] = (0, $bc4N1$useState)({\n items: initialItems,\n selectedKeys: initialSelectedKeys === 'all' ? 'all' : new Set(initialSelectedKeys || []),\n filterText: initialFilterText\n });\n let filteredItems = (0, $bc4N1$useMemo)(()=>filter ? state.items.filter((item)=>filter(item, state.filterText)) : state.items, [\n state.items,\n state.filterText,\n filter\n ]);\n return {\n ...state,\n items: filteredItems,\n ...$0d86e9c8f07f9a7b$export$79c0c687a5963b0a({\n getKey: getKey\n }, setState),\n getItem (key) {\n return state.items.find((item)=>getKey(item) === key);\n }\n };\n}\nfunction $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {\n let { cursor: cursor, getKey: getKey } = opts;\n return {\n setSelectedKeys (selectedKeys) {\n dispatch((state)=>({\n ...state,\n selectedKeys: selectedKeys\n }));\n },\n setFilterText (filterText) {\n dispatch((state)=>({\n ...state,\n filterText: filterText\n }));\n },\n insert (index, ...values) {\n dispatch((state)=>$0d86e9c8f07f9a7b$var$insert(state, index, ...values));\n },\n insertBefore (key, ...values) {\n dispatch((state)=>{\n let index = state.items.findIndex((item)=>(getKey === null || getKey === void 0 ? void 0 : getKey(item)) === key);\n if (index === -1) {\n if (state.items.length === 0) index = 0;\n else return state;\n }\n return $0d86e9c8f07f9a7b$var$insert(state, index, ...values);\n });\n },\n insertAfter (key, ...values) {\n dispatch((state)=>{\n let index = state.items.findIndex((item)=>(getKey === null || getKey === void 0 ? void 0 : getKey(item)) === key);\n if (index === -1) {\n if (state.items.length === 0) index = 0;\n else return state;\n }\n return $0d86e9c8f07f9a7b$var$insert(state, index + 1, ...values);\n });\n },\n prepend (...values) {\n dispatch((state)=>$0d86e9c8f07f9a7b$var$insert(state, 0, ...values));\n },\n append (...values) {\n dispatch((state)=>$0d86e9c8f07f9a7b$var$insert(state, state.items.length, ...values));\n },\n remove (...keys) {\n dispatch((state)=>{\n let keySet = new Set(keys);\n let items = state.items.filter((item)=>!keySet.has(getKey(item)));\n let selection = 'all';\n if (state.selectedKeys !== 'all') {\n selection = new Set(state.selectedKeys);\n for (let key of keys)selection.delete(key);\n }\n if (cursor == null && items.length === 0) selection = new Set();\n return {\n ...state,\n items: items,\n selectedKeys: selection\n };\n });\n },\n removeSelectedItems () {\n dispatch((state)=>{\n if (state.selectedKeys === 'all') return {\n ...state,\n items: [],\n selectedKeys: new Set()\n };\n let selectedKeys = state.selectedKeys;\n let items = state.items.filter((item)=>!selectedKeys.has(getKey(item)));\n return {\n ...state,\n items: items,\n selectedKeys: new Set()\n };\n });\n },\n move (key, toIndex) {\n dispatch((state)=>{\n let index = state.items.findIndex((item)=>getKey(item) === key);\n if (index === -1) return state;\n let copy = state.items.slice();\n let [item] = copy.splice(index, 1);\n copy.splice(toIndex, 0, item);\n return {\n ...state,\n items: copy\n };\n });\n },\n moveBefore (key, keys) {\n dispatch((state)=>{\n let toIndex = state.items.findIndex((item)=>getKey(item) === key);\n if (toIndex === -1) return state;\n // Find indices of keys to move. Sort them so that the order in the list is retained.\n let keyArray = Array.isArray(keys) ? keys : [\n ...keys\n ];\n let indices = keyArray.map((key)=>state.items.findIndex((item)=>getKey(item) === key)).sort((a, b)=>a - b);\n return $0d86e9c8f07f9a7b$var$move(state, indices, toIndex);\n });\n },\n moveAfter (key, keys) {\n dispatch((state)=>{\n let toIndex = state.items.findIndex((item)=>getKey(item) === key);\n if (toIndex === -1) return state;\n let keyArray = Array.isArray(keys) ? keys : [\n ...keys\n ];\n let indices = keyArray.map((key)=>state.items.findIndex((item)=>getKey(item) === key)).sort((a, b)=>a - b);\n return $0d86e9c8f07f9a7b$var$move(state, indices, toIndex + 1);\n });\n },\n update (key, newValue) {\n dispatch((state)=>{\n let index = state.items.findIndex((item)=>getKey(item) === key);\n if (index === -1) return state;\n return {\n ...state,\n items: [\n ...state.items.slice(0, index),\n newValue,\n ...state.items.slice(index + 1)\n ]\n };\n });\n }\n };\n}\nfunction $0d86e9c8f07f9a7b$var$insert(state, index, ...values) {\n return {\n ...state,\n items: [\n ...state.items.slice(0, index),\n ...values,\n ...state.items.slice(index)\n ]\n };\n}\nfunction $0d86e9c8f07f9a7b$var$move(state, indices, toIndex) {\n // Shift the target down by the number of items being moved from before the target\n toIndex -= indices.filter((index)=>index < toIndex).length;\n let moves = indices.map((from)=>({\n from: from,\n to: toIndex++\n }));\n // Shift later from indices down if they have a larger index\n for(let i = 0; i < moves.length; i++){\n let a = moves[i].from;\n for(let j = i; j < moves.length; j++){\n let b = moves[j].from;\n if (b > a) moves[j].from--;\n }\n }\n // Interleave the moves so they can be applied one by one rather than all at once\n for(let i = 0; i < moves.length; i++){\n let a = moves[i];\n for(let j = moves.length - 1; j > i; j--){\n let b = moves[j];\n if (b.from < a.to) a.to++;\n else b.from++;\n }\n }\n let copy = state.items.slice();\n for (let move of moves){\n let [item] = copy.splice(move.from, 1);\n copy.splice(move.to, 0, item);\n }\n return {\n ...state,\n items: copy\n };\n}\n\n\nexport {$0d86e9c8f07f9a7b$export$762f73dccccd255d as useListData, $0d86e9c8f07f9a7b$export$79c0c687a5963b0a as createListActions};\n//# sourceMappingURL=useListData.module.js.map\n","import {createListActions as $0d86e9c8f07f9a7b$export$79c0c687a5963b0a} from \"./useListData.mjs\";\nimport {useReducer as $fh1mr$useReducer, useRef as $fh1mr$useRef, useEffect as $fh1mr$useEffect} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\nfunction $f86e6c1ec7da6ebb$var$reducer(data, action) {\n let selectedKeys;\n switch(data.state){\n case 'idle':\n case 'error':\n switch(action.type){\n case 'loading':\n case 'loadingMore':\n case 'sorting':\n case 'filtering':\n var _action_filterText, _action_sortDescriptor;\n return {\n ...data,\n filterText: (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText,\n state: action.type,\n // Reset items to an empty list if loading, but not when sorting.\n items: action.type === 'loading' ? [] : data.items,\n sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,\n abortController: action.abortController\n };\n case 'update':\n var _action_updater;\n return {\n ...data,\n ...(_action_updater = action.updater) === null || _action_updater === void 0 ? void 0 : _action_updater.call(action, data)\n };\n case 'success':\n case 'error':\n return data;\n default:\n throw new Error(`Invalid action \"${action.type}\" in state \"${data.state}\"`);\n }\n case 'loading':\n case 'sorting':\n case 'filtering':\n switch(action.type){\n case 'success':\n // Ignore if there is a newer abortcontroller in state.\n // This means that multiple requests were going at once.\n // We want to take only the latest result.\n if (action.abortController !== data.abortController) return data;\n var _action_selectedKeys;\n selectedKeys = (_action_selectedKeys = action.selectedKeys) !== null && _action_selectedKeys !== void 0 ? _action_selectedKeys : data.selectedKeys;\n var _action_filterText1, _action_items, _action_sortDescriptor1;\n return {\n ...data,\n filterText: (_action_filterText1 = action.filterText) !== null && _action_filterText1 !== void 0 ? _action_filterText1 : data.filterText,\n state: 'idle',\n items: [\n ...(_action_items = action.items) !== null && _action_items !== void 0 ? _action_items : []\n ],\n selectedKeys: selectedKeys === 'all' ? 'all' : new Set(selectedKeys),\n sortDescriptor: (_action_sortDescriptor1 = action.sortDescriptor) !== null && _action_sortDescriptor1 !== void 0 ? _action_sortDescriptor1 : data.sortDescriptor,\n abortController: undefined,\n cursor: action.cursor\n };\n case 'error':\n if (action.abortController !== data.abortController) return data;\n return {\n ...data,\n state: 'error',\n error: action.error,\n abortController: undefined\n };\n case 'loading':\n case 'loadingMore':\n case 'sorting':\n case 'filtering':\n var // We're already loading, and another load was triggered at the same time.\n // We need to abort the previous load and start a new one.\n _data_abortController;\n (_data_abortController = data.abortController) === null || _data_abortController === void 0 ? void 0 : _data_abortController.abort();\n var _action_filterText2;\n return {\n ...data,\n filterText: (_action_filterText2 = action.filterText) !== null && _action_filterText2 !== void 0 ? _action_filterText2 : data.filterText,\n state: action.type,\n // Reset items to an empty list if loading, but not when sorting.\n items: action.type === 'loading' ? [] : data.items,\n abortController: action.abortController\n };\n case 'update':\n var _action_updater1;\n // We're already loading, and an update happened at the same time (e.g. selectedKey changed).\n // Update data but don't abort previous load.\n return {\n ...data,\n ...(_action_updater1 = action.updater) === null || _action_updater1 === void 0 ? void 0 : _action_updater1.call(action, data)\n };\n default:\n throw new Error(`Invalid action \"${action.type}\" in state \"${data.state}\"`);\n }\n case 'loadingMore':\n switch(action.type){\n case 'success':\n var _action_selectedKeys1;\n selectedKeys = data.selectedKeys === 'all' || action.selectedKeys === 'all' ? 'all' : new Set([\n ...data.selectedKeys,\n ...(_action_selectedKeys1 = action.selectedKeys) !== null && _action_selectedKeys1 !== void 0 ? _action_selectedKeys1 : []\n ]);\n var _action_items1, _action_sortDescriptor2;\n // Append the new items\n return {\n ...data,\n state: 'idle',\n items: [\n ...data.items,\n ...(_action_items1 = action.items) !== null && _action_items1 !== void 0 ? _action_items1 : []\n ],\n selectedKeys: selectedKeys,\n sortDescriptor: (_action_sortDescriptor2 = action.sortDescriptor) !== null && _action_sortDescriptor2 !== void 0 ? _action_sortDescriptor2 : data.sortDescriptor,\n abortController: undefined,\n cursor: action.cursor\n };\n case 'error':\n if (action.abortController !== data.abortController) return data;\n return {\n ...data,\n state: 'error',\n error: action.error\n };\n case 'loading':\n case 'sorting':\n case 'filtering':\n var // We're already loading more, and another load was triggered at the same time.\n // We need to abort the previous load more and start a new one.\n _data_abortController1;\n (_data_abortController1 = data.abortController) === null || _data_abortController1 === void 0 ? void 0 : _data_abortController1.abort();\n var _action_filterText3;\n return {\n ...data,\n filterText: (_action_filterText3 = action.filterText) !== null && _action_filterText3 !== void 0 ? _action_filterText3 : data.filterText,\n state: action.type,\n // Reset items to an empty list if loading, but not when sorting.\n items: action.type === 'loading' ? [] : data.items,\n abortController: action.abortController\n };\n case 'loadingMore':\n var // If already loading more and another loading more is triggered, abort the new load more since\n // it is a duplicate request since the cursor hasn't been updated.\n // Do not overwrite the data.abortController\n _action_abortController;\n (_action_abortController = action.abortController) === null || _action_abortController === void 0 ? void 0 : _action_abortController.abort();\n return data;\n case 'update':\n var _action_updater2;\n // We're already loading, and an update happened at the same time (e.g. selectedKey changed).\n // Update data but don't abort previous load.\n return {\n ...data,\n ...(_action_updater2 = action.updater) === null || _action_updater2 === void 0 ? void 0 : _action_updater2.call(action, data)\n };\n default:\n throw new Error(`Invalid action \"${action.type}\" in state \"${data.state}\"`);\n }\n default:\n throw new Error(`Invalid state \"${data.state}\"`);\n }\n}\nfunction $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {\n const { load: load, sort: sort, initialSelectedKeys: initialSelectedKeys, initialSortDescriptor: initialSortDescriptor, getKey: getKey = (item)=>item.id || item.key, initialFilterText: initialFilterText = '' } = options;\n let [data, dispatch] = (0, $fh1mr$useReducer)($f86e6c1ec7da6ebb$var$reducer, {\n state: 'idle',\n error: undefined,\n items: [],\n selectedKeys: initialSelectedKeys === 'all' ? 'all' : new Set(initialSelectedKeys),\n sortDescriptor: initialSortDescriptor,\n filterText: initialFilterText\n });\n const dispatchFetch = async (action, fn)=>{\n let abortController = new AbortController();\n try {\n dispatch({\n ...action,\n abortController: abortController\n });\n var _action_filterText;\n let previousFilterText = (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText;\n var _action_sortDescriptor;\n let response = await fn({\n items: data.items.slice(),\n selectedKeys: data.selectedKeys,\n sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,\n signal: abortController.signal,\n cursor: action.type === 'loadingMore' ? data.cursor : undefined,\n filterText: previousFilterText\n });\n var _response_filterText;\n let filterText = (_response_filterText = response.filterText) !== null && _response_filterText !== void 0 ? _response_filterText : previousFilterText;\n dispatch({\n type: 'success',\n ...response,\n abortController: abortController\n });\n // Fetch a new filtered list if filterText is updated via `load` response func rather than list.setFilterText\n // Only do this if not aborted (e.g. user triggers another filter action before load completes)\n if (filterText && filterText !== previousFilterText && !abortController.signal.aborted) dispatchFetch({\n type: 'filtering',\n filterText: filterText\n }, load);\n } catch (e) {\n dispatch({\n type: 'error',\n error: e,\n abortController: abortController\n });\n }\n };\n let didDispatchInitialFetch = (0, $fh1mr$useRef)(false);\n (0, $fh1mr$useEffect)(()=>{\n if (!didDispatchInitialFetch.current) {\n dispatchFetch({\n type: 'loading'\n }, load);\n didDispatchInitialFetch.current = true;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return {\n items: data.items,\n selectedKeys: data.selectedKeys,\n sortDescriptor: data.sortDescriptor,\n isLoading: data.state === 'loading' || data.state === 'loadingMore' || data.state === 'sorting' || data.state === 'filtering',\n loadingState: data.state,\n error: data.error,\n filterText: data.filterText,\n getItem (key) {\n return data.items.find((item)=>getKey(item) === key);\n },\n reload () {\n dispatchFetch({\n type: 'loading'\n }, load);\n },\n loadMore () {\n // Ignore if already loading more or if performing server side filtering.\n if (data.state === 'loadingMore' || data.state === 'filtering' || data.cursor == null) return;\n dispatchFetch({\n type: 'loadingMore'\n }, load);\n },\n sort (sortDescriptor) {\n dispatchFetch({\n type: 'sorting',\n sortDescriptor: sortDescriptor\n }, sort || load);\n },\n ...(0, $0d86e9c8f07f9a7b$export$79c0c687a5963b0a)({\n ...options,\n getKey: getKey,\n cursor: data.cursor\n }, (fn)=>{\n dispatch({\n type: 'update',\n updater: fn\n });\n }),\n setFilterText (filterText) {\n dispatchFetch({\n type: 'filtering',\n filterText: filterText\n }, load);\n }\n };\n}\n\n\nexport {$f86e6c1ec7da6ebb$export$bc3384a35de93d66 as useAsyncList};\n//# sourceMappingURL=useAsyncList.module.js.map\n"],"names":["$0d86e9c8f07f9a7b$export$79c0c687a5963b0a","opts","dispatch","cursor","getKey","setSelectedKeys","selectedKeys","state","setFilterText","filterText","insert","index","values","$0d86e9c8f07f9a7b$var$insert","insertBefore","key","items","findIndex","item","length","insertAfter","prepend","append","remove","keys","keySet","Set","filter","has","selection","delete","removeSelectedItems","move","toIndex","copy","slice","splice","moveBefore","indices","Array","isArray","map","sort","a","b","$0d86e9c8f07f9a7b$var$move","moveAfter","update","newValue","moves","from","to","i","j","$f86e6c1ec7da6ebb$var$reducer","data","action","type","_action_filterText","_action_sortDescriptor","sortDescriptor","abortController","_action_updater","updater","call","Error","_action_selectedKeys","_action_filterText1","_action_items","_action_sortDescriptor1","undefined","error","_data_abortController","_action_filterText2","abort","_action_updater1","_action_selectedKeys1","_action_items1","_action_sortDescriptor2","_data_abortController1","_action_filterText3","_action_abortController","_action_updater2","$f86e6c1ec7da6ebb$export$bc3384a35de93d66","options","load","initialSelectedKeys","initialSortDescriptor","id","initialFilterText","dispatchFetch","async","fn","AbortController","previousFilterText","response","signal","_response_filterText","aborted","e","didDispatchInitialFetch","current","isLoading","loadingState","getItem","find","reload","loadMore"],"sourceRoot":""}