{"version":3,"sources":["sortable/overview/App.tsx","serviceWorker.ts","index.tsx"],"names":["App","init","sortable","document","getElementById","addEventListener","event","detail","value","dragMode","handleVisibility","readyState","window","onload","className","id","items","Boolean","location","hostname","match","ReactDOM","render","navigator","serviceWorker","ready","then","registration","unregister"],"mappings":"kJAgEeA,G,sBAhDO,WAGpB,SAASC,IACP,IAAMC,EAAgBC,SAASC,eAAe,YAE1BD,SAASC,eAAe,UACrCC,iBAAiB,UAAU,SAAUC,GACtCA,EAAMC,OAAOC,OACfN,EAASO,SAAW,SACpBP,EAASQ,iBAAmB,WAE5BR,EAASO,SAAW,UAK1B,MAhBwB,aAAxBN,SAASQ,WAA4BV,IAASW,OAAOC,OAASZ,EAiB5D,yBAAKa,UAAU,OACb,kEACA,oCAAgBC,GAAG,WAAWC,MAAM,MAClC,4BACE,4CACA,qCACA,0CACA,sCACA,uCACA,sCACA,0CACA,uCACA,2CACA,uCACA,wCACA,oCACA,2CACA,2CACA,wCAGJ,yBAAKF,UAAU,WACb,qCAAiBC,GAAG,UAClB,yDC7CUE,QACW,cAA7BL,OAAOM,SAASC,UAEe,UAA7BP,OAAOM,SAASC,UAEhBP,OAAOM,SAASC,SAASC,MACvB,2DCZNC,IAASC,OAAO,kBAAC,EAAD,MAASnB,SAASC,eAAe,SDmI3C,kBAAmBmB,WACrBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GACjCA,EAAaC,iB","file":"static/js/main.83527da8.chunk.js","sourcesContent":["import React from \"react\";\nimport \"./App.css\";\n\nimport \"@smarthtmlelements/smart-elements/source/modules/smart.button.js\";\nimport \"@smarthtmlelements/smart-elements/source/modules/smart.sortable.js\";\n\ndeclare global {\n // eslint-disable-next-line\n namespace JSX {\n interface IntrinsicElements {\n \"smart-sortable\": any;\n \"smart-check-box\": any;\n }\n }\n}\n\nconst App: React.FC = () => {\n document.readyState === 'complete' ? init() : window.onload = init;\n\n function init() {\n const sortable: any = document.getElementById(\"sortable\");\n\n const handle: any = document.getElementById(\"handle\");\n handle.addEventListener(\"change\", function (event: any) {\n if (event.detail.value) {\n sortable.dragMode = \"handle\";\n sortable.handleVisibility = \"visible\";\n } else {\n sortable.dragMode = \"item\";\n }\n });\n }\n \n return (\n
\n Drag and drop to change list order\n \n
    \n
  1. Strawberries
  2. \n
  3. Mango
  4. \n
  5. Watermelon
  6. \n
  7. Apples
  8. \n
  9. Bananas
  10. \n
  11. Grapes
  12. \n
  13. Pineapples
  14. \n
  15. Oranges
  16. \n
  17. Raspberries
  18. \n
  19. Peaches
  20. \n
  21. Cherries
  22. \n
  23. Kiwi
  24. \n
  25. Blueberries
  26. \n
  27. Pomegranate
  28. \n
  29. Lemons
  30. \n
\n
\n
\n \n drag-mode=\"handle\"\n \n
\n
\n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(\n (process as { env: { [key: string]: string } }).env.PUBLIC_URL,\n window.location.href\n );\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './sortable/overview/App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}