securemark 0.224.0 → 0.225.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! securemark v0.224.0 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED */
1
+ /*! securemark v0.225.2 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED */
2
2
  require = function () {
3
3
  function r(e, n, t) {
4
4
  function o(i, f) {
@@ -215,21 +215,52 @@ require = function () {
215
215
  function (_dereq_, module, exports) {
216
216
  'use strict';
217
217
  Object.defineProperty(exports, '__esModule', { value: true });
218
- exports.aggregate = exports.bundle = void 0;
219
- function bundle(...as) {
218
+ exports.compile = exports.aggregate = exports.bundle = void 0;
219
+ const function_1 = _dereq_('./function');
220
+ function bundle(...fs) {
220
221
  return function (...bs) {
221
- return as.map((f, i) => f.call(this, bs[i]));
222
+ return fs.map((f, i) => f.call(this, bs[i]));
222
223
  };
223
224
  }
224
225
  exports.bundle = bundle;
225
- function aggregate(...as) {
226
- return function (b) {
227
- return as.map(f => f.call(this, b));
226
+ function aggregate(...fs) {
227
+ return function (a) {
228
+ return fs.map(f => f.call(this, a));
228
229
  };
229
230
  }
230
231
  exports.aggregate = aggregate;
232
+ function compile(...fs) {
233
+ return function (a) {
234
+ var _a;
235
+ const gs = [];
236
+ try {
237
+ for (let i = 0; i < fs.length; ++i) {
238
+ gs.push(fs[i].call(this, a));
239
+ }
240
+ return (0, function_1.singleton)(() => cancel(gs));
241
+ } catch (reason) {
242
+ cancel(gs);
243
+ throw new Error(`Spica: Arrow: ${ (_a = reason === null || reason === void 0 ? void 0 : reason.toString()) !== null && _a !== void 0 ? _a : reason }`);
244
+ }
245
+ };
246
+ }
247
+ exports.compile = compile;
248
+ function cancel(cancellers) {
249
+ const reasons = [];
250
+ for (let i = 0; i < cancellers.length; ++i) {
251
+ try {
252
+ cancellers[i]();
253
+ } catch (reason) {
254
+ reasons.push(reason);
255
+ }
256
+ }
257
+ if (reasons.length > 0) {
258
+ throw new AggregateError(reasons);
259
+ }
260
+ return;
261
+ }
231
262
  },
232
- {}
263
+ { './function': 16 }
233
264
  ],
234
265
  8: [
235
266
  function (_dereq_, module, exports) {
@@ -835,7 +866,7 @@ require = function () {
835
866
  exports.uncurry = uncurry;
836
867
  function uncurry_(f) {
837
868
  const arity = f.length;
838
- return (...xs) => arity === 0 || xs.length < 2 || xs.length <= arity ? f(...xs) : uncurry_(f(...(0, array_1.shift)(xs, arity)[0]))(...xs);
869
+ return (...xs) => arity === 0 || xs.length <= arity ? f(...xs) : uncurry_(f(...(0, array_1.shift)(xs, arity)[0]))(...xs);
839
870
  }
840
871
  },
841
872
  { './array': 6 }
@@ -869,9 +900,7 @@ require = function () {
869
900
  function (_dereq_, module, exports) {
870
901
  'use strict';
871
902
  Object.defineProperty(exports, '__esModule', { value: true });
872
- exports.run = exports.clear = exports.mapReturn = exports.mapParameters = exports.singleton = void 0;
873
- const global_1 = _dereq_('./global');
874
- const exception_1 = _dereq_('./exception');
903
+ exports.clear = exports.singleton = void 0;
875
904
  const noop_1 = _dereq_('./noop');
876
905
  function singleton(f) {
877
906
  let result;
@@ -884,55 +913,12 @@ require = function () {
884
913
  };
885
914
  }
886
915
  exports.singleton = singleton;
887
- function mapParameters(f, g) {
888
- return (...as) => f(...g(...as));
889
- }
890
- exports.mapParameters = mapParameters;
891
- function mapReturn(f, g) {
892
- return (...as) => g(f(...as));
893
- }
894
- exports.mapReturn = mapReturn;
895
916
  function clear(f) {
896
917
  return (...as) => void f(...as);
897
918
  }
898
919
  exports.clear = clear;
899
- function run(fs) {
900
- const gs = (0, global_1.Array)(fs.length);
901
- try {
902
- for (let i = 0; i < fs.length; ++i) {
903
- gs[i] = fs[i]();
904
- }
905
- } catch (reason) {
906
- for (let i = 0; gs[i]; ++i) {
907
- try {
908
- gs[i]();
909
- } catch (reason) {
910
- (0, exception_1.causeAsyncException)(reason);
911
- }
912
- }
913
- throw reason;
914
- }
915
- return singleton(() => {
916
- const rs = [];
917
- for (let i = 0; gs[i]; ++i) {
918
- try {
919
- gs[i]();
920
- } catch (reason) {
921
- rs.push(reason);
922
- }
923
- }
924
- if (rs.length > 0) {
925
- throw new AggregateError(rs);
926
- }
927
- });
928
- }
929
- exports.run = run;
930
920
  },
931
- {
932
- './exception': 14,
933
- './global': 17,
934
- './noop': 22
935
- }
921
+ { './noop': 22 }
936
922
  ],
937
923
  17: [
938
924
  function (_dereq_, module, exports) {
@@ -2165,7 +2151,7 @@ require = function () {
2165
2151
  }
2166
2152
  exports.join = join;
2167
2153
  },
2168
- { './global': 9 }
2154
+ { './global': 8 }
2169
2155
  ],
2170
2156
  6: [
2171
2157
  function (_dereq_, module, exports) {
@@ -2183,21 +2169,7 @@ require = function () {
2183
2169
  function (_dereq_, module, exports) {
2184
2170
  'use strict';
2185
2171
  Object.defineProperty(exports, '__esModule', { value: true });
2186
- exports.causeAsyncException = void 0;
2187
- function causeAsyncException(reason) {
2188
- void Promise.reject(reason);
2189
- }
2190
- exports.causeAsyncException = causeAsyncException;
2191
- },
2192
- {}
2193
- ],
2194
- 8: [
2195
- function (_dereq_, module, exports) {
2196
- 'use strict';
2197
- Object.defineProperty(exports, '__esModule', { value: true });
2198
- exports.run = exports.clear = exports.mapReturn = exports.mapParameters = exports.singleton = void 0;
2199
- const global_1 = _dereq_('./global');
2200
- const exception_1 = _dereq_('./exception');
2172
+ exports.clear = exports.singleton = void 0;
2201
2173
  const noop_1 = _dereq_('./noop');
2202
2174
  function singleton(f) {
2203
2175
  let result;
@@ -2210,57 +2182,14 @@ require = function () {
2210
2182
  };
2211
2183
  }
2212
2184
  exports.singleton = singleton;
2213
- function mapParameters(f, g) {
2214
- return (...as) => f(...g(...as));
2215
- }
2216
- exports.mapParameters = mapParameters;
2217
- function mapReturn(f, g) {
2218
- return (...as) => g(f(...as));
2219
- }
2220
- exports.mapReturn = mapReturn;
2221
2185
  function clear(f) {
2222
2186
  return (...as) => void f(...as);
2223
2187
  }
2224
2188
  exports.clear = clear;
2225
- function run(fs) {
2226
- const gs = (0, global_1.Array)(fs.length);
2227
- try {
2228
- for (let i = 0; i < fs.length; ++i) {
2229
- gs[i] = fs[i]();
2230
- }
2231
- } catch (reason) {
2232
- for (let i = 0; gs[i]; ++i) {
2233
- try {
2234
- gs[i]();
2235
- } catch (reason) {
2236
- (0, exception_1.causeAsyncException)(reason);
2237
- }
2238
- }
2239
- throw reason;
2240
- }
2241
- return singleton(() => {
2242
- const rs = [];
2243
- for (let i = 0; gs[i]; ++i) {
2244
- try {
2245
- gs[i]();
2246
- } catch (reason) {
2247
- rs.push(reason);
2248
- }
2249
- }
2250
- if (rs.length > 0) {
2251
- throw new AggregateError(rs);
2252
- }
2253
- });
2254
- }
2255
- exports.run = run;
2256
2189
  },
2257
- {
2258
- './exception': 7,
2259
- './global': 9,
2260
- './noop': 11
2261
- }
2190
+ { './noop': 10 }
2262
2191
  ],
2263
- 9: [
2192
+ 8: [
2264
2193
  function (_dereq_, module, exports) {
2265
2194
  'use strict';
2266
2195
  const global = void 0 || typeof globalThis !== 'undefined' && globalThis || typeof self !== 'undefined' && self || Function('return this')();
@@ -2269,7 +2198,7 @@ require = function () {
2269
2198
  },
2270
2199
  {}
2271
2200
  ],
2272
- 10: [
2201
+ 9: [
2273
2202
  function (_dereq_, module, exports) {
2274
2203
  'use strict';
2275
2204
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -2310,10 +2239,10 @@ require = function () {
2310
2239
  },
2311
2240
  {
2312
2241
  './compare': 6,
2313
- './global': 9
2242
+ './global': 8
2314
2243
  }
2315
2244
  ],
2316
- 11: [
2245
+ 10: [
2317
2246
  function (_dereq_, module, exports) {
2318
2247
  'use strict';
2319
2248
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -2324,7 +2253,7 @@ require = function () {
2324
2253
  },
2325
2254
  {}
2326
2255
  ],
2327
- 12: [
2256
+ 11: [
2328
2257
  function (_dereq_, module, exports) {
2329
2258
  'use strict';
2330
2259
  var _a, _b;
@@ -2671,11 +2600,11 @@ require = function () {
2671
2600
  },
2672
2601
  {
2673
2602
  './alias': 4,
2674
- './global': 9,
2675
- './noop': 11
2603
+ './global': 8,
2604
+ './noop': 10
2676
2605
  }
2677
2606
  ],
2678
- 13: [
2607
+ 12: [
2679
2608
  function (_dereq_, module, exports) {
2680
2609
  'use strict';
2681
2610
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -2757,9 +2686,9 @@ require = function () {
2757
2686
  }
2758
2687
  }
2759
2688
  },
2760
- { './global': 9 }
2689
+ { './global': 8 }
2761
2690
  ],
2762
- 14: [
2691
+ 13: [
2763
2692
  function (_dereq_, module, exports) {
2764
2693
  'use strict';
2765
2694
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -2812,12 +2741,12 @@ require = function () {
2812
2741
  }
2813
2742
  },
2814
2743
  {
2815
- './proxy': 15,
2816
- './util/dom': 16,
2744
+ './proxy': 14,
2745
+ './util/dom': 15,
2817
2746
  'spica/alias': 4
2818
2747
  }
2819
2748
  ],
2820
- 15: [
2749
+ 14: [
2821
2750
  function (_dereq_, module, exports) {
2822
2751
  'use strict';
2823
2752
  var _a, _b, _c, _d;
@@ -3121,14 +3050,14 @@ require = function () {
3121
3050
  }
3122
3051
  },
3123
3052
  {
3124
- './util/dom': 16,
3125
- './util/identity': 17,
3053
+ './util/dom': 15,
3054
+ './util/identity': 16,
3126
3055
  'spica/alias': 4,
3127
3056
  'spica/array': 5,
3128
- 'spica/global': 9
3057
+ 'spica/global': 8
3129
3058
  }
3130
3059
  ],
3131
- 16: [
3060
+ 15: [
3132
3061
  function (_dereq_, module, exports) {
3133
3062
  'use strict';
3134
3063
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -3196,18 +3125,22 @@ require = function () {
3196
3125
  case 'function':
3197
3126
  if (name.length < 3)
3198
3127
  throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${ name }".`);
3199
- if (name.slice(0, 2) !== 'on')
3200
- throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${ name }".`);
3201
- el.addEventListener(name.slice(2), value, {
3202
- passive: [
3203
- 'wheel',
3204
- 'mousewheel',
3205
- 'touchstart',
3206
- 'touchmove',
3207
- 'touchend',
3208
- 'touchcancel'
3209
- ].includes(name.slice(2))
3210
- });
3128
+ const names = name.split(/\s+/);
3129
+ for (let i = 0; i < names.length; ++i) {
3130
+ const name = names[i];
3131
+ if (name.slice(0, 2) !== 'on')
3132
+ throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${ name }".`);
3133
+ el.addEventListener(name.slice(2), value, {
3134
+ passive: [
3135
+ 'wheel',
3136
+ 'mousewheel',
3137
+ 'touchstart',
3138
+ 'touchmove',
3139
+ 'touchend',
3140
+ 'touchcancel'
3141
+ ].includes(name.slice(2))
3142
+ });
3143
+ }
3211
3144
  continue;
3212
3145
  case 'object':
3213
3146
  el.removeAttribute(name);
@@ -3242,11 +3175,11 @@ require = function () {
3242
3175
  },
3243
3176
  {
3244
3177
  'spica/alias': 4,
3245
- 'spica/global': 9,
3246
- 'spica/memoize': 10
3178
+ 'spica/global': 8,
3179
+ 'spica/memoize': 9
3247
3180
  }
3248
3181
  ],
3249
- 17: [
3182
+ 16: [
3250
3183
  function (_dereq_, module, exports) {
3251
3184
  'use strict';
3252
3185
  var _a;
@@ -3258,11 +3191,11 @@ require = function () {
3258
3191
  exports.identity = (0, random_1.unique)(random_1.rnd0Z, 2, (_a = global_1.global[ids]) !== null && _a !== void 0 ? _a : global_1.global[ids] = new global_1.Set());
3259
3192
  },
3260
3193
  {
3261
- 'spica/global': 9,
3262
- 'spica/random': 13
3194
+ 'spica/global': 8,
3195
+ 'spica/random': 12
3263
3196
  }
3264
3197
  ],
3265
- 18: [
3198
+ 17: [
3266
3199
  function (_dereq_, module, exports) {
3267
3200
  'use strict';
3268
3201
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -3313,12 +3246,12 @@ require = function () {
3313
3246
  exports.bind = bind;
3314
3247
  },
3315
3248
  {
3316
- 'spica/function': 8,
3317
- 'spica/noop': 11,
3318
- 'spica/promise': 12
3249
+ 'spica/function': 7,
3250
+ 'spica/noop': 10,
3251
+ 'spica/promise': 11
3319
3252
  }
3320
3253
  ],
3321
- 19: [
3254
+ 18: [
3322
3255
  function (_dereq_, module, exports) {
3323
3256
  'use strict';
3324
3257
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -3333,7 +3266,7 @@ require = function () {
3333
3266
  }
3334
3267
  exports.apply = apply;
3335
3268
  },
3336
- { './dom': 16 }
3269
+ { './dom': 15 }
3337
3270
  ],
3338
3271
  'typed-dom': [
3339
3272
  function (_dereq_, module, exports) {
@@ -3475,13 +3408,13 @@ require = function () {
3475
3408
  });
3476
3409
  },
3477
3410
  {
3478
- './src/builder': 14,
3479
- './src/proxy': 15,
3480
- './src/util/dom': 16,
3481
- './src/util/identity': 17,
3482
- './src/util/listener': 18,
3483
- './src/util/query': 19,
3484
- 'spica/global': 9
3411
+ './src/builder': 13,
3412
+ './src/proxy': 14,
3413
+ './src/util/dom': 15,
3414
+ './src/util/identity': 16,
3415
+ './src/util/listener': 17,
3416
+ './src/util/query': 18,
3417
+ 'spica/global': 8
3485
3418
  }
3486
3419
  ]
3487
3420
  }, {}, [
@@ -7033,7 +6966,7 @@ require = function () {
7033
6966
  const typed_dom_1 = _dereq_('typed-dom');
7034
6967
  const array_1 = _dereq_('spica/array');
7035
6968
  exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, '~~')]), (0, source_1.str)('~~'), false, ([, bs], rest) => [
7036
- [(0, typed_dom_1.html)('del', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))],
6969
+ [(0, typed_dom_1.html)('del', (0, typed_dom_1.defrag)((0, util_1.trimNodeEndBR)(bs)))],
7037
6970
  rest
7038
6971
  ], ([as, bs], rest) => [
7039
6972
  (0, array_1.unshift)(as, bs),
@@ -7065,7 +6998,7 @@ require = function () {
7065
6998
  strong_1.strong,
7066
6999
  (0, combinator_1.some)(inline_1.inline, '*')
7067
7000
  ]))), (0, source_1.str)('*'), false, ([as, bs, cs], rest) => (0, util_1.isEndTightNodes)(bs) ? [
7068
- [(0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))],
7001
+ [(0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)(bs))],
7069
7002
  rest
7070
7003
  ] : [
7071
7004
  (0, array_1.unshift)(as, bs),
@@ -7106,41 +7039,41 @@ require = function () {
7106
7039
  switch (cs[0]) {
7107
7040
  case '*':
7108
7041
  return (_a = (0, combinator_1.bind)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, '**')]), (ds, rest) => rest.slice(0, 2) === '**' && (0, util_1.isEndTightNodes)(ds) ? [
7109
- [(0, typed_dom_1.html)('strong', (0, array_1.unshift)([(0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))], (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(ds))))],
7042
+ [(0, typed_dom_1.html)('strong', (0, array_1.unshift)([(0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)(bs))], (0, typed_dom_1.defrag)(ds)))],
7110
7043
  rest.slice(2)
7111
7044
  ] : [
7112
7045
  (0, array_1.unshift)([
7113
7046
  '**',
7114
- (0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))
7047
+ (0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)(bs))
7115
7048
  ], ds),
7116
7049
  rest
7117
7050
  ])(rest, context)) !== null && _a !== void 0 ? _a : [
7118
7051
  [
7119
7052
  '**',
7120
- (0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))
7053
+ (0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)(bs))
7121
7054
  ],
7122
7055
  rest
7123
7056
  ];
7124
7057
  case '**':
7125
7058
  return (_b = (0, combinator_1.bind)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, '*')]), (ds, rest) => rest.slice(0, 1) === '*' && (0, util_1.isEndTightNodes)(ds) ? [
7126
- [(0, typed_dom_1.html)('em', (0, array_1.unshift)([(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))], (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(ds))))],
7059
+ [(0, typed_dom_1.html)('em', (0, array_1.unshift)([(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))], (0, typed_dom_1.defrag)(ds)))],
7127
7060
  rest.slice(1)
7128
7061
  ] : [
7129
7062
  (0, array_1.unshift)([
7130
7063
  '*',
7131
- (0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))
7064
+ (0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))
7132
7065
  ], ds),
7133
7066
  rest
7134
7067
  ])(rest, context)) !== null && _b !== void 0 ? _b : [
7135
7068
  [
7136
7069
  '*',
7137
- (0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))
7070
+ (0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))
7138
7071
  ],
7139
7072
  rest
7140
7073
  ];
7141
7074
  case '***':
7142
7075
  return [
7143
- [(0, typed_dom_1.html)('em', [(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))])],
7076
+ [(0, typed_dom_1.html)('em', [(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))])],
7144
7077
  rest
7145
7078
  ];
7146
7079
  }
