{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAaM,SAAS,0CAAiC,CAAQ;IACvD,qFAAqF;IACrF,gEAAgE;IAChE,OAAO,CAAA,GAAA,yCAAY,MAAM,EAAE,MAAM,GAAG,EAAE,OAAO;AAC/C;AAEO,SAAS,0CAAe,aAA4C,EAAE,GAAQ;IACnF,IAAI,WAAW,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,OAAO,MAAM,EAAE,CAAC;IACxD,IAAI,aAAa,cAAc,OAAO,EAAE,QAAQ;IAChD,IAAI,YACF,WAAW,CAAC,kBAAkB,EAAE,IAAI,MAAM,CAAC,YAAY,EAAE,EAAE,UAAU;IAEvE,OAAO,cAAc,OAAO,EAAE,cAAc;AAC9C;AAEA,MAAM,sCAAgB,IAAI;AACnB,SAAS,0CAAgB,UAA2B;IACzD,IAAI,KAAK,CAAA,GAAA,yCAAI;IACb,oCAAc,GAAG,CAAC,YAAY;IAC9B,OAAO;AACT;AAEO,SAAS,0CAAgB,UAA2B;IACzD,OAAO,oCAAc,GAAG,CAAC;AAC3B","sources":["packages/react-aria/src/selection/utils.ts"],"sourcesContent":["/*\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\nimport {Collection, Key} from '@react-types/shared';\nimport {isAppleDevice} from '../utils/platform';\nimport {RefObject} from 'react';\nimport {useId} from '../utils/useId';\n\ninterface Event {\n  altKey: boolean,\n  ctrlKey: boolean,\n  metaKey: boolean\n}\n\nexport function isNonContiguousSelectionModifier(e: Event): boolean {\n  // Ctrl + Arrow Up/Arrow Down has a system wide meaning on macOS, so use Alt instead.\n  // On Windows and Ubuntu, Alt + Space has a system wide meaning.\n  return isAppleDevice() ? e.altKey : e.ctrlKey;\n}\n\nexport function getItemElement(collectionRef: RefObject<HTMLElement | null>, key: Key): Element | null | undefined {\n  let selector = `[data-key=\"${CSS.escape(String(key))}\"]`;\n  let collection = collectionRef.current?.dataset.collection;\n  if (collection) {\n    selector = `[data-collection=\"${CSS.escape(collection)}\"]${selector}`;\n  }\n  return collectionRef.current?.querySelector(selector);\n}\n\nconst collectionMap = new WeakMap<Collection<any>, string>();\nexport function useCollectionId(collection: Collection<any>): string {\n  let id = useId();\n  collectionMap.set(collection, id);\n  return id;\n}\n\nexport function getCollectionId(collection: Collection<any>): string {\n  return collectionMap.get(collection)!;\n}\n"],"names":[],"version":3,"file":"utils.mjs.map"}