{"version":3,"sources":["../../src/createRequestableStateScope/index.ts"],"names":["createScope_default","getAsyncState_default","set","createLoader_default","handleFetch"],"mappings":";;;;;;;;AAWA,IAAM,8BAUF,CACF,OAAA,EACA,kBACA,IACA,EAAA,SAAA,EACA,SACA,MAEA,KAAAA,qCAAA;AAAA,EACEC,uCAAA;AAAA,IACEC,qBAAA;AAAA,IACA,OAAA;AAAA,IACA,gBAAA;AAAA,IACA,IAAA;AAAA,IACAC,sCAAA,CAAaC,+BAAa,OAAO,CAAA;AAAA,IACjC,KAAA,CAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA;AAEJ,CAAA;AAEF,IAAO,mCAAQ,GAAA","file":"chunk-L6QHBY6F.cjs","sourcesContent":["import type {\n  StateInitializer,\n  RequestableStateOptions,\n  LoadableStateScope,\n} from '../types';\nimport createLoader from '../utils/createLoader';\nimport createScope from '../utils/createScope';\nimport getAsyncState from '../utils/getAsyncState';\nimport { handleFetch } from '../utils/handleFetch';\nimport { set } from '../utils/state/scope';\n\nconst createRequestableStateScope: {\n  /**\n   * Creates a {@link LoadableStateScope loadable state scope} that supports asynchronous data loading on request.\n   * The created state manages loading and error handling for data requests, providing\n   * a flexible way to manage request-based state updates.\n   */\n  <T, E = any>(\n    options: RequestableStateOptions<T, E>,\n    stateInitializer?: StateInitializer<T | undefined>\n  ): LoadableStateScope<T, E>;\n} = (\n  options: RequestableStateOptions<any, any, any[]>,\n  stateInitializer?: StateInitializer,\n  keys?: any[],\n  tickStart?: () => void,\n  tickEnd?: () => void,\n  parent?: any\n) =>\n  createScope(\n    getAsyncState(\n      set,\n      options,\n      stateInitializer,\n      keys,\n      createLoader(handleFetch, options),\n      undefined,\n      tickStart,\n      tickEnd,\n      parent\n    )\n  );\n\nexport default createRequestableStateScope;\n"]}