@@ -7508,11 +7441,11 @@ require = function () {
7508
7441
  return {};
7509
7442
  }
7510
7443
  })(), (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), `</${ tag }>`)), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest, context) => [
7511
- [elem(tag, as, (0, util_1.trimEndBR)((0, typed_dom_1.defrag)(bs)), cs, context)],
7444
+ [elem(tag, as, (0, util_1.trimNodeEndBR)((0, typed_dom_1.defrag)(bs)), cs, context)],
7512
7445
  rest
7513
7446
  ])), ([, tag]) => tag)),
7514
7447
  (0, combinator_1.match)(/^(?=<([a-z]+)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.validate)(`<${ tag }`, `</${ tag }>`, (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)('>'), true), (0, util_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest) => [
7515
- [elem(tag, as, (0, util_1.trimEndBR)((0, typed_dom_1.defrag)(bs)), cs, {})],
7448
+ [elem(tag, as, (0, util_1.trimNodeEndBR)((0, typed_dom_1.defrag)(bs)), cs, {})],
7516
7449
  rest
7517
7450
  ], ([as, bs], rest) => as.length === 1 ? [
7518
7451
  (0, array_1.unshift)(as, bs),
@@ -7628,7 +7561,7 @@ require = function () {
7628
7561
  const typed_dom_1 = _dereq_('typed-dom');
7629
7562
  const array_1 = _dereq_('spica/array');
7630
7563
  exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, '++')]), (0, source_1.str)('++'), false, ([, bs], rest) => [
7631
- [(0, typed_dom_1.html)('ins', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))],
7564
+ [(0, typed_dom_1.html)('ins', (0, typed_dom_1.defrag)((0, util_1.trimNodeEndBR)(bs)))],
7632
7565
  rest
