-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.debug.js
More file actions
1 lines (1 loc) · 3.42 KB
/
Copy pathsw.debug.js
File metadata and controls
1 lines (1 loc) · 3.42 KB
1
!function(e){var t={};function n(s){if(t[s])return t[s].exports;var o=t[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(s,o,function(t){return e[t]}.bind(null,o));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e){e.exports=JSON.parse('["I’m","you’re","he’s","she’s","we’re","it’s","isn’t","aren’t","they’re","there’s","wasn’t","weren’t","I’ve","you’ve","we’ve","they’ve","hasn’t","haven’t","I’d","you\'d","he’d","she’d","it’d","we’d","they’d","doesn’t","don’t","didn’t","I’ll","you’ll","he’ll","she’ll","we’ll","they’ll","there’ll","there’d","can’t","couldn’t","daren’t","hadn’t","mightn’t","mustn’t","needn’t","oughtn’t","shan’t","shouldn’t","usedn’t","won’t","wouldn’t","who’s","who’d","who’ll","what’s","what’ll","how’s","where’s","when’s","here’s","there’s","that’s","I\'m","you\'re","he\'s","she\'s","we\'re","it\'s","isn\'t","aren\'t","they\'re","there\'s","wasn\'t","weren\'t","I\'ve","you\'ve","we\'ve","they\'ve","hasn\'t","haven\'t","I\'d","you\'d","he\'d","she\'d","it\'d","we\'d","they\'d","doesn\'t","don\'t","didn\'t","I\'ll","you\'ll","he\'ll","she\'ll","we\'ll","they\'ll","there\'ll","there\'d","can\'t","couldn\'t","daren\'t","hadn\'t","mightn\'t","mustn\'t","needn\'t","oughtn\'t","shan\'t","shouldn\'t","usedn\'t","won\'t","wouldn\'t","who\'s","who\'d","who\'ll","what\'s","what\'ll","how\'s","where\'s","when\'s","here\'s","there\'s","that\'s"]')},function(e,t,n){"use strict";n.r(t);var s=n(0);const o={dataset:{}};function l(e){self.clients.matchAll({includeUncontrolled:!0,type:"window"}).then(t=>{t&&t.length&&t[0].postMessage({action:"misspelled",...e})})}function r(e,t,n){let r=[];for(const e of t.split(" ")){const t=e.trim().toLowerCase();-1===s.indexOf(t)&&r.push(e)}if(t=r.join(" "),r=t.match(/\b(\w+)\b/g),r){const t=[];let s=function(e){let t=e.map(e=>({original:e,lower:e.toLowerCase()}));return t=t.filter(e=>e.original.length>=2),[...new Set(t)]}(r);s=s.filter(e=>!/[^a-z]/.test(e.lower));for(const e of s)e.lower.match(/\d+/g)&&t.push(e.original);if(s.length){const r=async a=>{const i=a.lower.substring(0,2);i&&(o.dataset[i]||await async function(e){try{const t=await fetch(`assets/words/${e}.json`),n=await t.json();o.dataset[e]=n}catch(e){console.log(e)}}(i),o.dataset[i]&&-1===o.dataset[i].indexOf(a.lower)&&t.push(a.original)),s.length?r(s.shift()):l({node:e,result:t,isLast:n})};r(s.shift())}else l({node:e,result:[],isLast:n})}else l({node:e,result:[],isLast:n})}self.addEventListener("message",e=>{e.data&&"checkString"===e.data.action&&r(e.data.node,e.data.string,e.data.isLast)}),self.addEventListener("install",e=>{e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>{e.waitUntil(self.clients.claim())})}]);