Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /**
  2. * Copyright 2018 Google Inc. All Rights Reserved.
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. * Unless required by applicable law or agreed to in writing, software
  8. * distributed under the License is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. * See the License for the specific language governing permissions and
  11. * limitations under the License.
  12. */
  13. // If the loader is already loaded, just stop.
  14. if (!self.define) {
  15. const singleRequire = (name) => {
  16. if (name !== 'require') {
  17. name = name + '.js'
  18. }
  19. let promise = Promise.resolve()
  20. if (!registry[name]) {
  21. promise = new Promise(async (resolve) => {
  22. if ('document' in self) {
  23. const script = document.createElement('script')
  24. script.src = name
  25. document.head.appendChild(script)
  26. script.onload = resolve
  27. } else {
  28. importScripts(name)
  29. resolve()
  30. }
  31. })
  32. }
  33. return promise.then(() => {
  34. if (!registry[name]) {
  35. throw new Error(`Module ${name} didn’t register its module`)
  36. }
  37. return registry[name]
  38. })
  39. }
  40. const require = (names, resolve) => {
  41. Promise.all(names.map(singleRequire)).then((modules) =>
  42. resolve(modules.length === 1 ? modules[0] : modules)
  43. )
  44. }
  45. const registry = {
  46. require: Promise.resolve(require),
  47. }
  48. self.define = (moduleName, depsNames, factory) => {
  49. if (registry[moduleName]) {
  50. // Module is already loading or loaded.
  51. return
  52. }
  53. registry[moduleName] = Promise.resolve().then(() => {
  54. let exports = {}
  55. const module = {
  56. uri: location.origin + moduleName.slice(1),
  57. }
  58. return Promise.all(
  59. depsNames.map((depName) => {
  60. switch (depName) {
  61. case 'exports':
  62. return exports
  63. case 'module':
  64. return module
  65. default:
  66. return singleRequire(depName)
  67. }
  68. })
  69. ).then((deps) => {
  70. const facValue = factory(...deps)
  71. if (!exports.default) {
  72. exports.default = facValue
  73. }
  74. return exports
  75. })
  76. })
  77. }
  78. }
  79. define('./sw.js', ['./workbox-6b19f60b'], function (workbox) {
  80. 'use strict'
  81. /**
  82. * Welcome to your Workbox-powered service worker!
  83. *
  84. * You'll need to register this file in your web app.
  85. * See https://goo.gl/nhQhGp
  86. *
  87. * The rest of the code is auto-generated. Please don't update this file
  88. * directly; instead, make changes to your Workbox build configuration
  89. * and re-run your build process.
  90. * See https://goo.gl/2aRDsh
  91. */
  92. importScripts()
  93. self.skipWaiting()
  94. workbox.clientsClaim()
  95. workbox.registerRoute(
  96. '/',
  97. new workbox.NetworkFirst({
  98. cacheName: 'start-url',
  99. plugins: [
  100. {
  101. cacheWillUpdate: async ({ request, response, event, state }) => {
  102. if (response && response.type === 'opaqueredirect') {
  103. return new Response(response.body, {
  104. status: 200,
  105. statusText: 'OK',
  106. headers: response.headers,
  107. })
  108. }
  109. return response
  110. },
  111. },
  112. ],
  113. }),
  114. 'GET'
  115. )
  116. workbox.registerRoute(
  117. /.*/i,
  118. new workbox.NetworkOnly({
  119. cacheName: 'dev',
  120. plugins: [],
  121. }),
  122. 'GET'
  123. )
  124. })
  125. //# sourceMappingURL=sw.js.map