7633
7566
  ], ([as, bs], rest) => [
7634
7567
  (0, array_1.unshift)(as, bs),
@@ -7735,9 +7668,9 @@ require = function () {
7735
7668
  switch (uri.protocol) {
7736
7669
  case 'http:':
7737
7670
  case 'https:':
7738
- if (INSECURE_URI.slice(0, 2) === '^/' && /(?:\/\.\.?)(?:\/|$)/.test(INSECURE_URI.slice(0, INSECURE_URI.search(/[?#]|$/)))) {
7671
+ if (INSECURE_URI.slice(0, 2) === '^/' && /\/\.\.?(?:\/|$)/.test(INSECURE_URI.slice(0, INSECURE_URI.search(/[?#]|$/)))) {
7739
7672
  type = 'argument';
7740
- description = 'Subresource paths cannot contain dot-segments.';
7673
+ description = 'Dot-segments cannot be used in subresource paths.';
7741
7674
  break;
7742
7675
  }
7743
7676
  return (0, typed_dom_1.html)('a', {
@@ -7800,7 +7733,7 @@ require = function () {
7800
7733
  const typed_dom_1 = _dereq_('typed-dom');
7801
7734
  const array_1 = _dereq_('spica/array');
7802
7735
  exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('=='), (0, util_1.startTight)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, '==')])), (0, source_1.str)('=='), false, ([as, bs, cs], rest) => (0, util_1.isEndTightNodes)(bs) ? [
7803
- [(0, typed_dom_1.html)('mark', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))],
7736
+ [(0, typed_dom_1.html)('mark', (0, typed_dom_1.defrag)(bs))],
7804
7737
  rest
7805
7738
  ] : [
7806
7739
  (0, array_1.unshift)(as, bs),
@@ -7970,12 +7903,12 @@ require = function () {
7970
7903
  link_1.option
7971
7904
  ]);
7972
7905
  function sanitize(uri, target) {
7973
- if (/^\.\.?\//.test(uri.source)) {
7906
+ if (/\/\.\.?(?:\/|$)/.test('/' + uri.source.slice(0, uri.source.search(/[?#]|$/)))) {
7974
7907
  (0, typed_dom_1.define)(target, {
7975
7908
  class: void target.classList.add('invalid'),
7976
7909
  'data-invalid-syntax': 'media',
7977
7910
  'data-invalid-type': 'argument',
7978
- 'data-invalid-description': 'Relative paths cannot be used with media syntax; Use subresource paths instead.'
7911
+ 'data-invalid-description': 'Dot-segments cannot be used in media paths; use subresource paths instead.'
7979
7912
  });
7980
7913
  return false;
7981
7914
  }
@@ -8118,11 +8051,6 @@ require = function () {
8118
8051
  const acc = [''];
8119
8052
  while (source !== '') {
8120
8053
  switch (source[0]) {
8121
- case ' ':
8122
- case '\u3000':
8123
- acc.push('');
8124
- source = source.slice(1);
8125
- continue;
8126
8054
  case '&': {
8127
8055
  const result = (0, htmlentity_1.htmlentity)(source, context);
8128
8056
  acc[acc.length - 1] += (0, parser_1.eval)(result, [source[0]])[0];
@@ -8130,6 +8058,11 @@ require = function () {
8130
8058
  continue;
8131
8059
  }
8132
8060
  default: {
8061
+ if (source[0].trimStart() === '') {
8062
+ acc.push('');
8063
+ source = source.slice(1);
8064
+ continue;
8065
+ }
8133
8066
  const result = (0, source_1.text)(source, context);
8134
8067
  acc[acc.length - 1] += (_a = (0, parser_1.eval)(result)[0]) !== null && _a !== void 0 ? _a : source.slice(0, source.length - (0, parser_1.exec)(result).length);
8135
8068
  source = (0, parser_1.exec)(result);
@@ -8190,7 +8123,7 @@ require = function () {
8190
8123
  (0, combinator_1.some)(inline_1.inline, '*'),
8191
8124
  (0, source_1.str)('*')
8192
8125
  ]), '**')), (0, source_1.str)('**'), false, ([as, bs, cs], rest) => (0, util_1.isEndTightNodes)(bs) ? [
8193
- [(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)((0, util_1.trimEndBR)(bs)))],
8126
+ [(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))],
8194
8127
  rest
8195
8128
  ] : [
8196
8129
  (0, array_1.unshift)(as, bs),
@@ -8709,6 +8642,7 @@ require = function () {
8709
8642
  Object.defineProperty(exports, '__esModule', { value: true });
8710
8643
  exports.escsource = void 0;
8711
8644
  const combinator_1 = _dereq_('../../combinator');
8645
+ const text_1 = _dereq_('./text');
8712
8646
  const separator = /[\s\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]/;
8713
8647
  exports.escsource = (0, combinator_1.creator)(source => {
8714
8648
  if (source === '')
@@ -8728,9 +8662,11 @@ require = function () {
8728
8662
  source.slice(2)
8729
8663
  ];
8730
8664
  default:
8665
+ const b = source[0] !== '\n' && source[0].trimStart() === '';
8666
+ const i = b || (0, text_1.isAlphanumeric)(source[0]) ? source.search(b ? text_1.nonWhitespace : text_1.nonAlphanumeric) : 1;
8731
8667
  return [
8732
- [source.slice(0, 1)],
8733
- source.slice(1)
8668
+ [source.slice(0, i)],
8669
+ source.slice(i)
8734
8670
  ];
8735
8671
  }
8736
8672
  default:
@@ -8741,7 +8677,10 @@ require = function () {
8741
8677
  }
8742
8678
  });
8743
8679
  },
8744
- { '../../combinator': 30 }
8680
+ {
8681
+ '../../combinator': 30,
8682
+ './text': 135
8683
+ }
8745
8684
  ],
8746
8685
  133: [
8747
8686
  function (_dereq_, module, exports) {
@@ -8953,7 +8892,7 @@ require = function () {
8953
8892
  function (_dereq_, module, exports) {
8954
8893
  'use strict';
8955
8894
  Object.defineProperty(exports, '__esModule', { value: true });
8956
- exports.stringify = exports.trimEndBR = exports.trimNodeEnd = exports.trimNode = exports.isEndTightNodes = exports.isStartTightNodes = exports.startTight = exports.isStartLoose = exports.startLoose = exports.visualize = void 0;
8895
+ exports.stringify = exports.trimNodeEndBR = exports.trimNodeEnd = exports.trimNode = exports.isEndTightNodes = exports.isStartTightNodes = exports.startTight = exports.isStartLoose = exports.startLoose = exports.visualize = void 0;
8957
8896
  const global_1 = _dereq_('spica/global');
8958
8897
  const parser_1 = _dereq_('../combinator/data/parser');
8959
8898
  const combinator_1 = _dereq_('../combinator');
@@ -9087,17 +9026,20 @@ require = function () {
9087
9026
  function isEndTightNodes(nodes) {
9088
9027
  if (nodes.length === 0)
9089
9028
  return true;
9090
- const last = nodes.length - 1;
9091
- return typeof nodes[last] === 'string' && nodes[last].length > 1 ? isVisible(nodes[last], -1) || isVisible(nodes[last], -2) : isVisible(nodes[last], -1) || last === 0 || isVisible(nodes[last - 1], -1);
9029
+ for (let i = nodes.length; i--;) {
9030
+ if (typeof nodes[i] === 'object' && nodes[i]['className'] === 'comment')
9031
+ continue;
9032
+ return isVisible(nodes[i], -1);
9033
+ }
9034
+ return false;
9092
9035
  }
9093
9036
  exports.isEndTightNodes = isEndTightNodes;
9094
- function isVisible(node, position) {
9095
- if (!node)
9096
- return false;
9037
+ function isVisible(node, strpos) {
9097
9038
  switch (typeof node) {
9098
9039
  case 'string':
9099
- const char = position === global_1.undefined ? node : node[position >= 0 ? position : node.length + position];
9040
+ const char = node && strpos !== global_1.undefined ? node[strpos >= 0 ? strpos : node.length + strpos] : node;
9100
9041
  switch (char) {
9042
+ case '':
9101
9043
  case ' ':
9102
9044
  case '\t':
9103
9045
  case '\n':
@@ -9124,26 +9066,31 @@ require = function () {
9124
9066
  }
9125
9067
  exports.trimNode = trimNode;
9126
9068
  function trimNodeStart(nodes) {
9127
- const skip = nodes.length > 0 && typeof nodes[nodes.length - 1] === 'object' && nodes[nodes.length - 1]['className'] === 'indexer' ? [nodes.pop()] : [];
9128
- for (let first = nodes[0]; nodes.length > 0 && !isVisible(first, 0) && !(typeof first === 'object' && first.className === 'comment');) {
9129
- if (typeof first === 'string') {
9130
- const pos = first.length - first.trimStart().length;
9069
+ for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[0], 0);) {
9070
+ if (nodes.length === 1 && typeof node === 'object' && node.className === 'indexer')
9071
+ break;
9072
+ if (typeof node === 'object' && node.className === 'comment')
9073
+ break;
9074
+ if (typeof node === 'string') {
9075
+ const pos = node.length - node.trimStart().length;
9131
9076
  if (pos > 0) {
9132
- nodes[0] = first.slice(pos);
9077
+ nodes[0] = node.slice(pos);
9133
9078
  break;
9134
9079
  }
9135
9080
  }
9136
- nodes.pop();
9081
+ nodes.shift();
9137
9082
  }
9138
- return (0, array_1.push)(nodes, skip);
9083
+ return nodes;
9139
9084
  }
9140
9085
  function trimNodeEnd(nodes) {
9141
9086
  const skip = nodes.length > 0 && typeof nodes[nodes.length - 1] === 'object' && nodes[nodes.length - 1]['className'] === 'indexer' ? [nodes.pop()] : [];
9142
- for (let last = nodes[0]; nodes.length > 0 && !isVisible(last = nodes[nodes.length - 1], -1) && !(typeof last === 'object' && last.className === 'comment');) {
9143
- if (typeof last === 'string') {
9144
- const pos = last.trimEnd().length;
9087
+ for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[nodes.length - 1], -1);) {
9088
+ if (typeof node === 'object' && node.className === 'comment')
9089
+ break;
9090
+ if (typeof node === 'string') {
9091
+ const pos = node.trimEnd().length;
9145
9092
  if (pos > 0) {
9146
- nodes[nodes.length - 1] = last.slice(0, pos);
9093
+ nodes[nodes.length - 1] = node.slice(0, pos);
9147
9094
  break;
9148
9095
  }
9149
9096
  }
@@ -9152,13 +9099,13 @@ require = function () {
9152
9099
  return (0, array_1.push)(nodes, skip);
9153
9100
  }
9154
9101
  exports.trimNodeEnd = trimNodeEnd;
9155
- function trimEndBR(nodes) {
9102
+ function trimNodeEndBR(nodes) {
9156
9103
  if (nodes.length === 0)
9157
9104
  return nodes;
9158
9105
  const node = nodes[nodes.length - 1];
9159
9106
  return typeof node === 'object' && node.tagName === 'BR' ? (0, array_1.pop)(nodes)[0] : nodes;
9160
9107
  }
9161
- exports.trimEndBR = trimEndBR;
9108
+ exports.trimNodeEndBR = trimNodeEndBR;
9162
9109
  function stringify(nodes) {
9163
9110
  let acc = '';
9164
9111
  for (let i = 0; i < nodes.length; ++i) {