@playpilot/tpi 5.2.1 → 5.3.0

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,14 +1,14 @@
1
1
  (() => {
2
2
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.button.svelte-1qqv88o{display:flex;align-items:center;justify-content:center;flex:0 0 var(--size);width:var(--size);height:var(--size);border-radius:50%;border:0;padding:var(--playpilot-button-padding, 0);background:var(--playpilot-button-background, var(--playpilot-content));box-shadow:var(--playpilot-button-shadow, var(--playpilot-shadow));color:var(--playpilot-button-text-color, var(--playpilot-text-color-alt));cursor:pointer;transition:transform 50ms}.button.svelte-1qqv88o:hover{filter:brightness(1.2);transform:scale(1.05)}.modal.svelte-aqwna4{z-index:2147483647;box-sizing:border-box;position:fixed;display:flex;justify-content:center;align-items:flex-start;top:0;left:0;width:100%;height:100%;background:var(--playpilot-detail-backdrop, rgba(0, 0, 0, .65))}@media (min-width: 600px){.modal.svelte-aqwna4{padding:32px}}.dialog.svelte-aqwna4{z-index:1;position:relative;width:100%;max-width:600px;max-height:80vh;overflow:auto;margin-top:auto;border-radius:var(--playpilot-detail-border-radius, 16px 16px 0 0);background:var(--playpilot-detail-background, var(--playpilot-light))}@media (min-width: 600px){.dialog.svelte-aqwna4{margin-top:0;border-radius:var(--playpilot-detail-border-radius, 16px);max-height:100%}}.backdrop.svelte-aqwna4{z-index:0;position:absolute;top:0;right:0;bottom:0;left:0}.close.svelte-aqwna4{--playpilot-button-background: var(--playpilot-modal-close-button-background, var(--playpilot-content));--playpilot-button-shadow: var(--playpilot-modal-close-button-shadow, var(--playpilot-shadow));--playpilot-button-padding: var(--playpilot-modal-close-button-padding, .5rem);--playpilot-button-text-color: var(--playpilot-modal-close-button-text-color, var(--playpilot-text-color-alt));z-index:5;position:absolute;top:16px;right:16px}.close.svelte-aqwna4:hover{filter:brightness(1.1)}.genre.svelte-1ebula3{display:flex;flex-wrap:wrap;background:var(--playpilot-genre-background, var(--playpilot-content));border:0;border-radius:var(--playpilot-genre-border-radius, 16px);padding:4px 8px;font-family:var(--playpilot-genre-font-family, inherit);font-weight:var(--playpilot-genre-font-weight, inherit);text-transform:var(--playpilot-genre-text-transform, none);color:var(--playpilot-genre-text-color, var(--playpilot-text-color-alt));line-height:1;font-size:inherit}.genre.svelte-1ebula3:is(button:where(.svelte-1ebula3)):hover{cursor:pointer;filter:var(--playpilot-genre-hover-filter, brightness(1.1));background:var(--playpilot-genre-hover-background, var(--playpilot-genre-background, var(--playpilot-content)))}img.svelte-g63n1y{--size: 32px;height:var(--size);width:var(--size);border-radius:8px;background:#00000040}@media (min-width: 640px){img.svelte-g63n1y{--size: 40px}}.heading.svelte-g63n1y{margin:0;color:var(--playpilot-playlinks-title-color, var(--playpilot-text-color-alt));font-family:var(--playpilot-playlinks-title-font-family, inherit);font-weight:var(--playpilot-playlinks-title-font-weight, lighter);font-size:var(--playpilot-playlinks-title-font-size, 14px);line-height:normal}.playlinks.svelte-g63n1y{box-sizing:border-box;display:flex;gap:8px;width:calc(100% + 32px);padding:8px 16px;margin:0 -16px;overflow:auto;scrollbar-width:none}.playlinks.svelte-g63n1y::-webkit-scrollbar{display:none}.list.svelte-g63n1y{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}@media (min-width: 640px){.list.svelte-g63n1y img:where(.svelte-g63n1y){--size: 32px}}.playlink.svelte-g63n1y{position:relative;display:flex;align-items:center;gap:12px;padding:12px;background:var(--playpilot-playlink-background, var(--playpilot-lighter));box-shadow:var(--playpilot-playlink-shadow, var(--playpilot-shadow));border-radius:var(--playpilot-playlink-border-radius, 8px);color:var(--playpilot-playlink-text-color, var(--playpilot-text-color-alt))!important;font-weight:var(--playpilot-playlink-font-weight, inherit);font-style:var(--playpilot-playlink-font-style, normal)!important;text-decoration:none!important;white-space:nowrap;font-size:var(--playpilot-playlinks-font-size, 12px);line-height:1}.playlink.svelte-g63n1y:hover,.playlink.svelte-g63n1y:active{filter:var(--playpilot-playlink-hover-filter, brightness(1.1));background:var(--playpilot-playlink-hover-background, var(--playpilot-playlink-background, var(--playpilot-lighter)))!important;text-decoration:none!important}.playlink.highlighted.svelte-g63n1y:before{content:"";z-index:1;display:block;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;box-shadow:inset 0 0 0 2px currentColor;opacity:.35;pointer-events:none}.playlink.svelte-g63n1y img:where(.svelte-g63n1y){margin:0}.list.svelte-g63n1y .playlink:where(.svelte-g63n1y){padding:8px;gap:8px}.name.svelte-g63n1y{font-weight:var(--playpilot-playlink-font-weight, inherit);font-family:var(--playpilot-playlink-font-family, inherit)}.category.svelte-g63n1y{margin-top:var(--playpilot-playlinks-category-margin, 8px);font-size:var(--playpilot-playlinks-category-font-size, 10px);color:var(--playpilot-playlink-category-text-color, var(--playpilot-text-color));font-weight:var(--playpilot-playlink-category-font-weight, inherit);font-family:var(--playpilot-playlink-category-font-family, inherit)}.empty.svelte-g63n1y{white-space:initial;line-height:1.35}.arrow.svelte-g63n1y{display:flex;margin-left:auto;padding:0 8px}.paragraph.svelte-1u3je71{display:block;margin:16px 0 0}.show-more.svelte-1u3je71{display:inline;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;background:transparent;border:0;color:var(--playpilot-read-more-text-color, var(--playpilot-text-color-alt));font-weight:var(--playpilot-read-more-font-weight, inherit);font-family:inherit;font-size:inherit}.show-more.svelte-1u3je71:hover{text-decoration:underline;text-decoration-thickness:2px;cursor:pointer}.heading.svelte-1026zg0{margin:8px 0;color:var(--playpilot-detail-title-text-color, #fff);font-family:var(--playpilot-detail-title-font-family, inherit);font-weight:var(--playpilot-detail-title-font-weight, lighter);font-size:var(--playpilot-detail-title-font-size, 24px);line-height:normal;font-style:var(--playpilot-detail-title-font-style, normal)}.small.svelte-1026zg0 .heading:where(.svelte-1026zg0){font-size:var(--playpilot-detail-title-font-size-small, 18px)}.compact.svelte-1026zg0 .heading:where(.svelte-1026zg0){margin-top:0}.content.svelte-1026zg0{z-index:1;position:relative;padding:16px;color:var(--playpilot-detail-text-color, var(--playpilot-text-color));font-family:var(--playpilot-detail-font-family, var(--playpilot-font-family));font-weight:var(--playpilot-detail-font-weight, normal);font-size:var(--playpilot-detail-font-size, 14px);line-height:normal;font-style:normal}.content.svelte-1026zg0 ::view-transition-old(content),.content.svelte-1026zg0 ::view-transition-new(content){height:100%}.content.small.svelte-1026zg0{font-size:var(--playpilot-detail-font-size, 12px);line-height:1.45;padding-bottom:8px}.header.svelte-1026zg0{padding:32px 0 16px;background:transparent}.small.svelte-1026zg0 .header:where(.svelte-1026zg0){padding-top:16px}.compact.svelte-1026zg0 .header:where(.svelte-1026zg0){padding:0 0 16px}.top.svelte-1026zg0{display:flex;justify-content:space-between;align-items:flex-end}.poster.svelte-1026zg0{display:block;width:72px;margin:0;aspect-ratio:2/3;border-radius:var(--playpilot-detail-image-border-radius, 8px);background:var(--playpilot-detail-image-background, var(--playpilot-content));box-shadow:var(--playpilot-detail-image-shadow, var(--playpilot-shadow));opacity:0}.poster.loaded.svelte-1026zg0{opacity:1}.info.svelte-1026zg0{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}.small.svelte-1026zg0 .info:where(.svelte-1026zg0){gap:8px 12px}.imdb.svelte-1026zg0{display:flex;align-items:center;gap:4px}.imdb.svelte-1026zg0 svg{margin-top:-2px}.small.svelte-1026zg0 .imdb:where(.svelte-1026zg0) svg{margin-top:0;width:12px;height:12px}.background.svelte-1026zg0{position:absolute;top:0;left:0;width:100%;height:192px;overflow:hidden;background:var(--playpilot-detail-background, var(--playpilot-lighter));z-index:0}.background.svelte-1026zg0:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(to top,var(--playpilot-detail-background, var(--playpilot-light)),transparent 40%);z-index:1}.background.svelte-1026zg0 img:where(.svelte-1026zg0){width:100%;height:100%;object-fit:cover;object-position:center;margin:0;opacity:0;z-index:0}.background.svelte-1026zg0 img.loaded:where(.svelte-1026zg0){opacity:1}.background.svelte-1026zg0 img.blur:where(.svelte-1026zg0){opacity:.5;transform:scale(1.1);filter:blur(.75rem)}.faded.svelte-1026zg0{opacity:.15}.capitalize.svelte-1026zg0{text-transform:capitalize}.truncate.svelte-1026zg0{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.popover.svelte-tb2xdq{--offset: 8px;position:absolute;top:calc((var(--offset) - 1px) * -1);left:0;width:calc(100vw - 32px);max-width:320px;padding:var(--offset) 0;transform:translateY(calc(-100% + var(--offset)));z-index:2147483647}.popover.flip.svelte-tb2xdq{top:auto;bottom:calc(var(--offset) + 1px);transform:translateY(calc(100% + var(--offset)))}.dialog.svelte-tb2xdq{cursor:default;position:relative;border-radius:var(--playpilot-popover-border-radius, 16px);background:var(--playpilot-popover-background, var(--playpilot-light));box-shadow:var(--playpilot-popover-shadow, var(--playpilot-shadow-large));max-height:min(var(--max-height),560px);scrollbar-width:thin;overflow-y:overlay;overflow-x:hidden;view-transition-name:playpilot-title-content}.title-popover.svelte-d86q0q{position:absolute}p.svelte-pfvkex{font-weight:var(--playpilot-after-article-text-font-weight, normal)}span.svelte-pfvkex{display:block}button.svelte-pfvkex{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--playpilot-after-article-button-padding, 4px 12px);margin:var(--playpilot-after-article-button-margin, 4px 0 0);background:var(--playpilot-after-article-button-background, transparent);border:var(--playpilot-after-article-button-border, 2px solid currentColor);border-radius:var(--playpilot-after-article-button-border-radius, 16px);color:var(--playpilot-after-article-button-text-color, inherit);font-weight:var(--playpilot-after-article-button-font-weight, bold);font-size:var(--playpilot-after-article-button-font-size, 16px);cursor:pointer;transition:all 50ms}button.svelte-pfvkex:hover{background:var(--playpilot-after-article-button-background-hover, transparent);border:var(--playpilot-after-article-button-border-hover, 2px solid currentColor);color:var(--playpilot-after-article-button-text-color-hover, inherit);transform:var(--playpilot-after-article-button-transform-hover, scale(1.02))}svg.svelte-by11ix{transition:transform .1s}.expanded.svelte-by11ix{transform:rotate(180deg)}.switch.svelte-91s87b{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:flex;align-items:center;border:0;padding:0;background:transparent;cursor:pointer}.fullwidth.svelte-91s87b{width:100%;justify-content:space-between}.label.svelte-91s87b{display:flex;align-items:center;gap:8px;margin-right:8px;font-family:var(--playpilot-font-family);color:var(--playpilot-text-color-alt);font-size:12px}.switch.svelte-91s87b:hover .label:where(.svelte-91s87b){color:var(--playpilot-text-color)}.track.svelte-91s87b{position:relative;width:32px;height:20px;border-radius:16px;background:var(--playpilot-content);transition:background-color .1s}.active.svelte-91s87b .track:where(.svelte-91s87b){background:var(--playpilot-green)}.knob.svelte-91s87b{position:absolute;top:2px;left:2px;height:16px;width:16px;border-radius:50%;background:#fff;transition:left .1s}.active.svelte-91s87b .knob:where(.svelte-91s87b){left:14px}input.svelte-1vrer3i{width:100%;padding:8px 16px;border:0;border-radius:32px;background:var(--playpilot-light);color:var(--playpilot-text-color-alt);font-size:12px;font-family:var(--playpilot-font-family)}input.svelte-1vrer3i:focus{background:var(--playpilot-lighter);outline:1px solid white}input.svelte-1vrer3i::placeholder{color:var(--playpilot-text-color-alt);opacity:.75}.alert.svelte-df5n87{padding:8px;border-radius:8px;border:1px solid var(--playpilot-error);background:var(--playpilot-error-dark);font-size:12px;font-family:var(--playpilot-font-family)}.alert.warning.svelte-df5n87{border-color:var(--playpilot-warning);background:var(--playpilot-warning-dark)}.alert.fixed.svelte-df5n87{position:fixed;bottom:1rem;right:1rem;width:80%;max-width:25rem}.alert.svelte-df5n87 a{color:currentColor}.switches.svelte-1shw34x{display:flex;flex-direction:column;gap:12px}button.svelte-1shw34x{z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;display:flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:32px;padding:8px;background:transparent;font-family:var(--playpilot-font-family);font-size:10.4px;color:var(--playpilot-text-color-alt);cursor:pointer}button.svelte-1shw34x:hover,button.active.svelte-1shw34x{color:var(--playpilot-text-color)}.group.svelte-1shw34x{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;padding:4px;border:0;border-radius:32px;background:var(--playpilot-light);color:var(--playpilot-text-color-alt);font-size:12px;font-family:var(--playpilot-font-family)}.active-marker.svelte-1shw34x{z-index:0;position:absolute;width:calc(50% - 8px);height:calc(100% - 8px);left:4px;top:4px;border-radius:32px;background:var(--playpilot-content);transition:left .1s}.right.svelte-1shw34x{left:calc(50% + 4px)}.label.svelte-1shw34x{margin:10.8px 0 4px;opacity:.75;font-size:10.8px;color:var(--playpilot-text-color-alt)}.alert.svelte-1shw34x{margin-top:8px}button.svelte-zpsd2z{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;border-radius:4px;background:transparent;color:var(--playpilot-text-color-alt)}button.svelte-zpsd2z:hover{cursor:pointer;color:#fff}.context-menu.svelte-zpsd2z{position:relative}.content.svelte-zpsd2z{z-index:1;position:absolute;top:100%;right:0;max-width:240px;border-radius:8px;background:var(--playpilot-lighter)}select.svelte-o5qkco{background:var(--playpilot-content);padding:8px 16px;width:100%;border:0;border-radius:8px;color:var(--playpilot-text-color);font-family:inherit;font-size:13.6px}option.svelte-o5qkco:hover,option.svelte-o5qkco:active,option.svelte-o5qkco:checked{background-color:var(--playpilot-content-light);font-weight:700}.form.svelte-o5qkco{padding:32px;font-family:var(--playpilot-font-family);color:var(--playpilot-text-color)}.heading.svelte-o5qkco{font-size:20px}.info.svelte-o5qkco{margin:16px 0;font-size:13.6px;color:var(--playpilot-text-color-alt)}.info.svelte-o5qkco strong:where(.svelte-o5qkco){color:var(--playpilot-text-color)}.submit.svelte-o5qkco{margin-top:16px;padding:8px 16px;border:0;border-radius:32px;background:var(--playpilot-green);box-shadow:var(--playpilot-shadow);font-family:inherit;color:var(--playpilot-text-color);font-size:13.6px;cursor:pointer}.submit[disabled].svelte-o5qkco{background:var(--playpilot-content);color:var(--playpilot-text-color-alt);box-shadow:none;opacity:.5;cursor:default}.sent.svelte-o5qkco{margin-top:16px;padding:8px 0;color:var(--playpilot-green);font-size:13.6px}.item.svelte-lo6h85{padding:16px 8px;border-bottom:1px solid var(--playpilot-lighter);transition:outline-offset .1s}.item.svelte-lo6h85:hover,.item.highlighted.svelte-lo6h85{border-radius:8px;border-color:transparent;outline:2px solid var(--playpilot-content);outline-offset:1px}.item.highlighted.svelte-lo6h85{outline:2px solid var(--playpilot-primary)}.header.svelte-lo6h85{display:flex;gap:16px;width:100%}.poster.svelte-lo6h85{display:block;width:32px;height:48px;border-radius:4px;background:var(--playpilot-content)}.inactive.svelte-lo6h85 .poster:where(.svelte-lo6h85){opacity:.35}.title.svelte-lo6h85{font-size:14px;word-break:break-word}.sentence.svelte-lo6h85{font-size:.7em;line-height:150%;margin-right:-8px;color:var(--playpilot-text-color-alt);opacity:.75}.sentence.svelte-lo6h85 em{color:var(--playpilot-text-color);font-weight:700}.expand-sentence.svelte-lo6h85{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;margin:0;background:transparent;font-family:inherit;color:inherit;font-size:inherit;line-height:inherit;font-style:italic;text-decoration:underline}.expand-sentence.svelte-lo6h85:hover{color:var(--playpilot-text-color)}.content.svelte-lo6h85{padding-top:8px}.inactive.svelte-lo6h85 .info:where(.svelte-lo6h85){opacity:.35}.context-menu.svelte-lo6h85{margin:0 -4px 0 auto}.context-menu-action.svelte-lo6h85{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;padding:8px 16px;width:100%;text-align:left;font-family:inherit;white-space:nowrap;color:var(--playpilot-text-color-alt);cursor:pointer}.context-menu-action.svelte-lo6h85:hover{color:var(--playpilot-text-color);background-color:var(--playpilot-content-light)}.context-menu-action.svelte-lo6h85:first-child{margin-top:8px}.context-menu-action.svelte-lo6h85:last-child{margin-bottom:8px}.actions.svelte-lo6h85{display:flex;align-items:center;justify-content:space-between;width:100%}.expand.svelte-lo6h85{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:50%;background:var(--playpilot-content);color:var(--playpilot-text-color);box-shadow:var(--playpilot-shadow);cursor:pointer}.expand.svelte-lo6h85:hover{filter:brightness(1.2)}.expanded.svelte-lo6h85{padding-top:16px}.type-select.svelte-lo6h85{margin-top:8px}.label.svelte-lo6h85{margin-bottom:4px;opacity:.75;font-size:10.8px;color:var(--playpilot-text-color-alt)}.offset.svelte-lo6h85{margin-top:12px}.warning.svelte-lo6h85{margin:0 auto 0 8px}.warning.svelte-lo6h85 svg{display:block}.drag-handle.svelte-19mcc5g{z-index:10;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;top:8px;left:30%;width:40%;height:16px;background:transparent;border:0;cursor:grab}.drag-handle.svelte-19mcc5g:hover:before{opacity:.65;transform:scale(1.05)}.drag-handle.svelte-19mcc5g:active:before{opacity:.9;transform:scale(.95)}.drag-handle.svelte-19mcc5g:active{cursor:grabbing}.drag-handle.svelte-19mcc5g:before{display:block;content:"";position:absolute;top:20%;right:0;bottom:60%;left:0;border-radius:16px;background:var(--playpilot-text-color);opacity:.15;transition:opacity .1s,transform 50ms}.resize-handle.svelte-sxkuxk{z-index:10;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;top:0;left:0;width:100%;height:8px;background:transparent;border:0;cursor:ns-resize}.resize-handle.svelte-sxkuxk:hover:before{opacity:.65;transform:scale(1.05)}.resize-handle.svelte-sxkuxk:active:before{opacity:.9;transform:scale(.95)}.resize-handle.svelte-sxkuxk:active{cursor:grabbing}.resize-handle.svelte-sxkuxk:before{display:block;content:"";position:absolute;top:0;right:20%;left:20%;bottom:80%;border-radius:0 0 16px 16px;background:var(--playpilot-text-color);opacity:.15;transition:opacity .1s,transform 50ms}.item.svelte-rjq94e{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:flex;align-items:flex-start;gap:16px;width:100%;background:transparent;border:0;padding:8px;border-bottom:1px solid var(--playpilot-content);color:var(--playpilot-text-color-alt);font-family:inherit;text-align:left;font-size:13.6px}.item.hoverable.svelte-rjq94e{cursor:pointer}.item.hoverable.svelte-rjq94e:hover{background:var(--playpilot-lighter)}.item.svelte-rjq94e:last-child{border-bottom:0}.poster.svelte-rjq94e{flex:0 0 auto;height:auto;width:28px;aspect-ratio:28/42;border-radius:4px;background:var(--playpilot-content)}.name.svelte-rjq94e{color:var(--playpilot-text-color)}.meta.svelte-rjq94e{display:flex;flex-wrap:wrap;gap:0 8px;font-size:12px}.imdb.svelte-rjq94e{display:flex;align-items:center;gap:4px}.open-in-new-tab.svelte-rjq94e{margin-left:auto;color:var(--playpilot-text-color-alt)}.open-in-new-tab.svelte-rjq94e:hover{color:vaR(--playpilot-text-color)}.search.svelte-1olb8n0{position:relative}.results.svelte-1olb8n0{z-index:1;position:absolute;top:calc(100% + 8px);left:0;right:0;height:30vh;max-height:160px;border-radius:8px;background:var(--playpilot-light);scrollbar-width:thin;overflow:auto}.empty.svelte-1olb8n0{padding:8px;font-size:12px;color:var(--playpilot-text-color-alt)}.selected.svelte-1olb8n0{margin:8px 0;border-radius:.5rem;border:2px solid var(--playpilot-green)}p.svelte-1i8p6op,label.svelte-1i8p6op{font-size:12px;max-width:240px;color:var(--playpilot-text-color-alt)}label.svelte-1i8p6op{display:block;margin-top:16px}.layout.svelte-1i8p6op{height:100%;display:flex;flex-direction:column;margin:0}.header.svelte-1i8p6op{display:flex;align-items:center;gap:8px;margin-bottom:16px}.heading.svelte-1i8p6op{margin:0;color:var(--playpilot-text-color);font-size:16px;line-height:normal;font-weight:400}.error.svelte-1i8p6op{margin-top:8px}.save.svelte-1i8p6op{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;margin-top:auto;padding:8px;border:0;border-radius:32px;background:var(--playpilot-green);transition:opacity .1s;font-family:inherit;color:var(--playpilot-text-color)}.save.svelte-1i8p6op:not([disabled]):hover{outline:2px solid currentColor}.save[disabled].svelte-1i8p6op{cursor:default;background:var(--playpilot-light);opacity:.5;color:var(--playpilot-text-color-alt)}p.svelte-2m2urs{margin:0 0 8px}.alert.svelte-2m2urs{margin:0 8px}.button.svelte-2m2urs{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;padding:4px;border:0;border-radius:4px;background:var(--playpilot-warning);transition:opacity .1s;font-family:inherit;color:var(--playpilot-dark);font-size:.85rem;cursor:pointer}.button.svelte-2m2urs:hover{background:#fff}a.svelte-1kpafo0{color:currentColor}p.svelte-1kpafo0{margin:0}.ai-indicator.svelte-1kpafo0{position:relative;margin:0 8px}.content.svelte-1kpafo0{position:relative;display:flex;gap:8px;background:var(--playpilot-light);padding:8px;margin:2px;border-radius:.5rem;font-size:12px;line-height:1.5;z-index:1;color:var(--playpilot-text-color-alt);overflow:hidden}.message.svelte-1kpafo0{display:flex;margin-top:4px;font-style:italic}.icon.svelte-1kpafo0{color:var(--playpilot-green)}.border.svelte-1kpafo0{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:.5rem;background:var(--playpilot-green);overflow:hidden;transition:background-color .5s}.running.svelte-1kpafo0 .border:where(.svelte-1kpafo0){background:var(--playpilot-light)}@keyframes svelte-1kpafo0-rotate{to{rotate:360deg}}.animator.svelte-1kpafo0{position:absolute;left:50%;top:50%;transform:translateY(-50%);width:100%;height:20rem;background:var(--playpilot-green);transform-origin:left 50%;animation:svelte-1kpafo0-rotate 2s infinite linear;filter:blur(5rem)}.loading-bar.svelte-1kpafo0{display:grid;grid-template-columns:auto 3em;align-items:center}.loading-bar-progress.svelte-1kpafo0{height:.5em;border-radius:.25rem;background:var(--playpilot-dark)}.loading-bar-fill.svelte-1kpafo0{height:100%;border-radius:.25rem;background:var(--playpilot-green);transition:width .2s}.loading-bar-label.svelte-1kpafo0{text-align:right}@keyframes svelte-1kpafo0-fade{0%,to{opacity:0}25%,75%{opacity:1}}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0){animation:svelte-1kpafo0-fade 2s infinite}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0):nth-child(1){animation-delay:.2s}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0):nth-child(2){animation-delay:.4s}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0):nth-child(3){animation-delay:.6s}.dismiss.svelte-1kpafo0{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin-top:4px;padding:4px;border:2px solid var(--playpilot-content-light);border-radius:4px;background:var(--playpilot-light);font-family:inherit;color:var(--playpilot-text-color-alt);font-size:12px;line-height:1;cursor:pointer}.dismiss.svelte-1kpafo0:hover{background:var(--playpilot-content-light);color:var(--playpilot-text-color)}.editor.svelte-11aj6xq{z-index:2147483646;display:flex;flex-direction:column;position:fixed;bottom:16px;right:16px;width:100%;max-width:352px;height:min(70vh,640px);min-height:min(25rem,80vh);margin:0;padding:16px;border-radius:24px;background:var(--playpilot-dark);box-shadow:var(--playpilot-shadow-large);color:var(--playpilot-text-color);font-family:var(--playpilot-font-family);transition:border-radius .1s;overflow-y:auto;overflow-x:hidden;line-height:normal}.panel-open.svelte-11aj6xq{overflow:hidden}.loading.svelte-11aj6xq{height:auto;min-height:0;border-radius:32px;margin-left:auto;padding-right:8px;color:var(--playpilot-text-color-alt);font-size:13.6px}.handles.svelte-11aj6xq,.header.svelte-11aj6xq{z-index:20;position:sticky;top:-16px;margin:-16px -16px 0}.handle.svelte-11aj6xq{opacity:0;transition:opacity .15s}.editor.svelte-11aj6xq:hover .handle:where(.svelte-11aj6xq){opacity:1}.header.svelte-11aj6xq{z-index:5;display:flex;align-items:center;padding:16px 16px 16px 24px;margin:0 -16px;border:0;background:var(--playpilot-dark)}.loading.svelte-11aj6xq .header:where(.svelte-11aj6xq){margin:-16px}.heading.svelte-11aj6xq{margin:0 12px 0 0;color:var(--playpilot-text-color);font-size:20px;font-weight:400;line-height:normal}.bubble.svelte-11aj6xq{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:24px;height:24px;border:0;padding:0;margin-right:auto;border-radius:50%;background:var(--playpilot-green);line-height:24px;text-align:center;font-size:13.6px}.items.svelte-11aj6xq{padding-top:8px;margin-bottom:auto}.empty.svelte-11aj6xq{padding:8px;font-size:13.6px;font-style:italic;color:var(--playpilot-text-color-alt)}.save.svelte-11aj6xq{z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:sticky;bottom:0;left:0;width:100%;margin-top:16px;padding:8px;border:0;border-radius:32px;background:var(--playpilot-content);box-shadow:0 0 16px 16px var(--playpilot-dark);transition:opacity .1s;font-family:inherit;color:var(--playpilot-text-color-alt);font-size:13.6px;cursor:pointer}.save.svelte-11aj6xq:hover{background:var(--playpilot-content-light);color:var(--playpilot-text-color)}.save[disabled].svelte-11aj6xq{opacity:.75;background:var(--playpilot-light);color:var(--playpilot-content-light)}.error.svelte-11aj6xq{margin-top:8px}.alert.svelte-11aj6xq{margin:8px 8px 0}.panel.svelte-11aj6xq{z-index:10;position:absolute;top:0;left:0;width:100%;height:100%;padding:24px;background:var(--playpilot-dark);overflow-y:auto}.trigger.svelte-qee95d{position:fixed;bottom:16px;right:16px}.button.svelte-qee95d{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:48px;height:48px;border:0;padding:12px;border-radius:50%;background:var(--playpilot-light);box-shadow:var(--playpilot-shadow-large);transition:transform 50ms;line-height:24px;text-align:center;font-size:13.6px}.button.svelte-qee95d:hover{filter:brightness(1.1);transform:scale(1.05)}.button.svelte-qee95d svg{width:100%}.close.svelte-qee95d{display:flex;text-align:center;justify-content:center;position:absolute;top:-8px;right:-8px;width:24px;height:24px;padding:4px;background:var(--playpilot-content);color:#fff}.close.svelte-qee95d svg{width:12px}:root{--playpilot-primary: #fa548a;--playpilot-dark: #101426;--playpilot-light: #1b2743;--playpilot-lighter: #233257;--playpilot-content: #354367;--playpilot-content-light: #4b5b82;--playpilot-green: #53bca0;--playpilot-font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;--playpilot-text-color: #fff;--playpilot-text-color-alt: #c8d4de;--playpilot-shadow: 3.2px 2.4px 2.4px rgba(0, 0, 0, .2);--playpilot-shadow-large: 2.4px 2.4px 3.2px rgba(0, 0, 0, .05), 3.2px 5.6px 5.6px rgba(0, 0, 0, .1), 1.6px 1.6px 12px rgba(0, 0, 0, .25);--playpilot-error: #ea5a5a;--playpilot-error-dark: #442533;--playpilot-warning: #f7c74e;--playpilot-warning-dark: #413c23}[data-playpilot-injection-key]{position:relative}.playpilot-injection-highlight{outline:4px solid var(--playpilot-primary)!important;outline-offset:8px!important;border-radius:.8px;scroll-margin:80px}.playpilot-styled-scrollbar{scrollbar-color:var(--playpilot-content-light) var(--playpilot-lighter);scrollbar-width:thin}.playpilot-styled-scrollbed::-webkit-scrollbar{width:12px}.playpilot-styled-scrollbed::-webkit-scrollbar-track{background:var(--playpilot-light)}.playpilot-styled-scrollbed::-webkit-scrollbar-thumb{border:2px solid var(--playpilot-light);border-radius:16px;background:var(--playpilot-lighter)}.playpilot-styled-scrollbed::-webkit-scrollbar-thumb:hover{background:var(--playpilot-content-light)}.playpilot-styled-scrollbed::-webkit-scrollbar-thumb:active{background:var(--playpilot-text-color-alt)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight]{font-weight:var(--playpilot-injection-font-weight)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-color]{color:var(--playpilot-injection-text-color)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-color-hover]:hover{color:var(--playpilot-injection-text-color-hover)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-decoration]{text-decoration:var(--playpilot-injection-text-decoration)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-decoration-hover]:hover{text-decoration:var(--playpilot-injection-text-decoration-hover)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-background-color]{background-color:var(--playpilot-injection-background-color)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-background-color-hover]:hover{background-color:var(--playpilot-injection-background-color-hover)}h1 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h2 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h3 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h4 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h5 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]){font-weight:inherit}h1 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h2 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h3 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h4 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h5 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings]{font-weight:var(--playpilot-injection-font-weight-headings)}::view-transition-old(playpilot-title-content),::view-transition-new(playpilot-title-content){height:100%}.playpilot-link-injections.svelte-13rmd3g *{box-sizing:border-box}.playpilot-link-injections.svelte-13rmd3g svg{fill:none}.playpilot-link-injections.svelte-13rmd3g a,.playpilot-link-injections.svelte-13rmd3g button,.playpilot-link-injections.svelte-13rmd3g input{transition:outline-offset .1s}.playpilot-link-injections.svelte-13rmd3g a:focus-visible,.playpilot-link-injections.svelte-13rmd3g button:focus-visible,.playpilot-link-injections.svelte-13rmd3g input:focus-visible{outline:2px solid white;outline-offset:2px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
3
- var mi=e=>{throw TypeError(e)};var pi=(e,t,n)=>t.has(e)||mi("Cannot "+n);var Cn=(e,t,n)=>(pi(e,t,"read from private field"),n?n.call(e):t.get(e)),Pn=(e,t,n)=>t.has(e)?mi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jn=(e,t,n,i)=>(pi(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();const Dn=!1;var Yn=Array.isArray,sa=Array.prototype.indexOf,Zn=Array.from,ca=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,Fi=Object.getOwnPropertyDescriptors,ua=Object.prototype,da=Array.prototype,Gn=Object.getPrototypeOf;function wt(e){return typeof e=="function"}const st=()=>{};function fa(e){for(var t=0;t<e.length;t++)e[t]()}function sn(e,t,n=!1){return e===void 0?n?t():t:e}const He=2,Vi=4,Kt=8,hn=16,Ve=32,Yt=64,cn=128,gt=256,un=512,Me=1024,rt=2048,gn=4096,Ue=8192,St=16384,Ui=32768,mt=65536,va=1<<17,zi=1<<19,Wi=1<<20,ze=Symbol("$state"),Ki=Symbol("legacy props"),_a=Symbol("");function Yi(e){return e===this.v}function Xn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ha(e,t){return e!==t}function Jn(e){return!Xn(e,this.v)}function ga(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ma(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function pa(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ya(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function wa(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ka(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ba(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function xa(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function Sa(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Et=!1,Ea=!1;function Ta(){Et=!0}const Qn=1,$n=2,Zi=4,Ia=8,Aa=16,Ca=1,Pa=2,ja=4,Ma=8,Na=16,La=1,Oa=2,Da=4,Ra=1,qa=2,we=Symbol(),Gi="http://www.w3.org/2000/svg";function Ee(e,t){var n={f:0,v:e,reactions:null,equals:Yi,rv:0,wv:0};return n}function U(e){return Ha(Ee(e))}function Xi(e,t=!1){var i;const n=Ee(e);return t||(n.equals=Jn),Et&&ie!==null&&ie.l!==null&&((i=ie.l).s??(i.s=[])).push(n),n}function Ha(e){return $!==null&&$.f&He&&(We===null?$a([e]):We.push(e)),e}function P(e,t){return $!==null&&Zt()&&$.f&(He|hn)&&(We===null||!We.includes(e))&&Sa(),Rn(e,t)}function Rn(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=_r(),Ji(e,rt),Zt()&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&(me!==null&&me.includes(e)?(Ye(Z,rt),kn(Z)):it===null?eo([e]):it.push(e))),t}function Ji(e,t){var n=e.reactions;if(n!==null)for(var i=Zt(),r=n.length,a=0;a<r;a++){var o=n[a],s=o.f;s&rt||!i&&o===Z||(Ye(o,t),s&(Me|gt)&&(s&He?Ji(o,gn):kn(o)))}}let Qi=!1;function X(e,t=null,n){if(typeof e!="object"||e===null||ze in e)return e;const i=Gn(e);if(i!==ua&&i!==da)return e;var r=new Map,a=Yn(e),o=Ee(0);a&&r.set("length",Ee(e.length));var s;return new Proxy(e,{defineProperty(l,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&ka();var f=r.get(d);return f===void 0?(f=Ee(u.value),r.set(d,f)):P(f,X(u.value,s)),!0},deleteProperty(l,d){var u=r.get(d);if(u===void 0)d in l&&r.set(d,Ee(we));else{if(a&&typeof d=="string"){var f=r.get("length"),_=Number(d);Number.isInteger(_)&&_<f.v&&P(f,_)}P(u,we),yi(o)}return!0},get(l,d,u){var g;if(d===ze)return e;var f=r.get(d),_=d in l;if(f===void 0&&(!_||(g=nt(l,d))!=null&&g.writable)&&(f=Ee(X(_?l[d]:we,s)),r.set(d,f)),f!==void 0){var m=c(f);return m===we?void 0:m}return Reflect.get(l,d,u)},getOwnPropertyDescriptor(l,d){var u=Reflect.getOwnPropertyDescriptor(l,d);if(u&&"value"in u){var f=r.get(d);f&&(u.value=c(f))}else if(u===void 0){var _=r.get(d),m=_==null?void 0:_.v;if(_!==void 0&&m!==we)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(l,d){var m;if(d===ze)return!0;var u=r.get(d),f=u!==void 0&&u.v!==we||Reflect.has(l,d);if(u!==void 0||Z!==null&&(!f||(m=nt(l,d))!=null&&m.writable)){u===void 0&&(u=Ee(f?X(l[d],s):we),r.set(d,u));var _=c(u);if(_===we)return!1}return f},set(l,d,u,f){var S;var _=r.get(d),m=d in l;if(a&&d==="length")for(var g=u;g<_.v;g+=1){var v=r.get(g+"");v!==void 0?P(v,we):g in l&&(v=Ee(we),r.set(g+"",v))}_===void 0?(!m||(S=nt(l,d))!=null&&S.writable)&&(_=Ee(void 0),P(_,X(u,s)),r.set(d,_)):(m=_.v!==we,P(_,X(u,s)));var p=Reflect.getOwnPropertyDescriptor(l,d);if(p!=null&&p.set&&p.set.call(f,u),!m){if(a&&typeof d=="string"){var y=r.get("length"),w=Number(d);Number.isInteger(w)&&w>=y.v&&P(y,w+1)}yi(o)}return!0},ownKeys(l){c(o);var d=Reflect.ownKeys(l).filter(_=>{var m=r.get(_);return m===void 0||m.v!==we});for(var[u,f]of r)f.v!==we&&!(u in l)&&d.push(u);return d},setPrototypeOf(){ba()}})}function yi(e,t=1){P(e,e.v+t)}function wi(e){return e!==null&&typeof e=="object"&&ze in e?e[ze]:e}function Ba(e,t){return Object.is(wi(e),wi(t))}var pe,$i,er;function Fa(){if(pe===void 0){pe=window;var e=Element.prototype,t=Node.prototype;$i=nt(t,"firstChild").get,er=nt(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function Tt(e=""){return document.createTextNode(e)}function ft(e){return $i.call(e)}function mn(e){return er.call(e)}function b(e,t){return ft(e)}function ne(e,t){{var n=ft(e);return n instanceof Comment&&n.data===""?mn(n):n}}function E(e,t=1,n=!1){let i=e;for(;t--;)i=mn(i);return i}function Va(e){e.textContent=""}function K(e){var t=He|rt;Z===null?t|=gt:Z.f|=Wi;var n=$!==null&&$.f&He?$:null;const i={children:null,ctx:ie,deps:null,equals:Yi,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??Z};return n!==null&&(n.children??(n.children=[])).push(i),i}function Ua(e){const t=K(e);return t.equals=Jn,t}function tr(e){var t=e.children;if(t!==null){e.children=null;for(var n=0;n<t.length;n+=1){var i=t[n];i.f&He?ei(i):Re(i)}}}function za(e){for(var t=e.parent;t!==null;){if(!(t.f&He))return t;t=t.parent}return null}function nr(e){var t,n=Z;Ie(za(e));try{tr(e),t=hr(e)}finally{Ie(n)}return t}function ir(e){var t=nr(e),n=(tt||e.f&gt)&&e.deps!==null?gn:Me;Ye(e,n),e.equals(t)||(e.v=t,e.wv=_r())}function ei(e){tr(e),Ht(e,0),Ye(e,St),e.v=e.children=e.deps=e.ctx=e.reactions=null}function Wa(e){Z===null&&$===null&&pa(),$!==null&&$.f&gt&&ma(),ni&&ga()}function Ka(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function It(e,t,n,i=!0){var r=(e&Yt)!==0,a=Z,o={ctx:ie,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:e|rt,first:null,fn:t,last:null,next:null,parent:r?null:a,prev:null,teardown:null,transitions:null,wv:0};if(n){var s=kt;try{ki(!0),wn(o),o.f|=Ui}catch(u){throw Re(o),u}finally{ki(s)}}else t!==null&&kn(o);var l=n&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&Wi)===0;if(!l&&!r&&i&&(a!==null&&Ka(o,a),$!==null&&$.f&He)){var d=$;(d.children??(d.children=[])).push(o)}return o}function Ya(){return $===null?!1:!tt}function Za(e){const t=It(Kt,null,!1);return Ye(t,Me),t.teardown=e,t}function pn(e){Wa();var t=Z!==null&&(Z.f&Ve)!==0&&ie!==null&&!ie.m;if(t){var n=ie;(n.e??(n.e=[])).push({fn:e,effect:Z,reaction:$})}else{var i=pt(e);return i}}function Ga(e){const t=It(Yt,e,!0);return(n={})=>new Promise(i=>{n.outro?vt(t,()=>{Re(t),i(void 0)}):(Re(t),i(void 0))})}function pt(e){return It(Vi,e,!1)}function yn(e){return It(Kt,e,!0)}function L(e){return Xe(e)}function Xe(e,t=0){return It(Kt|hn|t,e,!0)}function De(e,t=!0){return It(Kt|Ve,e,!0,t)}function rr(e){var t=e.teardown;if(t!==null){const n=ni,i=$;bi(!0),qe(null);try{t.call(null)}finally{bi(n),qe(i)}}}function ar(e){var t=e.deriveds;if(t!==null){e.deriveds=null;for(var n=0;n<t.length;n+=1)ei(t[n])}}function or(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;Re(n,t),n=i}}function Xa(e){for(var t=e.first;t!==null;){var n=t.next;t.f&Ve||Re(t),t=n}}function Re(e,t=!0){var n=!1;if((t||e.f&zi)&&e.nodes_start!==null){for(var i=e.nodes_start,r=e.nodes_end;i!==null;){var a=i===r?null:mn(i);i.remove(),i=a}n=!0}or(e,t&&!n),ar(e),Ht(e,0),Ye(e,St);var o=e.transitions;if(o!==null)for(const l of o)l.stop();rr(e);var s=e.parent;s!==null&&s.first!==null&&lr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function lr(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function vt(e,t){var n=[];ti(e,n,!0),sr(n,()=>{Re(e),t&&t()})}function sr(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var r of e)r.out(i)}else t()}function ti(e,t,n){if(!(e.f&Ue)){if(e.f^=Ue,e.transitions!==null)for(const o of e.transitions)(o.is_global||n)&&t.push(o);for(var i=e.first;i!==null;){var r=i.next,a=(i.f&mt)!==0||(i.f&Ve)!==0;ti(i,t,a?n:!1),i=r}}}function Dt(e){cr(e,!0)}function cr(e,t){if(e.f&Ue){Gt(e)&&wn(e),e.f^=Ue;for(var n=e.first;n!==null;){var i=n.next,r=(n.f&mt)!==0||(n.f&Ve)!==0;cr(n,r?t:!1),n=i}if(e.transitions!==null)for(const a of e.transitions)(a.is_global||t)&&a.in()}}let dn=!1,qn=[];function ur(){dn=!1;const e=qn.slice();qn=[],fa(e)}function At(e){dn||(dn=!0,queueMicrotask(ur)),qn.push(e)}function Ja(){dn&&ur()}function dr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const fr=0,Qa=1;let jt=!1,ln=fr,Rt=!1,qt=null,kt=!1,ni=!1;function ki(e){kt=e}function bi(e){ni=e}let ct=[],bt=0;let $=null;function qe(e){$=e}let Z=null;function Ie(e){Z=e}let We=null;function $a(e){We=e}let me=null,Pe=0,it=null;function eo(e){it=e}let vr=1,Hn=0,tt=!1,ie=null;function xi(e){ie=e}function _r(){return++vr}function Zt(){return!Et||ie!==null&&ie.l===null}function Gt(e){var d;var t=e.f;if(t&rt)return!0;if(t&gn){var n=e.deps,i=(t&gt)!==0;if(n!==null){var r,a,o=(t&un)!==0,s=i&&Z!==null&&!tt,l=n.length;if(o||s){for(r=0;r<l;r++)a=n[r],(o||!((d=a==null?void 0:a.reactions)!=null&&d.includes(e)))&&(a.reactions??(a.reactions=[])).push(e);o&&(e.f^=un)}for(r=0;r<l;r++)if(a=n[r],Gt(a)&&ir(a),a.wv>e.wv)return!0}(!i||Z!==null&&!tt)&&Ye(e,Me)}return!1}function to(e,t){for(var n=t;n!==null;){if(n.f&cn)try{n.fn(e);return}catch{n.f^=cn}n=n.parent}throw jt=!1,e}function no(e){return(e.f&St)===0&&(e.parent===null||(e.parent.f&cn)===0)}function Mn(){jt=!1}function Xt(e,t,n,i){if(jt){if(n===null&&(jt=!1),no(t))throw e;return}n!==null&&(jt=!0);{to(e,t);return}}function hr(e){var _;var t=me,n=Pe,i=it,r=$,a=tt,o=We,s=ie,l=e.f;me=null,Pe=0,it=null,$=l&(Ve|Yt)?null:e,tt=!kt&&(l&gt)!==0,We=null,ie=e.ctx,Hn++;try{var d=(0,e.fn)(),u=e.deps;if(me!==null){var f;if(Ht(e,Pe),u!==null&&Pe>0)for(u.length=Pe+me.length,f=0;f<me.length;f++)u[Pe+f]=me[f];else e.deps=u=me;if(!tt)for(f=Pe;f<u.length;f++)((_=u[f]).reactions??(_.reactions=[])).push(e)}else u!==null&&Pe<u.length&&(Ht(e,Pe),u.length=Pe);return d}finally{me=t,Pe=n,it=i,$=r,tt=a,We=o,ie=s}}function io(e,t){let n=t.reactions;if(n!==null){var i=sa.call(n,e);if(i!==-1){var r=n.length-1;r===0?n=t.reactions=null:(n[i]=n[r],n.pop())}}n===null&&t.f&He&&(me===null||!me.includes(t))&&(Ye(t,gn),t.f&(gt|un)||(t.f^=un),Ht(t,0))}function Ht(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)io(e,n[i])}function wn(e){var t=e.f;if(!(t&St)){Ye(e,Me);var n=Z,i=ie;Z=e;try{t&hn?Xa(e):or(e),ar(e),rr(e);var r=hr(e);e.teardown=typeof r=="function"?r:null,e.wv=vr;var a=e.deps,o;Dn&&Ea&&e.f&rt}catch(s){Xt(s,e,n,i||e.ctx)}finally{Z=n}}}function gr(){if(bt>1e3){bt=0;try{ya()}catch(e){if(qt!==null)Xt(e,qt,null);else throw e}}bt++}function mr(e){var t=e.length;if(t!==0){gr();var n=kt;kt=!0;try{for(var i=0;i<t;i++){var r=e[i];r.f&Me||(r.f^=Me);var a=[];pr(r,a),ro(a)}}finally{kt=n}}}function ro(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if(!(i.f&(St|Ue)))try{Gt(i)&&(wn(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?lr(i):i.fn=null))}catch(r){Xt(r,i,null,i.ctx)}}}function ao(){if(Rt=!1,bt>1001)return;const e=ct;ct=[],mr(e),Rt||(bt=0,qt=null)}function kn(e){ln===fr&&(Rt||(Rt=!0,queueMicrotask(ao))),qt=e;for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(Yt|Ve)){if(!(n&Me))return;t.f^=Me}}ct.push(t)}function pr(e,t){var n=e.first,i=[];e:for(;n!==null;){var r=n.f,a=(r&Ve)!==0,o=a&&(r&Me)!==0,s=n.next;if(!o&&!(r&Ue))if(r&Kt){if(a)n.f^=Me;else try{Gt(n)&&wn(n)}catch(f){Xt(f,n,null,n.ctx)}var l=n.first;if(l!==null){n=l;continue}}else r&Vi&&i.push(n);if(s===null){let f=n.parent;for(;f!==null;){if(e===f)break e;var d=f.next;if(d!==null){n=d;continue e}f=f.parent}}n=s}for(var u=0;u<i.length;u++)l=i[u],t.push(l),pr(l,t)}function yr(e){var t=ln,n=ct;try{gr();const r=[];ln=Qa,ct=r,Rt=!1,mr(n);var i=e==null?void 0:e();return Ja(),(ct.length>0||r.length>0)&&yr(),bt=0,qt=null,i}finally{ln=t,ct=n}}async function Bn(){await Promise.resolve(),yr()}function c(e){var u;var t=e.f,n=(t&He)!==0;if(n&&t&St){var i=nr(e);return ei(e),i}if($!==null){We!==null&&We.includes(e)&&xa();var r=$.deps;e.rv<Hn&&(e.rv=Hn,me===null&&r!==null&&r[Pe]===e?Pe++:me===null?me=[e]:me.push(e),it!==null&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&it.includes(e)&&(Ye(Z,rt),kn(Z)))}else if(n&&e.deps===null)for(var a=e,o=a.parent,s=a;o!==null;)if(o.f&He){var l=o;s=l,o=l.parent}else{var d=o;(u=d.deriveds)!=null&&u.includes(s)||(d.deriveds??(d.deriveds=[])).push(s);break}return n&&(a=e,Gt(a)&&ir(a)),e.v}function Ke(e){const t=$;try{return $=null,e()}finally{$=t}}const oo=-7169;function Ye(e,t){e.f=e.f&oo|t}function lo(e){return kr().get(e)}function wr(e,t){return kr().set(e,t),t}function kr(e){return ie===null&&dr(),ie.c??(ie.c=new Map(so(ie)||void 0))}function so(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}function ae(e,t=!1,n){ie={p:ie,c:null,e:null,m:!1,s:e,x:null,l:null},Et&&!t&&(ie.l={s:null,u:null,r1:[],r2:Ee(!1)})}function oe(e){const t=ie;if(t!==null){const o=t.e;if(o!==null){var n=Z,i=$;t.e=null;try{for(var r=0;r<o.length;r++){var a=o[r];Ie(a.effect),qe(a.reaction),pt(a.fn)}}finally{Ie(n),qe(i)}}ie=t.p,t.m=!0}return{}}function co(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(ze in e)Fn(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&ze in n&&Fn(n)}}}function Fn(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let i in e)try{Fn(e[i],t)}catch{}const n=Gn(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const i=Fi(n);for(let r in i){const a=i[r].get;if(a)try{a.call(e)}catch{}}}}}function uo(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const fo=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function vo(e){return fo.includes(e)}const _o={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject"};function ho(e){return e=e.toLowerCase(),_o[e]??e}const go=["touchstart","touchmove"];function mo(e){return go.includes(e)}function po(e,t){if(t){const n=document.body;e.autofocus=!0,At(()=>{document.activeElement===n&&e.focus()})}}let Si=!1;function yo(){Si||(Si=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function br(e){var t=$,n=Z;qe(null),Ie(null);try{return e()}finally{qe(t),Ie(n)}}function xr(e,t,n,i=n){e.addEventListener(t,()=>br(n));const r=e.__on_r;r?e.__on_r=()=>{r(),i(!0)}:e.__on_r=()=>i(!0),yo()}const Sr=new Set,Vn=new Set;function ii(e,t,n,i){function r(a){if(i.capture||Pt.call(t,a),!a.cancelBubble)return br(()=>n.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?At(()=>{t.addEventListener(e,r,i)}):t.addEventListener(e,r,i),r}function wo(e,t,n,i={}){var r=ii(t,e,n,i);return()=>{e.removeEventListener(t,r,i)}}function ce(e,t,n,i,r){var a={capture:i,passive:r},o=ii(e,t,n,a);(t===document.body||t===window||t===document)&&Za(()=>{t.removeEventListener(e,o,a)})}function fe(e){for(var t=0;t<e.length;t++)Sr.add(e[t]);for(var n of Vn)n(e)}function Pt(e){var w;var t=this,n=t.ownerDocument,i=e.type,r=((w=e.composedPath)==null?void 0:w.call(e))||[],a=r[0]||e.target,o=0,s=e.__root;if(s){var l=r.indexOf(s);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var d=r.indexOf(t);if(d===-1)return;l<=d&&(o=l)}if(a=r[o]||e.target,a!==t){ca(e,"currentTarget",{configurable:!0,get(){return a||n}});var u=$,f=Z;qe(null),Ie(null);try{for(var _,m=[];a!==null;){var g=a.assignedSlot||a.parentNode||a.host||null;try{var v=a["__"+i];if(v!==void 0&&!a.disabled)if(Yn(v)){var[p,...y]=v;p.apply(a,[e,...y])}else v.call(a,e)}catch(S){_?m.push(S):_=S}if(e.cancelBubble||g===t||g===null)break;a=g}if(_){for(let S of m)queueMicrotask(()=>{throw S});throw _}}finally{e.__root=t,delete e.currentTarget,qe(u),Ie(f)}}}function ko(e){var t;t=document.head.appendChild(Tt());try{Xe(()=>e(t),zi)}finally{}}function ri(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function _t(e,t){var n=Z;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function I(e,t){var n=(t&Ra)!==0,i=(t&qa)!==0,r,a=!e.startsWith("<!>");return()=>{r===void 0&&(r=ri(a?e:"<!>"+e),n||(r=ft(r)));var o=i?document.importNode(r,!0):r.cloneNode(!0);if(n){var s=ft(o),l=o.lastChild;_t(s,l)}else _t(o,o);return o}}function Ne(e,t,n="svg"){var i=!e.startsWith("<!>"),r=`<${n}>${i?e:"<!>"+e}</${n}>`,a;return()=>{if(!a){var o=ri(r),s=ft(o);a=ft(s)}var l=a.cloneNode(!0);return _t(l,l),l}}function Be(e=""){{var t=Tt(e+"");return _t(t,t),t}}function Fe(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Tt();return e.append(t,n),_t(t,n),e}function k(e,t){e!==null&&e.before(t)}let fn=!0;function Ei(e){fn=e}function G(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n==null?"":n+"")}function Jt(e,t){return bo(e,t)}const yt=new Map;function bo(e,{target:t,anchor:n,props:i={},events:r,context:a,intro:o=!0}){Fa();var s=new Set,l=f=>{for(var _=0;_<f.length;_++){var m=f[_];if(!s.has(m)){s.add(m);var g=mo(m);t.addEventListener(m,Pt,{passive:g});var v=yt.get(m);v===void 0?(document.addEventListener(m,Pt,{passive:g}),yt.set(m,1)):yt.set(m,v+1)}}};l(Zn(Sr)),Vn.add(l);var d=void 0,u=Ga(()=>{var f=n??t.appendChild(Tt());return De(()=>{if(a){ae({});var _=ie;_.c=a}r&&(i.$$events=r),fn=o,d=e(f,i)||{},fn=!0,a&&oe()}),()=>{var g;for(var _ of s){t.removeEventListener(_,Pt);var m=yt.get(_);--m===0?(document.removeEventListener(_,Pt),yt.delete(_)):yt.set(_,m)}Vn.delete(l),f!==n&&((g=f.parentNode)==null||g.removeChild(f))}});return Un.set(d,u),d}let Un=new WeakMap;function bn(e,t){const n=Un.get(e);return n?(Un.delete(e),n(t)):Promise.resolve()}function q(e,t,n=!1){var i=e,r=null,a=null,o=we,s=n?mt:0,l=!1;const d=(f,_=!0)=>{l=!0,u(_,f)},u=(f,_)=>{o!==(o=f)&&(o?(r?Dt(r):_&&(r=De(()=>_(i))),a&&vt(a,()=>{a=null})):(a?Dt(a):_&&(a=De(()=>_(i))),r&&vt(r,()=>{r=null})))};Xe(()=>{l=!1,t(d),l||u(null,null)},s)}function Er(e,t,n){var i=e,r=we,a,o=Zt()?ha:Xn;Xe(()=>{o(r,r=t())&&(a&&vt(a),a=De(()=>n(i)))})}function xt(e,t){return t}function xo(e,t,n,i){for(var r=[],a=t.length,o=0;o<a;o++)ti(t[o].e,r,!0);var s=a>0&&r.length===0&&n!==null;if(s){var l=n.parentNode;Va(l),l.append(n),i.clear(),et(e,t[0].prev,t[a-1].next)}sr(r,()=>{for(var d=0;d<a;d++){var u=t[d];s||(i.delete(u.k),et(e,u.prev,u.next)),Re(u.e,!s)}})}function at(e,t,n,i,r,a=null){var o=e,s={flags:t,items:new Map,first:null},l=(t&Zi)!==0;if(l){var d=e;o=d.appendChild(Tt())}var u=null,f=!1;Xe(()=>{var _=n(),m=Yn(_)?_:_==null?[]:Zn(_),g=m.length;if(!(f&&g===0)){f=g===0;{var v=$;So(m,s,o,r,t,(v.f&Ue)!==0,i)}a!==null&&(g===0?u?Dt(u):u=De(()=>a(o)):u!==null&&vt(u,()=>{u=null})),n()}})}function So(e,t,n,i,r,a,o,s){var F,V,W,J;var l=(r&Ia)!==0,d=(r&(Qn|$n))!==0,u=e.length,f=t.items,_=t.first,m=_,g,v=null,p,y=[],w=[],S,j,x,T;if(l)for(T=0;T<u;T+=1)S=e[T],j=o(S,T),x=f.get(j),x!==void 0&&((F=x.a)==null||F.measure(),(p??(p=new Set)).add(x));for(T=0;T<u;T+=1){if(S=e[T],j=o(S,T),x=f.get(j),x===void 0){var H=m?m.e.nodes_start:n;v=To(H,t,v,v===null?t.first:v.next,S,j,T,i,r),f.set(j,v),y=[],w=[],m=v.next;continue}if(d&&Eo(x,S,T,r),x.e.f&Ue&&(Dt(x.e),l&&((V=x.a)==null||V.unfix(),(p??(p=new Set)).delete(x))),x!==m){if(g!==void 0&&g.has(x)){if(y.length<w.length){var M=w[0],C;v=M.prev;var D=y[0],A=y[y.length-1];for(C=0;C<y.length;C+=1)Ti(y[C],M,n);for(C=0;C<w.length;C+=1)g.delete(w[C]);et(t,D.prev,A.next),et(t,v,D),et(t,A,M),m=M,v=A,T-=1,y=[],w=[]}else g.delete(x),Ti(x,m,n),et(t,x.prev,x.next),et(t,x,v===null?t.first:v.next),et(t,v,x),v=x;continue}for(y=[],w=[];m!==null&&m.k!==j;)(a||!(m.e.f&Ue))&&(g??(g=new Set)).add(m),w.push(m),m=m.next;if(m===null)continue;x=m}y.push(x),v=x,m=x.next}if(m!==null||g!==void 0){for(var B=g===void 0?[]:Zn(g);m!==null;)(a||!(m.e.f&Ue))&&B.push(m),m=m.next;var O=B.length;if(O>0){var z=r&Zi&&u===0?n:null;if(l){for(T=0;T<O;T+=1)(W=B[T].a)==null||W.measure();for(T=0;T<O;T+=1)(J=B[T].a)==null||J.fix()}xo(t,B,z,f)}}l&&At(()=>{var ee;if(p!==void 0)for(x of p)(ee=x.a)==null||ee.apply()}),Z.first=t.first&&t.first.e,Z.last=v&&v.e}function Eo(e,t,n,i){i&Qn&&Rn(e.v,t),i&$n?Rn(e.i,n):e.i=n}function To(e,t,n,i,r,a,o,s,l,d){var u=(l&Qn)!==0,f=(l&Aa)===0,_=u?f?Xi(r):Ee(r):r,m=l&$n?Ee(o):o,g={i:m,v:_,k:a,a:null,e:null,prev:n,next:i};try{return g.e=De(()=>s(e,_,m),Qi),g.e.prev=n&&n.e,g.e.next=i&&i.e,n===null?t.first=g:(n.next=g,n.e.next=g.e),i!==null&&(i.prev=g,i.e.prev=g.e),g}finally{}}function Ti(e,t,n){for(var i=e.next?e.next.e.nodes_start:n,r=t?t.e.nodes_start:n,a=e.e.nodes_start;a!==i;){var o=mn(a);r.before(a),a=o}}function et(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function Io(e,t,n,i,r){var a=e,o="",s;Xe(()=>{o!==(o=t()??"")&&(s!==void 0&&(Re(s),s=void 0),o!==""&&(s=De(()=>{var l=o+"",d=ri(l);_t(ft(d),d.lastChild),a.before(d)})))})}function Ct(e,t,...n){var i=e,r=st,a;Xe(()=>{r!==(r=t())&&(a&&(Re(a),a=null),a=De(()=>r(i,...n)))},mt)}function Ao(e,t,n,i,r,a){var o,s,l=null,d=e,u;Xe(()=>{const f=t()||null;var _=f==="svg"?Gi:null;f!==o&&(u&&(f===null?vt(u,()=>{u=null,s=null}):f===s?Dt(u):(Re(u),Ei(!1))),f&&f!==s&&(u=De(()=>{l=_?document.createElementNS(_,f):document.createElement(f),_t(l,l);{var m=l.appendChild(Tt());i(l,m)}Z.nodes_end=l,d.before(l)})),o=f,o&&(s=o),Ei(!0))},mt)}function Qt(e,t,n){pt(()=>{var i=Ke(()=>t(e,n==null?void 0:n())||{});if(n&&(i!=null&&i.update)){var r=!1,a={};yn(()=>{var o=n();co(o),r&&Xn(a,o)&&(a=o,i.update(o))}),r=!0}if(i!=null&&i.destroy)return()=>i.destroy()})}function Tr(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Tr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Co(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Tr(e))&&(i&&(i+=" "),i+=t);return i}function Po(e){return typeof e=="object"?Co(e):e??""}function jo(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ue(e,t,n,i){var r=e.__attributes??(e.__attributes={});r[t]!==(r[t]=n)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[_a]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Ir(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Mo(e,t,n,i,r=!1,a=!1,o=!1){var s=t||{},l=e.tagName==="OPTION";for(var d in t)d in n||(n[d]=null);n.class&&(n.class=Po(n.class)),n.class=n.class?n.class+" "+i:i;var u=Ir(e),f=e.__attributes??(e.__attributes={});for(const w in n){let S=n[w];if(l&&w==="value"&&S==null){e.value=e.__value="",s[w]=S;continue}var _=s[w];if(S!==_){s[w]=S;var m=w[0]+w[1];if(m!=="$$"){if(m==="on"){const j={},x="$$"+w;let T=w.slice(2);var g=vo(T);if(uo(T)&&(T=T.slice(0,-7),j.capture=!0),!g&&_){if(S!=null)continue;e.removeEventListener(T,s[x],j),s[x]=null}if(S!=null)if(g)e[`__${T}`]=S,fe([T]);else{let H=function(M){s[w].call(this,M)};var y=H;s[x]=ii(T,e,H,j)}else g&&(e[`__${T}`]=void 0)}else if(w==="style"&&S!=null)e.style.cssText=S+"";else if(w==="autofocus")po(e,!!S);else if(w==="__value"||w==="value"&&S!=null)e.value=e[w]=e.__value=S;else if(w==="selected"&&l)jo(e,S);else{var v=w;r||(v=ho(v));var p=v==="defaultValue"||v==="defaultChecked";if(S==null&&!a&&!p)if(f[w]=null,v==="value"||v==="checked"){let j=e;if(v==="value"){let x=j.defaultValue;j.removeAttribute(v),j.defaultValue=x}else{let x=j.defaultChecked;j.removeAttribute(v),j.defaultChecked=x}}else e.removeAttribute(w);else p||u.includes(v)&&(a||typeof S!="string")?e[v]=S:typeof S!="function"&&ue(e,v,S)}w==="style"&&"__styles"in e&&(e.__styles={})}}}return s}var Ii=new Map;function Ir(e){var t=Ii.get(e.nodeName);if(t)return t;Ii.set(e.nodeName,t=[]);for(var n,i=e,r=Element.prototype;r!==i;){n=Fi(i);for(var a in n)n[a].set&&t.push(a);i=Gn(i)}return t}function No(e,t,n){var i=e.__className,r=Lo(t);(i!==r||Qi)&&(t==null?e.removeAttribute("class"):e.className=r,e.__className=r)}function Lo(e,t){return(e??"")+""}function se(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}function xn(e,t,n,i){var r=e.__styles??(e.__styles={});r[t]!==n&&(r[t]=n,n==null?e.style.removeProperty(t):e.style.setProperty(t,n,""))}const Oo=()=>performance.now(),Ge={tick:e=>requestAnimationFrame(e),now:()=>Oo(),tasks:new Set};function Ar(){const e=Ge.now();Ge.tasks.forEach(t=>{t.c(e)||(Ge.tasks.delete(t),t.f())}),Ge.tasks.size!==0&&Ge.tick(Ar)}function Do(e){let t;return Ge.tasks.size===0&&Ge.tick(Ar),{promise:new Promise(n=>{Ge.tasks.add(t={c:e,f:n})}),abort(){Ge.tasks.delete(t)}}}function an(e,t){e.dispatchEvent(new CustomEvent(t))}function Ro(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;const t=e.split("-");return t.length===1?t[0]:t[0]+t.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("")}function Ai(e){const t={},n=e.split(";");for(const i of n){const[r,a]=i.split(":");if(!r||a===void 0)break;const o=Ro(r.trim());t[o]=a.trim()}return t}const qo=e=>e;function je(e,t,n,i){var r=(e&La)!==0,a=(e&Oa)!==0,o=r&&a,s=(e&Da)!==0,l=o?"both":r?"in":"out",d,u=t.inert,f,_;function m(){var w=$,S=Z;qe(null),Ie(null);try{return d??(d=n()(t,(i==null?void 0:i())??{},{direction:l}))}finally{qe(w),Ie(S)}}var g={is_global:s,in(){var w;if(t.inert=u,!r){_==null||_.abort(),(w=_==null?void 0:_.reset)==null||w.call(_);return}a||f==null||f.abort(),an(t,"introstart"),f=zn(t,m(),_,1,()=>{an(t,"introend"),f==null||f.abort(),f=d=void 0})},out(w){if(!a){w==null||w(),d=void 0;return}t.inert=!0,an(t,"outrostart"),_=zn(t,m(),f,0,()=>{an(t,"outroend"),w==null||w()})},stop:()=>{f==null||f.abort(),_==null||_.abort()}},v=Z;if((v.transitions??(v.transitions=[])).push(g),r&&fn){var p=s;if(!p){for(var y=v.parent;y&&y.f&mt;)for(;(y=y.parent)&&!(y.f&hn););p=!y||(y.f&Ui)!==0}p&&pt(()=>{Ke(()=>g.in())})}}function zn(e,t,n,i,r){var a=i===1;if(wt(t)){var o,s=!1;return At(()=>{if(!s){var p=t({direction:a?"in":"out"});o=zn(e,p,n,i,r)}}),{abort:()=>{s=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(n==null||n.deactivate(),!(t!=null&&t.duration))return r(),{abort:st,deactivate:st,reset:st,t:()=>i};const{delay:l=0,css:d,tick:u,easing:f=qo}=t;var _=[];if(a&&n===void 0&&(u&&u(0,1),d)){var m=Ai(d(0,1));_.push(m,m)}var g=()=>1-i,v=e.animate(_,{duration:l});return v.onfinish=()=>{var p=(n==null?void 0:n.t())??1-i;n==null||n.abort();var y=i-p,w=t.duration*Math.abs(y),S=[];if(w>0){if(d)for(var j=Math.ceil(w/16.666666666666668),x=0;x<=j;x+=1){var T=p+y*f(x/j),H=d(T,1-T);S.push(Ai(H))}g=()=>{var M=v.currentTime;return p+y*f(M/w)},u&&Do(()=>{if(v.playState!=="running")return!1;var M=g();return u(M,1-M),!0})}v=e.animate(S,{duration:w,fill:"forwards"}),v.onfinish=()=>{g=()=>i,u==null||u(i,1-i),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=st)},deactivate:()=>{r=st},reset:()=>{i===0&&(u==null||u(1,0))},t:()=>g()}}function Ho(e,t,n=t){var i=Zt();xr(e,"input",r=>{var a=r?e.defaultValue:e.value;if(a=Nn(e)?Ln(a):a,n(a),i&&a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd;e.value=a??"",s!==null&&(e.selectionStart=o,e.selectionEnd=Math.min(s,e.value.length))}}),Ke(t)==null&&e.value&&n(Nn(e)?Ln(e.value):e.value),yn(()=>{var r=t();Nn(e)&&r===Ln(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function Nn(e){var t=e.type;return t==="number"||t==="range"}function Ln(e){return e===""?null:+e}function Cr(e,t,n){if(e.multiple)return Vo(e,t);for(var i of e.options){var r=Mt(i);if(Ba(r,t)){i.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Bo(e,t){pt(()=>{var n=new MutationObserver(()=>{var i=e.__value;Cr(e,i)});return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),()=>{n.disconnect()}})}function Fo(e,t,n=t){var i=!0;xr(e,"change",r=>{var a=r?"[selected]":":checked",o;if(e.multiple)o=[].map.call(e.querySelectorAll(a),Mt);else{var s=e.querySelector(a)??e.querySelector("option:not([disabled])");o=s&&Mt(s)}n(o)}),pt(()=>{var r=t();if(Cr(e,r,i),i&&r===void 0){var a=e.querySelector(":checked");a!==null&&(r=Mt(a),n(r))}e.__value=r,i=!1}),Bo(e)}function Vo(e,t){for(var n of e.options)n.selected=~t.indexOf(Mt(n))}function Mt(e){return"__value"in e?e.__value:e.value}function Ci(e,t){return e===t||(e==null?void 0:e[ze])===t}function $t(e={},t,n,i){return pt(()=>{var r,a;return yn(()=>{r=a,a=[],Ke(()=>{e!==n(...a)&&(t(e,...a),r&&Ci(n(...r),e)&&t(null,...r))})}),()=>{At(()=>{a&&Ci(n(...a),e)&&t(null,...a)})}}),e}let on=!1;function Uo(e){var t=on;try{return on=!1,[e(),on]}finally{on=t}}const zo={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Wo(e,t,n){return new Proxy({props:e,exclude:t},zo)}const Ko={get(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i)return i[t]}},set(e,t,n){let i=e.props.length;for(;i--;){let r=e.props[i];wt(r)&&(r=r());const a=nt(r,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i){const r=nt(i,t);return r&&!r.configurable&&(r.configurable=!0),r}}},has(e,t){if(t===ze||t===Ki)return!1;for(let n of e.props)if(wt(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props){wt(n)&&(n=n());for(const i in n)t.includes(i)||t.push(i)}return t}};function Yo(...e){return new Proxy({props:e},Ko)}function Pi(e){for(var t=Z,n=Z;t!==null&&!(t.f&(Ve|Yt));)t=t.parent;try{return Ie(t),e()}finally{Ie(n)}}function N(e,t,n,i){var H;var r=(n&Ca)!==0,a=!Et||(n&Pa)!==0,o=(n&Ma)!==0,s=(n&Na)!==0,l=!1,d;o?[d,l]=Uo(()=>e[t]):d=e[t];var u=ze in e||Ki in e,f=o&&(((H=nt(e,t))==null?void 0:H.set)??(u&&t in e&&(M=>e[t]=M)))||void 0,_=i,m=!0,g=!1,v=()=>(g=!0,m&&(m=!1,s?_=Ke(i):_=i),_);d===void 0&&i!==void 0&&(f&&a&&wa(),d=v(),f&&f(d));var p;if(a)p=()=>{var M=e[t];return M===void 0?v():(m=!0,g=!1,M)};else{var y=Pi(()=>(r?K:Ua)(()=>e[t]));y.f|=va,p=()=>{var M=c(y);return M!==void 0&&(_=void 0),M===void 0?_:M}}if(!(n&ja))return p;if(f){var w=e.$$legacy;return function(M,C){return arguments.length>0?((!a||!C||w||l)&&f(C?p():M),M):p()}}var S=!1,j=!1,x=Xi(d),T=Pi(()=>K(()=>{var M=p(),C=c(x);return S?(S=!1,j=!0,C):(j=!1,x.v=M)}));return r||(T.equals=Jn),function(M,C){if(arguments.length>0){const D=C?c(T):a&&o?X(M):M;return T.equals(D)||(S=!0,P(x,D),g&&_!==void 0&&(_=D),Ke(()=>c(T))),M}return c(T)}}function ji(e,t){var n=Z,i=$,r=ie;Ie(e),qe(e),xi(e.ctx);try{t()}finally{Ie(n),qe(i),xi(r)}}function Zo(e,t,n){var i=e,r;Xe(()=>{var a=Z,o=!1;a.fn=s=>{var l=t.onerror;let d=t.failed;if(!l&&!d||o)throw s;var u=()=>{vt(r),ji(a,()=>{o=!1,r=De(()=>n(i)),Mn()})};l==null||l(s,u),r&&Re(r),At(()=>{ji(a,()=>{o=!0;try{r=De(()=>{d(i,()=>s,()=>u)})}catch(f){Xt(f,a,null,a.ctx)}Mn(),o=!1})})},r=De(()=>n(i)),Mn()},mt|cn)}function Je(e){ie===null&&dr(),Et&&ie.l!==null?Go(ie).m.push(e):pn(()=>{const t=Ke(e);if(typeof t=="function")return t})}function Go(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}const Xo="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Xo);const Pr="https://www.playpilot.com",Sn="https://partner-api.playpilot.tech/1.0.0",jr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",ye=Object.freeze({ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",TitleModalView:"ali_title_modal_view",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",TitlePopoverView:"ali_title_popover_view",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error"});function ai(){const e=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+e}const Jo="https://insights.playpilot.net";async function be(e,t=null,n={}){var r,a,o;const i=new Headers({"Content-Type":"application/json"});t&&(n={original_title:t.original_title,title_sid:t.sid,title_type:t.type,providers:[...new Set(((r=t.providers)==null?void 0:r.map(s=>s.name))||[])],...n}),n.url=ai(),n.organization_sid=(a=window.PlayPilotLinkInjections)==null?void 0:a.organization_sid,n.domain_sid=(o=window.PlayPilotLinkInjections)==null?void 0:o.domain_sid,fetch(Jo,{headers:i,method:"POST",body:JSON.stringify({event:e,payload:n,source:"ali"})})}function Qo({organizationSid:e=null,domainSid:t=null}){window.PlayPilotLinkInjections.organization_sid=e||null,window.PlayPilotLinkInjections.domain_sid=t||null}const oi="EncryptedToken",Mr="articleReplacementEditToken",Nr="playpilot-editorial-mode";async function Lr(e=window.location.href){const t=new Headers({"Content-Type":"application/json"});try{const n=In();if(!n)throw new Error("No token was provided");const i=li(e);if(!i)throw new Error("Could not be authenticated");const r=await fetch(Sn+`/external-pages/edit-authorization?api-token=${n}`,{headers:t,method:"POST",body:JSON.stringify({private_token:i})});if(!r.ok)throw r;return $o(i),!0}catch(n){console.error(n),be(ye.AuthFailed)}finally{nl()}return!1}function li(e=""){var i,r;const t=(i=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:i.editorial_token;if(t)return t;if(e){const a=new URL(e).searchParams.get(Mr);if(a)return decodeURI(a)}return((r=("; "+document.cookie).split(`; ${oi}=`).pop())==null?void 0:r.split(";")[0])||""}function $o(e){const t=new Date;t.setTime(t.getTime()+30*24*60*60*1e3);const i="expires="+t.toUTCString();document.cookie=oi+"="+e+";"+i+";path=/"}function el(){document.cookie=oi+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function Or(){var t;const e=(t=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:t.editorial_token;return new URLSearchParams(window.location.search).get(Nr)==="true"||!!e}function tl(){const e=new URL(window.location.href);e.searchParams.set(Nr,"true"),window.history.replaceState({},"",e)}function nl(){const e=new URL(window.location.href);e.searchParams.delete(Mr),window.history.replaceState({},"",e)}function il(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t=t*31+i>>>0}return t.toString(16)}function Dr(){return(Math.random()+1).toString(36).substring(7)}const h=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"}),rl={"Where To Stream Online":{[h.English]:"Where to stream online",[h.Swedish]:"Var kan man streama online",[h.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[h.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[h.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[h.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"An Error Occurred":{[h.English]:"An error occurred",[h.Swedish]:"Ett fel inträffade",[h.Danish]:"Der opstod en fejl"},"Title Unavailable":{[h.English]:"This title is not currently available to stream.",[h.Swedish]:"Den här titeln går inte att streama just nu.",[h.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[h.English]:"is not currently available to stream.",[h.Swedish]:"går inte att streama just nu.",[h.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[h.English]:"is available to stream on",[h.Swedish]:"finns att streama på",[h.Danish]:"kan streames på"},"Is Available To Stream":{[h.English]:"is available to stream.",[h.Swedish]:"finns att streama.",[h.Danish]:"kan streames."},"View Streaming Options":{[h.English]:"View streaming options",[h.Swedish]:"Se streamingalternativ",[h.Danish]:"Se streamingmuligheder"},And:{[h.English]:"and",[h.Swedish]:"och",[h.Danish]:"og"},Minutes:{[h.English]:"minutes",[h.Swedish]:"minuter",[h.Danish]:"minutter"},"Type: movie":{[h.English]:"Movie",[h.Swedish]:"Film",[h.Danish]:"Film"},"Type: series":{[h.English]:"Series",[h.Swedish]:"Serie",[h.Danish]:"Serie"},Stream:{[h.English]:"Stream",[h.Swedish]:"Streama",[h.Danish]:"Stream"},Buy:{[h.English]:"Buy",[h.Swedish]:"Köp",[h.Danish]:"Køb"},Rent:{[h.English]:"Rent",[h.Swedish]:"Hyra",[h.Danish]:"Lej"},"Rent Or Buy":{[h.English]:"Rent or Buy",[h.Swedish]:"Hyra",[h.Danish]:"Lej eller køb"},All:{[h.English]:"All",[h.Swedish]:"Alla",[h.Danish]:"Alle"},Unscripted:{[h.English]:"Unscripted",[h.Swedish]:"Oscripterat",[h.Danish]:"Umanuskriptet"},Independent:{[h.English]:"Independent",[h.Swedish]:"Indie",[h.Danish]:"Indie"},"Game Show":{[h.English]:"Game Show",[h.Swedish]:"Gameshow",[h.Danish]:"Quizshow"},"Film Noir":{[h.English]:"Film Noir",[h.Swedish]:"Film noir",[h.Danish]:"Film noir"},Entertainment:{[h.English]:"Entertainment",[h.Swedish]:"Underhållning",[h.Danish]:"Underholdning"},News:{[h.English]:"News",[h.Swedish]:"Nyheter",[h.Danish]:"Nyheder"},Short:{[h.English]:"Short",[h.Swedish]:"Kortfilm",[h.Danish]:"Kortfilm"},Bollywood:{[h.English]:"Bollywood",[h.Swedish]:"Bollywood",[h.Danish]:"Bollywood"},Concert:{[h.English]:"Concert",[h.Swedish]:"Konsert",[h.Danish]:"Koncert"},Arthouse:{[h.English]:"Arthouse",[h.Swedish]:"Arthouse",[h.Danish]:"Arthouse"},"Alternate Version":{[h.English]:"Alternate Version",[h.Swedish]:"Alternativ version",[h.Danish]:"Alternativ version"},"Reality TV":{[h.English]:"Reality TV",[h.Swedish]:"Reality-TV",[h.Danish]:"Reality-TV"},Culture:{[h.English]:"Culture",[h.Swedish]:"Kultur",[h.Danish]:"Kultur"},Drama:{[h.English]:"Drama",[h.Swedish]:"Drama",[h.Danish]:"Drama"},Crime:{[h.English]:"Crime",[h.Swedish]:"Kriminal",[h.Danish]:"Krimi"},Western:{[h.English]:"Western",[h.Swedish]:"Western",[h.Danish]:"Western"},Thriller:{[h.English]:"Thriller",[h.Swedish]:"Thriller",[h.Danish]:"Thriller"},Animation:{[h.English]:"Animation",[h.Swedish]:"Animerat",[h.Danish]:"Animation"},Mystery:{[h.English]:"Mystery",[h.Swedish]:"Mysterium",[h.Danish]:"Mysterium"},Science:{[h.English]:"Science",[h.Swedish]:"Vetenskap",[h.Danish]:"Videnskab"},Nature:{[h.English]:"Nature",[h.Swedish]:"Natur",[h.Danish]:"Natur"},War:{[h.English]:"War",[h.Swedish]:"Krig",[h.Danish]:"Krig"},"Sci-Fi":{[h.English]:"Sci-Fi",[h.Swedish]:"Sci-fi",[h.Danish]:"Sci-fi"},Documentary:{[h.English]:"Documentary",[h.Swedish]:"Dokumentär",[h.Danish]:"Dokumentar"},"Stand-up":{[h.English]:"Stand-up",[h.Swedish]:"Standup",[h.Danish]:"Stand-up"},"Talk Show":{[h.English]:"Talk Show",[h.Swedish]:"Talkshow",[h.Danish]:"Talkshow"},Fantasy:{[h.English]:"Fantasy",[h.Swedish]:"Fantasy",[h.Danish]:"Fantasy"},History:{[h.English]:"History",[h.Swedish]:"Historia",[h.Danish]:"Historie"},Adventure:{[h.English]:"Adventure",[h.Swedish]:"Äventyr",[h.Danish]:"Eventyr"},Action:{[h.English]:"Action",[h.Swedish]:"Action",[h.Danish]:"Action"},Horror:{[h.English]:"Horror",[h.Swedish]:"Skräck",[h.Danish]:"Gyser"},Comedy:{[h.English]:"Comedy",[h.Swedish]:"Komedi",[h.Danish]:"Komedie"},Biography:{[h.English]:"Biography",[h.Swedish]:"Biografi",[h.Danish]:"Biografi"},Music:{[h.English]:"Music",[h.Swedish]:"Musik",[h.Danish]:"Musik"},Sport:{[h.English]:"Sport",[h.Swedish]:"Sport",[h.Danish]:"Sport"},Romance:{[h.English]:"Romance",[h.Swedish]:"Romantik",[h.Danish]:"Romantik"},Kids:{[h.English]:"Kids",[h.Swedish]:"Barn",[h.Danish]:"Børn"},Lifestyle:{[h.English]:"Lifestyle",[h.Swedish]:"Livsstil",[h.Danish]:"Livsstil"},Musical:{[h.English]:"Musical",[h.Swedish]:"Musikal",[h.Danish]:"Musical"},Anime:{[h.English]:"Anime",[h.Swedish]:"Anime",[h.Danish]:"Anime"},Family:{[h.English]:"Family",[h.Swedish]:"Familj",[h.Danish]:"Familie"}};function ke(e,t=Rr()){var n;return((n=rl[e])==null?void 0:n[t])||e}function Rr(){var i,r;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.language,t=Object.values(h);if(e){if(t.includes(e))return e;console.warn(`PlayPilot Link Injections: ${e} is not an accepted language`)}const n=(r=document.querySelector("html"))==null?void 0:r.getAttribute("lang");if(n){if(t.includes(n))return n;const a=t.find(o=>o.toLowerCase().startsWith(n+"-"));if(a)return a}return h.English}const al=e=>e;function si(e){const t=e-1;return t*t*t+1}function Mi(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}function Bt(e,{delay:t=0,duration:n=400,easing:i=al}={}){const r=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:a=>`opacity: ${a*r}`}}function En(e,{delay:t=0,duration:n=400,easing:i=si,x:r=0,y:a=0,opacity:o=0}={}){const s=getComputedStyle(e),l=+s.opacity,d=s.transform==="none"?"":s.transform,u=l*(1-o),[f,_]=Mi(r),[m,g]=Mi(a);return{delay:t,duration:n,easing:i,css:(v,p)=>`
3
+ var yi=e=>{throw TypeError(e)};var wi=(e,t,n)=>t.has(e)||yi("Cannot "+n);var Pn=(e,t,n)=>(wi(e,t,"read from private field"),n?n.call(e):t.get(e)),Cn=(e,t,n)=>t.has(e)?yi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jn=(e,t,n,i)=>(wi(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();const On=!1;var Yn=Array.isArray,ca=Array.prototype.indexOf,Zn=Array.from,ua=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,Ui=Object.getOwnPropertyDescriptors,da=Object.prototype,fa=Array.prototype,Gn=Object.getPrototypeOf;function wt(e){return typeof e=="function"}const st=()=>{};function va(e){for(var t=0;t<e.length;t++)e[t]()}function sn(e,t,n=!1){return e===void 0?n?t():t:e}const He=2,zi=4,Kt=8,hn=16,Ve=32,Yt=64,cn=128,gt=256,un=512,Me=1024,rt=2048,gn=4096,Ue=8192,Et=16384,Wi=32768,mt=65536,_a=1<<17,Ki=1<<19,Yi=1<<20,ze=Symbol("$state"),Zi=Symbol("legacy props"),ha=Symbol("");function Gi(e){return e===this.v}function Xn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ga(e,t){return e!==t}function Jn(e){return!Xn(e,this.v)}function ma(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function pa(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ya(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wa(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ka(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ba(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function xa(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Sa(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function Ea(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Tt=!1,Ta=!1;function Ia(){Tt=!0}const Qn=1,$n=2,Xi=4,Aa=8,Pa=16,Ca=1,ja=2,Ma=4,La=8,Na=16,Da=1,Oa=2,Ra=4,qa=1,Ha=2,ke=Symbol(),Ji="http://www.w3.org/2000/svg";function Ee(e,t){var n={f:0,v:e,reactions:null,equals:Gi,rv:0,wv:0};return n}function U(e){return Ba(Ee(e))}function Qi(e,t=!1){var i;const n=Ee(e);return t||(n.equals=Jn),Tt&&ie!==null&&ie.l!==null&&((i=ie.l).s??(i.s=[])).push(n),n}function Ba(e){return $!==null&&$.f&He&&(We===null?eo([e]):We.push(e)),e}function P(e,t){return $!==null&&Zt()&&$.f&(He|hn)&&(We===null||!We.includes(e))&&Ea(),Rn(e,t)}function Rn(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=gr(),$i(e,rt),Zt()&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&(ye!==null&&ye.includes(e)?(Ye(Z,rt),kn(Z)):it===null?to([e]):it.push(e))),t}function $i(e,t){var n=e.reactions;if(n!==null)for(var i=Zt(),r=n.length,a=0;a<r;a++){var o=n[a],s=o.f;s&rt||!i&&o===Z||(Ye(o,t),s&(Me|gt)&&(s&He?$i(o,gn):kn(o)))}}let er=!1;function X(e,t=null,n){if(typeof e!="object"||e===null||ze in e)return e;const i=Gn(e);if(i!==da&&i!==fa)return e;var r=new Map,a=Yn(e),o=Ee(0);a&&r.set("length",Ee(e.length));var s;return new Proxy(e,{defineProperty(l,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&ba();var f=r.get(d);return f===void 0?(f=Ee(u.value),r.set(d,f)):P(f,X(u.value,s)),!0},deleteProperty(l,d){var u=r.get(d);if(u===void 0)d in l&&r.set(d,Ee(ke));else{if(a&&typeof d=="string"){var f=r.get("length"),_=Number(d);Number.isInteger(_)&&_<f.v&&P(f,_)}P(u,ke),ki(o)}return!0},get(l,d,u){var g;if(d===ze)return e;var f=r.get(d),_=d in l;if(f===void 0&&(!_||(g=nt(l,d))!=null&&g.writable)&&(f=Ee(X(_?l[d]:ke,s)),r.set(d,f)),f!==void 0){var m=c(f);return m===ke?void 0:m}return Reflect.get(l,d,u)},getOwnPropertyDescriptor(l,d){var u=Reflect.getOwnPropertyDescriptor(l,d);if(u&&"value"in u){var f=r.get(d);f&&(u.value=c(f))}else if(u===void 0){var _=r.get(d),m=_==null?void 0:_.v;if(_!==void 0&&m!==ke)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(l,d){var m;if(d===ze)return!0;var u=r.get(d),f=u!==void 0&&u.v!==ke||Reflect.has(l,d);if(u!==void 0||Z!==null&&(!f||(m=nt(l,d))!=null&&m.writable)){u===void 0&&(u=Ee(f?X(l[d],s):ke),r.set(d,u));var _=c(u);if(_===ke)return!1}return f},set(l,d,u,f){var S;var _=r.get(d),m=d in l;if(a&&d==="length")for(var g=u;g<_.v;g+=1){var v=r.get(g+"");v!==void 0?P(v,ke):g in l&&(v=Ee(ke),r.set(g+"",v))}_===void 0?(!m||(S=nt(l,d))!=null&&S.writable)&&(_=Ee(void 0),P(_,X(u,s)),r.set(d,_)):(m=_.v!==ke,P(_,X(u,s)));var p=Reflect.getOwnPropertyDescriptor(l,d);if(p!=null&&p.set&&p.set.call(f,u),!m){if(a&&typeof d=="string"){var y=r.get("length"),w=Number(d);Number.isInteger(w)&&w>=y.v&&P(y,w+1)}ki(o)}return!0},ownKeys(l){c(o);var d=Reflect.ownKeys(l).filter(_=>{var m=r.get(_);return m===void 0||m.v!==ke});for(var[u,f]of r)f.v!==ke&&!(u in l)&&d.push(u);return d},setPrototypeOf(){xa()}})}function ki(e,t=1){P(e,e.v+t)}function bi(e){return e!==null&&typeof e=="object"&&ze in e?e[ze]:e}function Fa(e,t){return Object.is(bi(e),bi(t))}var we,tr,nr;function Va(){if(we===void 0){we=window;var e=Element.prototype,t=Node.prototype;tr=nt(t,"firstChild").get,nr=nt(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function It(e=""){return document.createTextNode(e)}function ft(e){return tr.call(e)}function mn(e){return nr.call(e)}function b(e,t){return ft(e)}function ne(e,t){{var n=ft(e);return n instanceof Comment&&n.data===""?mn(n):n}}function E(e,t=1,n=!1){let i=e;for(;t--;)i=mn(i);return i}function Ua(e){e.textContent=""}function K(e){var t=He|rt;Z===null?t|=gt:Z.f|=Yi;var n=$!==null&&$.f&He?$:null;const i={children:null,ctx:ie,deps:null,equals:Gi,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??Z};return n!==null&&(n.children??(n.children=[])).push(i),i}function za(e){const t=K(e);return t.equals=Jn,t}function ir(e){var t=e.children;if(t!==null){e.children=null;for(var n=0;n<t.length;n+=1){var i=t[n];i.f&He?ei(i):Re(i)}}}function Wa(e){for(var t=e.parent;t!==null;){if(!(t.f&He))return t;t=t.parent}return null}function rr(e){var t,n=Z;Ie(Wa(e));try{ir(e),t=mr(e)}finally{Ie(n)}return t}function ar(e){var t=rr(e),n=(tt||e.f&gt)&&e.deps!==null?gn:Me;Ye(e,n),e.equals(t)||(e.v=t,e.wv=gr())}function ei(e){ir(e),Bt(e,0),Ye(e,Et),e.v=e.children=e.deps=e.ctx=e.reactions=null}function Ka(e){Z===null&&$===null&&ya(),$!==null&&$.f&gt&&pa(),ni&&ma()}function Ya(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function At(e,t,n,i=!0){var r=(e&Yt)!==0,a=Z,o={ctx:ie,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:e|rt,first:null,fn:t,last:null,next:null,parent:r?null:a,prev:null,teardown:null,transitions:null,wv:0};if(n){var s=kt;try{xi(!0),wn(o),o.f|=Wi}catch(u){throw Re(o),u}finally{xi(s)}}else t!==null&&kn(o);var l=n&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&Yi)===0;if(!l&&!r&&i&&(a!==null&&Ya(o,a),$!==null&&$.f&He)){var d=$;(d.children??(d.children=[])).push(o)}return o}function Za(){return $===null?!1:!tt}function Ga(e){const t=At(Kt,null,!1);return Ye(t,Me),t.teardown=e,t}function pn(e){Ka();var t=Z!==null&&(Z.f&Ve)!==0&&ie!==null&&!ie.m;if(t){var n=ie;(n.e??(n.e=[])).push({fn:e,effect:Z,reaction:$})}else{var i=pt(e);return i}}function Xa(e){const t=At(Yt,e,!0);return(n={})=>new Promise(i=>{n.outro?vt(t,()=>{Re(t),i(void 0)}):(Re(t),i(void 0))})}function pt(e){return At(zi,e,!1)}function yn(e){return At(Kt,e,!0)}function N(e){return Je(e)}function Je(e,t=0){return At(Kt|hn|t,e,!0)}function Oe(e,t=!0){return At(Kt|Ve,e,!0,t)}function or(e){var t=e.teardown;if(t!==null){const n=ni,i=$;Si(!0),qe(null);try{t.call(null)}finally{Si(n),qe(i)}}}function lr(e){var t=e.deriveds;if(t!==null){e.deriveds=null;for(var n=0;n<t.length;n+=1)ei(t[n])}}function sr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;Re(n,t),n=i}}function Ja(e){for(var t=e.first;t!==null;){var n=t.next;t.f&Ve||Re(t),t=n}}function Re(e,t=!0){var n=!1;if((t||e.f&Ki)&&e.nodes_start!==null){for(var i=e.nodes_start,r=e.nodes_end;i!==null;){var a=i===r?null:mn(i);i.remove(),i=a}n=!0}sr(e,t&&!n),lr(e),Bt(e,0),Ye(e,Et);var o=e.transitions;if(o!==null)for(const l of o)l.stop();or(e);var s=e.parent;s!==null&&s.first!==null&&cr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function cr(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function vt(e,t){var n=[];ti(e,n,!0),ur(n,()=>{Re(e),t&&t()})}function ur(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var r of e)r.out(i)}else t()}function ti(e,t,n){if(!(e.f&Ue)){if(e.f^=Ue,e.transitions!==null)for(const o of e.transitions)(o.is_global||n)&&t.push(o);for(var i=e.first;i!==null;){var r=i.next,a=(i.f&mt)!==0||(i.f&Ve)!==0;ti(i,t,a?n:!1),i=r}}}function Rt(e){dr(e,!0)}function dr(e,t){if(e.f&Ue){Gt(e)&&wn(e),e.f^=Ue;for(var n=e.first;n!==null;){var i=n.next,r=(n.f&mt)!==0||(n.f&Ve)!==0;dr(n,r?t:!1),n=i}if(e.transitions!==null)for(const a of e.transitions)(a.is_global||t)&&a.in()}}let dn=!1,qn=[];function fr(){dn=!1;const e=qn.slice();qn=[],va(e)}function Pt(e){dn||(dn=!0,queueMicrotask(fr)),qn.push(e)}function Qa(){dn&&fr()}function vr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const _r=0,$a=1;let Mt=!1,ln=_r,qt=!1,Ht=null,kt=!1,ni=!1;function xi(e){kt=e}function Si(e){ni=e}let ct=[],bt=0;let $=null;function qe(e){$=e}let Z=null;function Ie(e){Z=e}let We=null;function eo(e){We=e}let ye=null,Ce=0,it=null;function to(e){it=e}let hr=1,Hn=0,tt=!1,ie=null;function Ei(e){ie=e}function gr(){return++hr}function Zt(){return!Tt||ie!==null&&ie.l===null}function Gt(e){var d;var t=e.f;if(t&rt)return!0;if(t&gn){var n=e.deps,i=(t&gt)!==0;if(n!==null){var r,a,o=(t&un)!==0,s=i&&Z!==null&&!tt,l=n.length;if(o||s){for(r=0;r<l;r++)a=n[r],(o||!((d=a==null?void 0:a.reactions)!=null&&d.includes(e)))&&(a.reactions??(a.reactions=[])).push(e);o&&(e.f^=un)}for(r=0;r<l;r++)if(a=n[r],Gt(a)&&ar(a),a.wv>e.wv)return!0}(!i||Z!==null&&!tt)&&Ye(e,Me)}return!1}function no(e,t){for(var n=t;n!==null;){if(n.f&cn)try{n.fn(e);return}catch{n.f^=cn}n=n.parent}throw Mt=!1,e}function io(e){return(e.f&Et)===0&&(e.parent===null||(e.parent.f&cn)===0)}function Mn(){Mt=!1}function Xt(e,t,n,i){if(Mt){if(n===null&&(Mt=!1),io(t))throw e;return}n!==null&&(Mt=!0);{no(e,t);return}}function mr(e){var _;var t=ye,n=Ce,i=it,r=$,a=tt,o=We,s=ie,l=e.f;ye=null,Ce=0,it=null,$=l&(Ve|Yt)?null:e,tt=!kt&&(l&gt)!==0,We=null,ie=e.ctx,Hn++;try{var d=(0,e.fn)(),u=e.deps;if(ye!==null){var f;if(Bt(e,Ce),u!==null&&Ce>0)for(u.length=Ce+ye.length,f=0;f<ye.length;f++)u[Ce+f]=ye[f];else e.deps=u=ye;if(!tt)for(f=Ce;f<u.length;f++)((_=u[f]).reactions??(_.reactions=[])).push(e)}else u!==null&&Ce<u.length&&(Bt(e,Ce),u.length=Ce);return d}finally{ye=t,Ce=n,it=i,$=r,tt=a,We=o,ie=s}}function ro(e,t){let n=t.reactions;if(n!==null){var i=ca.call(n,e);if(i!==-1){var r=n.length-1;r===0?n=t.reactions=null:(n[i]=n[r],n.pop())}}n===null&&t.f&He&&(ye===null||!ye.includes(t))&&(Ye(t,gn),t.f&(gt|un)||(t.f^=un),Bt(t,0))}function Bt(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)ro(e,n[i])}function wn(e){var t=e.f;if(!(t&Et)){Ye(e,Me);var n=Z,i=ie;Z=e;try{t&hn?Ja(e):sr(e),lr(e),or(e);var r=mr(e);e.teardown=typeof r=="function"?r:null,e.wv=hr;var a=e.deps,o;On&&Ta&&e.f&rt}catch(s){Xt(s,e,n,i||e.ctx)}finally{Z=n}}}function pr(){if(bt>1e3){bt=0;try{wa()}catch(e){if(Ht!==null)Xt(e,Ht,null);else throw e}}bt++}function yr(e){var t=e.length;if(t!==0){pr();var n=kt;kt=!0;try{for(var i=0;i<t;i++){var r=e[i];r.f&Me||(r.f^=Me);var a=[];wr(r,a),ao(a)}}finally{kt=n}}}function ao(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if(!(i.f&(Et|Ue)))try{Gt(i)&&(wn(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?cr(i):i.fn=null))}catch(r){Xt(r,i,null,i.ctx)}}}function oo(){if(qt=!1,bt>1001)return;const e=ct;ct=[],yr(e),qt||(bt=0,Ht=null)}function kn(e){ln===_r&&(qt||(qt=!0,queueMicrotask(oo))),Ht=e;for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(Yt|Ve)){if(!(n&Me))return;t.f^=Me}}ct.push(t)}function wr(e,t){var n=e.first,i=[];e:for(;n!==null;){var r=n.f,a=(r&Ve)!==0,o=a&&(r&Me)!==0,s=n.next;if(!o&&!(r&Ue))if(r&Kt){if(a)n.f^=Me;else try{Gt(n)&&wn(n)}catch(f){Xt(f,n,null,n.ctx)}var l=n.first;if(l!==null){n=l;continue}}else r&zi&&i.push(n);if(s===null){let f=n.parent;for(;f!==null;){if(e===f)break e;var d=f.next;if(d!==null){n=d;continue e}f=f.parent}}n=s}for(var u=0;u<i.length;u++)l=i[u],t.push(l),wr(l,t)}function kr(e){var t=ln,n=ct;try{pr();const r=[];ln=$a,ct=r,qt=!1,yr(n);var i=e==null?void 0:e();return Qa(),(ct.length>0||r.length>0)&&kr(),bt=0,Ht=null,i}finally{ln=t,ct=n}}async function Bn(){await Promise.resolve(),kr()}function c(e){var u;var t=e.f,n=(t&He)!==0;if(n&&t&Et){var i=rr(e);return ei(e),i}if($!==null){We!==null&&We.includes(e)&&Sa();var r=$.deps;e.rv<Hn&&(e.rv=Hn,ye===null&&r!==null&&r[Ce]===e?Ce++:ye===null?ye=[e]:ye.push(e),it!==null&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&it.includes(e)&&(Ye(Z,rt),kn(Z)))}else if(n&&e.deps===null)for(var a=e,o=a.parent,s=a;o!==null;)if(o.f&He){var l=o;s=l,o=l.parent}else{var d=o;(u=d.deriveds)!=null&&u.includes(s)||(d.deriveds??(d.deriveds=[])).push(s);break}return n&&(a=e,Gt(a)&&ar(a)),e.v}function Ke(e){const t=$;try{return $=null,e()}finally{$=t}}const lo=-7169;function Ye(e,t){e.f=e.f&lo|t}function so(e){return xr().get(e)}function br(e,t){return xr().set(e,t),t}function xr(e){return ie===null&&vr(),ie.c??(ie.c=new Map(co(ie)||void 0))}function co(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}function ae(e,t=!1,n){ie={p:ie,c:null,e:null,m:!1,s:e,x:null,l:null},Tt&&!t&&(ie.l={s:null,u:null,r1:[],r2:Ee(!1)})}function oe(e){const t=ie;if(t!==null){const o=t.e;if(o!==null){var n=Z,i=$;t.e=null;try{for(var r=0;r<o.length;r++){var a=o[r];Ie(a.effect),qe(a.reaction),pt(a.fn)}}finally{Ie(n),qe(i)}}ie=t.p,t.m=!0}return{}}function uo(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(ze in e)Fn(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&ze in n&&Fn(n)}}}function Fn(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let i in e)try{Fn(e[i],t)}catch{}const n=Gn(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const i=Ui(n);for(let r in i){const a=i[r].get;if(a)try{a.call(e)}catch{}}}}}function fo(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const vo=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function _o(e){return vo.includes(e)}const ho={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject"};function go(e){return e=e.toLowerCase(),ho[e]??e}const mo=["touchstart","touchmove"];function po(e){return mo.includes(e)}function yo(e,t){if(t){const n=document.body;e.autofocus=!0,Pt(()=>{document.activeElement===n&&e.focus()})}}let Ti=!1;function wo(){Ti||(Ti=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Sr(e){var t=$,n=Z;qe(null),Ie(null);try{return e()}finally{qe(t),Ie(n)}}function Er(e,t,n,i=n){e.addEventListener(t,()=>Sr(n));const r=e.__on_r;r?e.__on_r=()=>{r(),i(!0)}:e.__on_r=()=>i(!0),wo()}const Tr=new Set,Vn=new Set;function ii(e,t,n,i){function r(a){if(i.capture||jt.call(t,a),!a.cancelBubble)return Sr(()=>n.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Pt(()=>{t.addEventListener(e,r,i)}):t.addEventListener(e,r,i),r}function ko(e,t,n,i={}){var r=ii(t,e,n,i);return()=>{e.removeEventListener(t,r,i)}}function ce(e,t,n,i,r){var a={capture:i,passive:r},o=ii(e,t,n,a);(t===document.body||t===window||t===document)&&Ga(()=>{t.removeEventListener(e,o,a)})}function fe(e){for(var t=0;t<e.length;t++)Tr.add(e[t]);for(var n of Vn)n(e)}function jt(e){var w;var t=this,n=t.ownerDocument,i=e.type,r=((w=e.composedPath)==null?void 0:w.call(e))||[],a=r[0]||e.target,o=0,s=e.__root;if(s){var l=r.indexOf(s);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var d=r.indexOf(t);if(d===-1)return;l<=d&&(o=l)}if(a=r[o]||e.target,a!==t){ua(e,"currentTarget",{configurable:!0,get(){return a||n}});var u=$,f=Z;qe(null),Ie(null);try{for(var _,m=[];a!==null;){var g=a.assignedSlot||a.parentNode||a.host||null;try{var v=a["__"+i];if(v!==void 0&&!a.disabled)if(Yn(v)){var[p,...y]=v;p.apply(a,[e,...y])}else v.call(a,e)}catch(S){_?m.push(S):_=S}if(e.cancelBubble||g===t||g===null)break;a=g}if(_){for(let S of m)queueMicrotask(()=>{throw S});throw _}}finally{e.__root=t,delete e.currentTarget,qe(u),Ie(f)}}}function bo(e){var t;t=document.head.appendChild(It());try{Je(()=>e(t),Ki)}finally{}}function ri(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function _t(e,t){var n=Z;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function I(e,t){var n=(t&qa)!==0,i=(t&Ha)!==0,r,a=!e.startsWith("<!>");return()=>{r===void 0&&(r=ri(a?e:"<!>"+e),n||(r=ft(r)));var o=i?document.importNode(r,!0):r.cloneNode(!0);if(n){var s=ft(o),l=o.lastChild;_t(s,l)}else _t(o,o);return o}}function Le(e,t,n="svg"){var i=!e.startsWith("<!>"),r=`<${n}>${i?e:"<!>"+e}</${n}>`,a;return()=>{if(!a){var o=ri(r),s=ft(o);a=ft(s)}var l=a.cloneNode(!0);return _t(l,l),l}}function Be(e=""){{var t=It(e+"");return _t(t,t),t}}function Fe(){var e=document.createDocumentFragment(),t=document.createComment(""),n=It();return e.append(t,n),_t(t,n),e}function k(e,t){e!==null&&e.before(t)}let fn=!0;function Ii(e){fn=e}function G(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n==null?"":n+"")}function Jt(e,t){return xo(e,t)}const yt=new Map;function xo(e,{target:t,anchor:n,props:i={},events:r,context:a,intro:o=!0}){Va();var s=new Set,l=f=>{for(var _=0;_<f.length;_++){var m=f[_];if(!s.has(m)){s.add(m);var g=po(m);t.addEventListener(m,jt,{passive:g});var v=yt.get(m);v===void 0?(document.addEventListener(m,jt,{passive:g}),yt.set(m,1)):yt.set(m,v+1)}}};l(Zn(Tr)),Vn.add(l);var d=void 0,u=Xa(()=>{var f=n??t.appendChild(It());return Oe(()=>{if(a){ae({});var _=ie;_.c=a}r&&(i.$$events=r),fn=o,d=e(f,i)||{},fn=!0,a&&oe()}),()=>{var g;for(var _ of s){t.removeEventListener(_,jt);var m=yt.get(_);--m===0?(document.removeEventListener(_,jt),yt.delete(_)):yt.set(_,m)}Vn.delete(l),f!==n&&((g=f.parentNode)==null||g.removeChild(f))}});return Un.set(d,u),d}let Un=new WeakMap;function bn(e,t){const n=Un.get(e);return n?(Un.delete(e),n(t)):Promise.resolve()}function q(e,t,n=!1){var i=e,r=null,a=null,o=ke,s=n?mt:0,l=!1;const d=(f,_=!0)=>{l=!0,u(_,f)},u=(f,_)=>{o!==(o=f)&&(o?(r?Rt(r):_&&(r=Oe(()=>_(i))),a&&vt(a,()=>{a=null})):(a?Rt(a):_&&(a=Oe(()=>_(i))),r&&vt(r,()=>{r=null})))};Je(()=>{l=!1,t(d),l||u(null,null)},s)}function Ir(e,t,n){var i=e,r=ke,a,o=Zt()?ga:Xn;Je(()=>{o(r,r=t())&&(a&&vt(a),a=Oe(()=>n(i)))})}function xt(e,t){return t}function So(e,t,n,i){for(var r=[],a=t.length,o=0;o<a;o++)ti(t[o].e,r,!0);var s=a>0&&r.length===0&&n!==null;if(s){var l=n.parentNode;Ua(l),l.append(n),i.clear(),et(e,t[0].prev,t[a-1].next)}ur(r,()=>{for(var d=0;d<a;d++){var u=t[d];s||(i.delete(u.k),et(e,u.prev,u.next)),Re(u.e,!s)}})}function at(e,t,n,i,r,a=null){var o=e,s={flags:t,items:new Map,first:null},l=(t&Xi)!==0;if(l){var d=e;o=d.appendChild(It())}var u=null,f=!1;Je(()=>{var _=n(),m=Yn(_)?_:_==null?[]:Zn(_),g=m.length;if(!(f&&g===0)){f=g===0;{var v=$;Eo(m,s,o,r,t,(v.f&Ue)!==0,i)}a!==null&&(g===0?u?Rt(u):u=Oe(()=>a(o)):u!==null&&vt(u,()=>{u=null})),n()}})}function Eo(e,t,n,i,r,a,o,s){var F,V,W,J;var l=(r&Aa)!==0,d=(r&(Qn|$n))!==0,u=e.length,f=t.items,_=t.first,m=_,g,v=null,p,y=[],w=[],S,j,x,T;if(l)for(T=0;T<u;T+=1)S=e[T],j=o(S,T),x=f.get(j),x!==void 0&&((F=x.a)==null||F.measure(),(p??(p=new Set)).add(x));for(T=0;T<u;T+=1){if(S=e[T],j=o(S,T),x=f.get(j),x===void 0){var H=m?m.e.nodes_start:n;v=Io(H,t,v,v===null?t.first:v.next,S,j,T,i,r),f.set(j,v),y=[],w=[],m=v.next;continue}if(d&&To(x,S,T,r),x.e.f&Ue&&(Rt(x.e),l&&((V=x.a)==null||V.unfix(),(p??(p=new Set)).delete(x))),x!==m){if(g!==void 0&&g.has(x)){if(y.length<w.length){var M=w[0],A;v=M.prev;var O=y[0],C=y[y.length-1];for(A=0;A<y.length;A+=1)Ai(y[A],M,n);for(A=0;A<w.length;A+=1)g.delete(w[A]);et(t,O.prev,C.next),et(t,v,O),et(t,C,M),m=M,v=C,T-=1,y=[],w=[]}else g.delete(x),Ai(x,m,n),et(t,x.prev,x.next),et(t,x,v===null?t.first:v.next),et(t,v,x),v=x;continue}for(y=[],w=[];m!==null&&m.k!==j;)(a||!(m.e.f&Ue))&&(g??(g=new Set)).add(m),w.push(m),m=m.next;if(m===null)continue;x=m}y.push(x),v=x,m=x.next}if(m!==null||g!==void 0){for(var B=g===void 0?[]:Zn(g);m!==null;)(a||!(m.e.f&Ue))&&B.push(m),m=m.next;var D=B.length;if(D>0){var z=r&Xi&&u===0?n:null;if(l){for(T=0;T<D;T+=1)(W=B[T].a)==null||W.measure();for(T=0;T<D;T+=1)(J=B[T].a)==null||J.fix()}So(t,B,z,f)}}l&&Pt(()=>{var ee;if(p!==void 0)for(x of p)(ee=x.a)==null||ee.apply()}),Z.first=t.first&&t.first.e,Z.last=v&&v.e}function To(e,t,n,i){i&Qn&&Rn(e.v,t),i&$n?Rn(e.i,n):e.i=n}function Io(e,t,n,i,r,a,o,s,l,d){var u=(l&Qn)!==0,f=(l&Pa)===0,_=u?f?Qi(r):Ee(r):r,m=l&$n?Ee(o):o,g={i:m,v:_,k:a,a:null,e:null,prev:n,next:i};try{return g.e=Oe(()=>s(e,_,m),er),g.e.prev=n&&n.e,g.e.next=i&&i.e,n===null?t.first=g:(n.next=g,n.e.next=g.e),i!==null&&(i.prev=g,i.e.prev=g.e),g}finally{}}function Ai(e,t,n){for(var i=e.next?e.next.e.nodes_start:n,r=t?t.e.nodes_start:n,a=e.e.nodes_start;a!==i;){var o=mn(a);r.before(a),a=o}}function et(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function Ao(e,t,n,i,r){var a=e,o="",s;Je(()=>{o!==(o=t()??"")&&(s!==void 0&&(Re(s),s=void 0),o!==""&&(s=Oe(()=>{var l=o+"",d=ri(l);_t(ft(d),d.lastChild),a.before(d)})))})}function Ct(e,t,...n){var i=e,r=st,a;Je(()=>{r!==(r=t())&&(a&&(Re(a),a=null),a=Oe(()=>r(i,...n)))},mt)}function Po(e,t,n,i,r,a){var o,s,l=null,d=e,u;Je(()=>{const f=t()||null;var _=f==="svg"?Ji:null;f!==o&&(u&&(f===null?vt(u,()=>{u=null,s=null}):f===s?Rt(u):(Re(u),Ii(!1))),f&&f!==s&&(u=Oe(()=>{l=_?document.createElementNS(_,f):document.createElement(f),_t(l,l);{var m=l.appendChild(It());i(l,m)}Z.nodes_end=l,d.before(l)})),o=f,o&&(s=o),Ii(!0))},mt)}function Qt(e,t,n){pt(()=>{var i=Ke(()=>t(e,n==null?void 0:n())||{});if(n&&(i!=null&&i.update)){var r=!1,a={};yn(()=>{var o=n();uo(o),r&&Xn(a,o)&&(a=o,i.update(o))}),r=!0}if(i!=null&&i.destroy)return()=>i.destroy()})}function Ar(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Ar(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Co(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Ar(e))&&(i&&(i+=" "),i+=t);return i}function jo(e){return typeof e=="object"?Co(e):e??""}function Mo(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ue(e,t,n,i){var r=e.__attributes??(e.__attributes={});r[t]!==(r[t]=n)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[ha]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Pr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Lo(e,t,n,i,r=!1,a=!1,o=!1){var s=t||{},l=e.tagName==="OPTION";for(var d in t)d in n||(n[d]=null);n.class&&(n.class=jo(n.class)),n.class=n.class?n.class+" "+i:i;var u=Pr(e),f=e.__attributes??(e.__attributes={});for(const w in n){let S=n[w];if(l&&w==="value"&&S==null){e.value=e.__value="",s[w]=S;continue}var _=s[w];if(S!==_){s[w]=S;var m=w[0]+w[1];if(m!=="$$"){if(m==="on"){const j={},x="$$"+w;let T=w.slice(2);var g=_o(T);if(fo(T)&&(T=T.slice(0,-7),j.capture=!0),!g&&_){if(S!=null)continue;e.removeEventListener(T,s[x],j),s[x]=null}if(S!=null)if(g)e[`__${T}`]=S,fe([T]);else{let H=function(M){s[w].call(this,M)};var y=H;s[x]=ii(T,e,H,j)}else g&&(e[`__${T}`]=void 0)}else if(w==="style"&&S!=null)e.style.cssText=S+"";else if(w==="autofocus")yo(e,!!S);else if(w==="__value"||w==="value"&&S!=null)e.value=e[w]=e.__value=S;else if(w==="selected"&&l)Mo(e,S);else{var v=w;r||(v=go(v));var p=v==="defaultValue"||v==="defaultChecked";if(S==null&&!a&&!p)if(f[w]=null,v==="value"||v==="checked"){let j=e;if(v==="value"){let x=j.defaultValue;j.removeAttribute(v),j.defaultValue=x}else{let x=j.defaultChecked;j.removeAttribute(v),j.defaultChecked=x}}else e.removeAttribute(w);else p||u.includes(v)&&(a||typeof S!="string")?e[v]=S:typeof S!="function"&&ue(e,v,S)}w==="style"&&"__styles"in e&&(e.__styles={})}}}return s}var Pi=new Map;function Pr(e){var t=Pi.get(e.nodeName);if(t)return t;Pi.set(e.nodeName,t=[]);for(var n,i=e,r=Element.prototype;r!==i;){n=Ui(i);for(var a in n)n[a].set&&t.push(a);i=Gn(i)}return t}function No(e,t,n){var i=e.__className,r=Do(t);(i!==r||er)&&(t==null?e.removeAttribute("class"):e.className=r,e.__className=r)}function Do(e,t){return(e??"")+""}function se(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}function xn(e,t,n,i){var r=e.__styles??(e.__styles={});r[t]!==n&&(r[t]=n,n==null?e.style.removeProperty(t):e.style.setProperty(t,n,""))}const Oo=()=>performance.now(),Xe={tick:e=>requestAnimationFrame(e),now:()=>Oo(),tasks:new Set};function Cr(){const e=Xe.now();Xe.tasks.forEach(t=>{t.c(e)||(Xe.tasks.delete(t),t.f())}),Xe.tasks.size!==0&&Xe.tick(Cr)}function Ro(e){let t;return Xe.tasks.size===0&&Xe.tick(Cr),{promise:new Promise(n=>{Xe.tasks.add(t={c:e,f:n})}),abort(){Xe.tasks.delete(t)}}}function an(e,t){e.dispatchEvent(new CustomEvent(t))}function qo(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;const t=e.split("-");return t.length===1?t[0]:t[0]+t.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("")}function Ci(e){const t={},n=e.split(";");for(const i of n){const[r,a]=i.split(":");if(!r||a===void 0)break;const o=qo(r.trim());t[o]=a.trim()}return t}const Ho=e=>e;function je(e,t,n,i){var r=(e&Da)!==0,a=(e&Oa)!==0,o=r&&a,s=(e&Ra)!==0,l=o?"both":r?"in":"out",d,u=t.inert,f,_;function m(){var w=$,S=Z;qe(null),Ie(null);try{return d??(d=n()(t,(i==null?void 0:i())??{},{direction:l}))}finally{qe(w),Ie(S)}}var g={is_global:s,in(){var w;if(t.inert=u,!r){_==null||_.abort(),(w=_==null?void 0:_.reset)==null||w.call(_);return}a||f==null||f.abort(),an(t,"introstart"),f=zn(t,m(),_,1,()=>{an(t,"introend"),f==null||f.abort(),f=d=void 0})},out(w){if(!a){w==null||w(),d=void 0;return}t.inert=!0,an(t,"outrostart"),_=zn(t,m(),f,0,()=>{an(t,"outroend"),w==null||w()})},stop:()=>{f==null||f.abort(),_==null||_.abort()}},v=Z;if((v.transitions??(v.transitions=[])).push(g),r&&fn){var p=s;if(!p){for(var y=v.parent;y&&y.f&mt;)for(;(y=y.parent)&&!(y.f&hn););p=!y||(y.f&Wi)!==0}p&&pt(()=>{Ke(()=>g.in())})}}function zn(e,t,n,i,r){var a=i===1;if(wt(t)){var o,s=!1;return Pt(()=>{if(!s){var p=t({direction:a?"in":"out"});o=zn(e,p,n,i,r)}}),{abort:()=>{s=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(n==null||n.deactivate(),!(t!=null&&t.duration))return r(),{abort:st,deactivate:st,reset:st,t:()=>i};const{delay:l=0,css:d,tick:u,easing:f=Ho}=t;var _=[];if(a&&n===void 0&&(u&&u(0,1),d)){var m=Ci(d(0,1));_.push(m,m)}var g=()=>1-i,v=e.animate(_,{duration:l});return v.onfinish=()=>{var p=(n==null?void 0:n.t())??1-i;n==null||n.abort();var y=i-p,w=t.duration*Math.abs(y),S=[];if(w>0){if(d)for(var j=Math.ceil(w/16.666666666666668),x=0;x<=j;x+=1){var T=p+y*f(x/j),H=d(T,1-T);S.push(Ci(H))}g=()=>{var M=v.currentTime;return p+y*f(M/w)},u&&Ro(()=>{if(v.playState!=="running")return!1;var M=g();return u(M,1-M),!0})}v=e.animate(S,{duration:w,fill:"forwards"}),v.onfinish=()=>{g=()=>i,u==null||u(i,1-i),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=st)},deactivate:()=>{r=st},reset:()=>{i===0&&(u==null||u(1,0))},t:()=>g()}}function Bo(e,t,n=t){var i=Zt();Er(e,"input",r=>{var a=r?e.defaultValue:e.value;if(a=Ln(e)?Nn(a):a,n(a),i&&a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd;e.value=a??"",s!==null&&(e.selectionStart=o,e.selectionEnd=Math.min(s,e.value.length))}}),Ke(t)==null&&e.value&&n(Ln(e)?Nn(e.value):e.value),yn(()=>{var r=t();Ln(e)&&r===Nn(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function Ln(e){var t=e.type;return t==="number"||t==="range"}function Nn(e){return e===""?null:+e}function jr(e,t,n){if(e.multiple)return Uo(e,t);for(var i of e.options){var r=Lt(i);if(Fa(r,t)){i.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Fo(e,t){pt(()=>{var n=new MutationObserver(()=>{var i=e.__value;jr(e,i)});return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),()=>{n.disconnect()}})}function Vo(e,t,n=t){var i=!0;Er(e,"change",r=>{var a=r?"[selected]":":checked",o;if(e.multiple)o=[].map.call(e.querySelectorAll(a),Lt);else{var s=e.querySelector(a)??e.querySelector("option:not([disabled])");o=s&&Lt(s)}n(o)}),pt(()=>{var r=t();if(jr(e,r,i),i&&r===void 0){var a=e.querySelector(":checked");a!==null&&(r=Lt(a),n(r))}e.__value=r,i=!1}),Fo(e)}function Uo(e,t){for(var n of e.options)n.selected=~t.indexOf(Lt(n))}function Lt(e){return"__value"in e?e.__value:e.value}function ji(e,t){return e===t||(e==null?void 0:e[ze])===t}function $t(e={},t,n,i){return pt(()=>{var r,a;return yn(()=>{r=a,a=[],Ke(()=>{e!==n(...a)&&(t(e,...a),r&&ji(n(...r),e)&&t(null,...r))})}),()=>{Pt(()=>{a&&ji(n(...a),e)&&t(null,...a)})}}),e}let on=!1;function zo(e){var t=on;try{return on=!1,[e(),on]}finally{on=t}}const Wo={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Ko(e,t,n){return new Proxy({props:e,exclude:t},Wo)}const Yo={get(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i)return i[t]}},set(e,t,n){let i=e.props.length;for(;i--;){let r=e.props[i];wt(r)&&(r=r());const a=nt(r,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i){const r=nt(i,t);return r&&!r.configurable&&(r.configurable=!0),r}}},has(e,t){if(t===ze||t===Zi)return!1;for(let n of e.props)if(wt(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props){wt(n)&&(n=n());for(const i in n)t.includes(i)||t.push(i)}return t}};function Zo(...e){return new Proxy({props:e},Yo)}function Mi(e){for(var t=Z,n=Z;t!==null&&!(t.f&(Ve|Yt));)t=t.parent;try{return Ie(t),e()}finally{Ie(n)}}function L(e,t,n,i){var H;var r=(n&Ca)!==0,a=!Tt||(n&ja)!==0,o=(n&La)!==0,s=(n&Na)!==0,l=!1,d;o?[d,l]=zo(()=>e[t]):d=e[t];var u=ze in e||Zi in e,f=o&&(((H=nt(e,t))==null?void 0:H.set)??(u&&t in e&&(M=>e[t]=M)))||void 0,_=i,m=!0,g=!1,v=()=>(g=!0,m&&(m=!1,s?_=Ke(i):_=i),_);d===void 0&&i!==void 0&&(f&&a&&ka(),d=v(),f&&f(d));var p;if(a)p=()=>{var M=e[t];return M===void 0?v():(m=!0,g=!1,M)};else{var y=Mi(()=>(r?K:za)(()=>e[t]));y.f|=_a,p=()=>{var M=c(y);return M!==void 0&&(_=void 0),M===void 0?_:M}}if(!(n&Ma))return p;if(f){var w=e.$$legacy;return function(M,A){return arguments.length>0?((!a||!A||w||l)&&f(A?p():M),M):p()}}var S=!1,j=!1,x=Qi(d),T=Mi(()=>K(()=>{var M=p(),A=c(x);return S?(S=!1,j=!0,A):(j=!1,x.v=M)}));return r||(T.equals=Jn),function(M,A){if(arguments.length>0){const O=A?c(T):a&&o?X(M):M;return T.equals(O)||(S=!0,P(x,O),g&&_!==void 0&&(_=O),Ke(()=>c(T))),M}return c(T)}}function Li(e,t){var n=Z,i=$,r=ie;Ie(e),qe(e),Ei(e.ctx);try{t()}finally{Ie(n),qe(i),Ei(r)}}function Go(e,t,n){var i=e,r;Je(()=>{var a=Z,o=!1;a.fn=s=>{var l=t.onerror;let d=t.failed;if(!l&&!d||o)throw s;var u=()=>{vt(r),Li(a,()=>{o=!1,r=Oe(()=>n(i)),Mn()})};l==null||l(s,u),r&&Re(r),Pt(()=>{Li(a,()=>{o=!0;try{r=Oe(()=>{d(i,()=>s,()=>u)})}catch(f){Xt(f,a,null,a.ctx)}Mn(),o=!1})})},r=Oe(()=>n(i)),Mn()},mt|cn)}function Ze(e){ie===null&&vr(),Tt&&ie.l!==null?Xo(ie).m.push(e):pn(()=>{const t=Ke(e);if(typeof t=="function")return t})}function Xo(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}const Jo="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Jo);const Mr="https://www.playpilot.com",Sn="https://partner-api.playpilot.tech/1.0.0",Lr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",he=Object.freeze({ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",TitleModalView:"ali_title_modal_view",TitleModalClose:"ali_title_modal_close",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",TitlePopoverView:"ali_title_popover_view",TitlePopoverClose:"ali_title_popover_close",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error"});function ai(){const e=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+e}const Qo="https://insights.playpilot.net";async function pe(e,t=null,n={}){var r,a,o;const i=new Headers({"Content-Type":"application/json"});t&&(n={original_title:t.original_title,title_sid:t.sid,title_type:t.type,providers:[...new Set(((r=t.providers)==null?void 0:r.map(s=>s.name))||[])],...n}),n.url=ai(),n.organization_sid=(a=window.PlayPilotLinkInjections)==null?void 0:a.organization_sid,n.domain_sid=(o=window.PlayPilotLinkInjections)==null?void 0:o.domain_sid,fetch(Qo,{headers:i,method:"POST",body:JSON.stringify({event:e,payload:n,source:"ali"})}),$o({event:e,payload:n})}function $o(e){var t;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(t=window.PlayPilotLinkInjections.tracked_events)==null||t.push(e)}function el({organizationSid:e=null,domainSid:t=null}){window.PlayPilotLinkInjections.organization_sid=e||null,window.PlayPilotLinkInjections.domain_sid=t||null}const oi="EncryptedToken",Nr="articleReplacementEditToken",Dr="playpilot-editorial-mode";async function Or(e=window.location.href){const t=new Headers({"Content-Type":"application/json"});try{const n=In();if(!n)throw new Error("No token was provided");const i=li(e);if(!i)throw new Error("Could not be authenticated");const r=await fetch(Sn+`/external-pages/edit-authorization?api-token=${n}`,{headers:t,method:"POST",body:JSON.stringify({private_token:i})});if(!r.ok)throw r;return tl(i),!0}catch(n){console.error(n),pe(he.AuthFailed)}finally{rl()}return!1}function li(e=""){var i,r;const t=(i=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:i.editorial_token;if(t)return t;if(e){const a=new URL(e).searchParams.get(Nr);if(a)return decodeURI(a)}return((r=("; "+document.cookie).split(`; ${oi}=`).pop())==null?void 0:r.split(";")[0])||""}function tl(e){const t=new Date;t.setTime(t.getTime()+30*24*60*60*1e3);const i="expires="+t.toUTCString();document.cookie=oi+"="+e+";"+i+";path=/"}function nl(){document.cookie=oi+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function Rr(){var t;const e=(t=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:t.editorial_token;return new URLSearchParams(window.location.search).get(Dr)==="true"||!!e}function il(){const e=new URL(window.location.href);e.searchParams.set(Dr,"true"),window.history.replaceState({},"",e)}function rl(){const e=new URL(window.location.href);e.searchParams.delete(Nr),window.history.replaceState({},"",e)}function al(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t=t*31+i>>>0}return t.toString(16)}function qr(){return(Math.random()+1).toString(36).substring(7)}const h=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"}),ol={"Where To Stream Online":{[h.English]:"Where to stream online",[h.Swedish]:"Var kan man streama online",[h.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[h.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[h.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[h.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"An Error Occurred":{[h.English]:"An error occurred",[h.Swedish]:"Ett fel inträffade",[h.Danish]:"Der opstod en fejl"},"Title Unavailable":{[h.English]:"This title is not currently available to stream.",[h.Swedish]:"Den här titeln går inte att streama just nu.",[h.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[h.English]:"is not currently available to stream.",[h.Swedish]:"går inte att streama just nu.",[h.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[h.English]:"is available to stream on",[h.Swedish]:"finns att streama på",[h.Danish]:"kan streames på"},"Is Available To Stream":{[h.English]:"is available to stream.",[h.Swedish]:"finns att streama.",[h.Danish]:"kan streames."},"View Streaming Options":{[h.English]:"View streaming options",[h.Swedish]:"Se streamingalternativ",[h.Danish]:"Se streamingmuligheder"},And:{[h.English]:"and",[h.Swedish]:"och",[h.Danish]:"og"},Minutes:{[h.English]:"minutes",[h.Swedish]:"minuter",[h.Danish]:"minutter"},"Type: movie":{[h.English]:"Movie",[h.Swedish]:"Film",[h.Danish]:"Film"},"Type: series":{[h.English]:"Series",[h.Swedish]:"Serie",[h.Danish]:"Serie"},Stream:{[h.English]:"Stream",[h.Swedish]:"Streama",[h.Danish]:"Stream"},Buy:{[h.English]:"Buy",[h.Swedish]:"Köp",[h.Danish]:"Køb"},Rent:{[h.English]:"Rent",[h.Swedish]:"Hyra",[h.Danish]:"Lej"},"Rent Or Buy":{[h.English]:"Rent or Buy",[h.Swedish]:"Hyra",[h.Danish]:"Lej eller køb"},All:{[h.English]:"All",[h.Swedish]:"Alla",[h.Danish]:"Alle"},Unscripted:{[h.English]:"Unscripted",[h.Swedish]:"Oscripterat",[h.Danish]:"Umanuskriptet"},Independent:{[h.English]:"Independent",[h.Swedish]:"Indie",[h.Danish]:"Indie"},"Game Show":{[h.English]:"Game Show",[h.Swedish]:"Gameshow",[h.Danish]:"Quizshow"},"Film Noir":{[h.English]:"Film Noir",[h.Swedish]:"Film noir",[h.Danish]:"Film noir"},Entertainment:{[h.English]:"Entertainment",[h.Swedish]:"Underhållning",[h.Danish]:"Underholdning"},News:{[h.English]:"News",[h.Swedish]:"Nyheter",[h.Danish]:"Nyheder"},Short:{[h.English]:"Short",[h.Swedish]:"Kortfilm",[h.Danish]:"Kortfilm"},Bollywood:{[h.English]:"Bollywood",[h.Swedish]:"Bollywood",[h.Danish]:"Bollywood"},Concert:{[h.English]:"Concert",[h.Swedish]:"Konsert",[h.Danish]:"Koncert"},Arthouse:{[h.English]:"Arthouse",[h.Swedish]:"Arthouse",[h.Danish]:"Arthouse"},"Alternate Version":{[h.English]:"Alternate Version",[h.Swedish]:"Alternativ version",[h.Danish]:"Alternativ version"},"Reality TV":{[h.English]:"Reality TV",[h.Swedish]:"Reality-TV",[h.Danish]:"Reality-TV"},Culture:{[h.English]:"Culture",[h.Swedish]:"Kultur",[h.Danish]:"Kultur"},Drama:{[h.English]:"Drama",[h.Swedish]:"Drama",[h.Danish]:"Drama"},Crime:{[h.English]:"Crime",[h.Swedish]:"Kriminal",[h.Danish]:"Krimi"},Western:{[h.English]:"Western",[h.Swedish]:"Western",[h.Danish]:"Western"},Thriller:{[h.English]:"Thriller",[h.Swedish]:"Thriller",[h.Danish]:"Thriller"},Animation:{[h.English]:"Animation",[h.Swedish]:"Animerat",[h.Danish]:"Animation"},Mystery:{[h.English]:"Mystery",[h.Swedish]:"Mysterium",[h.Danish]:"Mysterium"},Science:{[h.English]:"Science",[h.Swedish]:"Vetenskap",[h.Danish]:"Videnskab"},Nature:{[h.English]:"Nature",[h.Swedish]:"Natur",[h.Danish]:"Natur"},War:{[h.English]:"War",[h.Swedish]:"Krig",[h.Danish]:"Krig"},"Sci-Fi":{[h.English]:"Sci-Fi",[h.Swedish]:"Sci-fi",[h.Danish]:"Sci-fi"},Documentary:{[h.English]:"Documentary",[h.Swedish]:"Dokumentär",[h.Danish]:"Dokumentar"},"Stand-up":{[h.English]:"Stand-up",[h.Swedish]:"Standup",[h.Danish]:"Stand-up"},"Talk Show":{[h.English]:"Talk Show",[h.Swedish]:"Talkshow",[h.Danish]:"Talkshow"},Fantasy:{[h.English]:"Fantasy",[h.Swedish]:"Fantasy",[h.Danish]:"Fantasy"},History:{[h.English]:"History",[h.Swedish]:"Historia",[h.Danish]:"Historie"},Adventure:{[h.English]:"Adventure",[h.Swedish]:"Äventyr",[h.Danish]:"Eventyr"},Action:{[h.English]:"Action",[h.Swedish]:"Action",[h.Danish]:"Action"},Horror:{[h.English]:"Horror",[h.Swedish]:"Skräck",[h.Danish]:"Gyser"},Comedy:{[h.English]:"Comedy",[h.Swedish]:"Komedi",[h.Danish]:"Komedie"},Biography:{[h.English]:"Biography",[h.Swedish]:"Biografi",[h.Danish]:"Biografi"},Music:{[h.English]:"Music",[h.Swedish]:"Musik",[h.Danish]:"Musik"},Sport:{[h.English]:"Sport",[h.Swedish]:"Sport",[h.Danish]:"Sport"},Romance:{[h.English]:"Romance",[h.Swedish]:"Romantik",[h.Danish]:"Romantik"},Kids:{[h.English]:"Kids",[h.Swedish]:"Barn",[h.Danish]:"Børn"},Lifestyle:{[h.English]:"Lifestyle",[h.Swedish]:"Livsstil",[h.Danish]:"Livsstil"},Musical:{[h.English]:"Musical",[h.Swedish]:"Musikal",[h.Danish]:"Musical"},Anime:{[h.English]:"Anime",[h.Swedish]:"Anime",[h.Danish]:"Anime"},Family:{[h.English]:"Family",[h.Swedish]:"Familj",[h.Danish]:"Familie"}};function be(e,t=Hr()){var n;return((n=ol[e])==null?void 0:n[t])||e}function Hr(){var i,r;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.language,t=Object.values(h);if(e){if(t.includes(e))return e;console.warn(`PlayPilot Link Injections: ${e} is not an accepted language`)}const n=(r=document.querySelector("html"))==null?void 0:r.getAttribute("lang");if(n){if(t.includes(n))return n;const a=t.find(o=>o.toLowerCase().startsWith(n+"-"));if(a)return a}return h.English}const ll=e=>e;function si(e){const t=e-1;return t*t*t+1}function Ni(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}function Ft(e,{delay:t=0,duration:n=400,easing:i=ll}={}){const r=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:a=>`opacity: ${a*r}`}}function En(e,{delay:t=0,duration:n=400,easing:i=si,x:r=0,y:a=0,opacity:o=0}={}){const s=getComputedStyle(e),l=+s.opacity,d=s.transform==="none"?"":s.transform,u=l*(1-o),[f,_]=Ni(r),[m,g]=Ni(a);return{delay:t,duration:n,easing:i,css:(v,p)=>`
4
4
  transform: ${d} translate(${(1-v)*f}${_}, ${(1-v)*m}${g});
5
- opacity: ${l-u*p}`}}function Ft(e,{delay:t=0,duration:n=400,easing:i=si,axis:r="y"}={}){const a=getComputedStyle(e),o=+a.opacity,s=r==="y"?"height":"width",l=parseFloat(a[s]),d=r==="y"?["top","bottom"]:["left","right"],u=d.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),f=parseFloat(a[`padding${u[0]}`]),_=parseFloat(a[`padding${u[1]}`]),m=parseFloat(a[`margin${u[0]}`]),g=parseFloat(a[`margin${u[1]}`]),v=parseFloat(a[`border${u[0]}Width`]),p=parseFloat(a[`border${u[1]}Width`]);return{delay:t,duration:n,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${s}: ${y*l}px;padding-${d[0]}: ${y*f}px;padding-${d[1]}: ${y*_}px;margin-${d[0]}: ${y*m}px;margin-${d[1]}: ${y*g}px;border-${d[0]}-width: ${y*v}px;border-${d[1]}-width: ${y*p}px;min-${s}: 0`}}function ol(e,{delay:t=0,duration:n=400,easing:i=si,start:r=0,opacity:a=0}={}){const o=getComputedStyle(e),s=+o.opacity,l=o.transform==="none"?"":o.transform,d=1-r,u=s*(1-a);return{delay:t,duration:n,easing:i,css:(f,_)=>`
5
+ opacity: ${l-u*p}`}}function Vt(e,{delay:t=0,duration:n=400,easing:i=si,axis:r="y"}={}){const a=getComputedStyle(e),o=+a.opacity,s=r==="y"?"height":"width",l=parseFloat(a[s]),d=r==="y"?["top","bottom"]:["left","right"],u=d.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),f=parseFloat(a[`padding${u[0]}`]),_=parseFloat(a[`padding${u[1]}`]),m=parseFloat(a[`margin${u[0]}`]),g=parseFloat(a[`margin${u[1]}`]),v=parseFloat(a[`border${u[0]}Width`]),p=parseFloat(a[`border${u[1]}Width`]);return{delay:t,duration:n,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${s}: ${y*l}px;padding-${d[0]}: ${y*f}px;padding-${d[1]}: ${y*_}px;margin-${d[0]}: ${y*m}px;margin-${d[1]}: ${y*g}px;border-${d[0]}-width: ${y*v}px;border-${d[1]}-width: ${y*p}px;min-${s}: 0`}}function sl(e,{delay:t=0,duration:n=400,easing:i=si,start:r=0,opacity:a=0}={}){const o=getComputedStyle(e),s=+o.opacity,l=o.transform==="none"?"":o.transform,d=1-r,u=s*(1-a);return{delay:t,duration:n,easing:i,css:(f,_)=>`
6
6
  transform: ${l} scale(${1-d*_});
7
7
  opacity: ${s-u*_}
8
- `}}Ta();var ll=Ne('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M14 2L2 14M2 2L14 14" stroke="currentColor" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function qr(e){var t=ll();k(e,t)}function ci(e,t){ae(t,!0);const n=N(t,"size",3,"margin(2)"),i=N(t,"onclick",3,()=>null),r=Wo(t,["$$slots","$$events","$$legacy","children","size","onclick"]);var a=Fe(),o=ne(a);Ao(o,()=>t.href?"a":"button",!1,(s,l)=>{let d;L(()=>{d=Mo(s,d,{role:t.href?"link":"button",onclick:i(),class:"button",...r},"svelte-1qqv88o",s.namespaceURI===Gi,s.nodeName.includes("-")),xn(s,"--size",n())});var u=Fe(),f=ne(u);Ct(f,()=>t.children??st),k(l,u)}),k(e,a),oe()}function sl(e){P(e,e.v+1)}function cl(e){let t=0,n=Ee(0),i;return()=>{Ya()&&(c(n),yn(()=>(t===0&&(i=Ke(()=>e(()=>sl(n)))),t+=1,()=>{Bn().then(()=>{t-=1,t===0&&(i==null||i(),i=void 0)})})))}}var zt,Wt;class ul{constructor(t,n){Pn(this,zt);Pn(this,Wt);jn(this,zt,t),jn(this,Wt,cl(n))}get current(){return Cn(this,Wt).call(this),Cn(this,zt).call(this)}}zt=new WeakMap,Wt=new WeakMap;const dl=/\(.+\)/;class fl extends ul{constructor(t,n){let i=dl.test(t)?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,a=>wo(r,"change",a))}}const ui=new fl("(prefers-reduced-motion: reduce)");var vl=(e,t)=>t()(),_l=I('<div class="modal svelte-aqwna4"><div class="dialog svelte-aqwna4" role="dialog" aria-labelledby="title" data-view-transition-new=""><div class="close svelte-aqwna4"><!></div> <!></div> <div class="backdrop svelte-aqwna4"></div></div>');function Hr(e,t){ae(t,!0);const n=N(t,"onclose",3,()=>null),i=N(t,"onscroll",3,()=>null);wr("scope","modal"),Je(()=>{const f=document.body.style.overflowY;return document.body.style.overflowY="hidden",()=>document.body.style.overflowY=f||""});function r(f){return ui.current?Bt(f,{duration:0}):window.innerWidth<600?En(f,{duration:250,y:window.innerHeight}):ol(f,{duration:150,start:.85})}var a=_l();ce("keydown",pe,({key:f})=>{f==="Escape"&&n()()});var o=b(a),s=b(o),l=b(s);ci(l,{onclick:()=>n()(),children:(f,_)=>{qr(f)},$$slots:{default:!0}});var d=E(s,2);Ct(d,()=>t.children);var u=E(o,2);u.__click=[vl,n],ce("scroll",o,function(...f){var _;(_=i())==null||_.apply(this,f)}),je(7,o,()=>r),je(7,a,()=>Bt,()=>({duration:150})),k(e,a),oe()}fe(["click"]);const hl=[{slug:"100",name:"All",categories:{movie:100,series:100,documentary:100,kids:100,cinema:100,podcasts:100}},{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];var gl=I('<div class="genre svelte-1ebula3"> </div>'),ml=(e,t)=>P(t,!0),pl=I('<button class="genre expand svelte-1ebula3"> </button>'),yl=I("<!> <!>",1);function wl(e,t){ae(t,!0);let n=U(!1);const i=K(()=>c(n)?t.genres:[t.genres[0]]);var r=yl(),a=ne(r);at(a,17,()=>c(i),xt,(l,d)=>{var u=Fe();const f=K(()=>{var g;return(g=hl.find(v=>v.slug===c(d)))==null?void 0:g.name});var _=ne(u);{var m=g=>{var v=gl(),p=b(v);L(()=>G(p,ke(c(f)))),k(g,v)};q(_,g=>{c(f)&&g(m)})}k(l,u)});var o=E(a,2);{var s=l=>{var d=pl();d.__click=[ml,n];var u=b(d);L(()=>G(u,`+${t.genres.length-1}`)),k(l,d)};q(o,l=>{!c(n)&&t.genres.length>1&&l(s)})}k(e,r),oe()}fe(["click"]);function kl(e){let t=[];for(const n of e){let i=n;const r=t.find(s=>s.name===i.name),a=r==null?void 0:r.extra_info.category,o=i.extra_info.category;(a==="RENT"&&o==="BUY"||a==="BUY"&&o==="RENT")&&(t=t.filter(s=>s.name!==i.name),i={...i,extra_info:{...i.extra_info,category:"TVOD"}}),t.push(i)}return t}function xe(e,t=1){e.role="heading",e.ariaLevel=t.toString()}var bl=Ne('<svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 11L5 6L0 1" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function xl(e){var t=bl();k(e,t)}function Vt(e){return e?e.replace("/src/img",""):null}var Sl=(e,t,n)=>t(n()),El=I('<div class="arrow svelte-g63n1y"><!></div>'),Tl=I('<a target="_blank" class="playlink svelte-g63n1y" rel="sponsored"><img alt="" height="32" width="32" class="svelte-g63n1y"> <div><span class="name svelte-g63n1y"> </span> <div class="category svelte-g63n1y"> </div></div> <!></a>'),Il=I('<div class="playlink empty svelte-g63n1y"> </div>'),Al=I('<div class="heading svelte-g63n1y"> </div> <div class="playlinks svelte-g63n1y"><!> <!></div>',1);function Cl(e,t){ae(t,!0);const n=N(t,"list",3,!1),i=lo("scope")==="modal",r=K(()=>t.playlinks.filter(v=>!!v.logo_url)),a=K(()=>kl(c(r))),o={SVOD:ke("Stream"),BUY:ke("Buy"),RENT:ke("Rent"),TVOD:ke("Rent Or Buy")};function s(v){be(i?ye.TitleModalPlaylinkClick:ye.TitlePopoverPlaylinkClick,t.title,{playlink:v})}var l=Al(),d=ne(l),u=b(d);L(()=>G(u,ke("Where To Stream Online"))),Qt(d,(v,p)=>xe==null?void 0:xe(v,p),()=>3);var f=E(d,2),_=b(f);at(_,17,()=>c(a),xt,(v,p)=>{let y=()=>c(p).name,w=()=>c(p).url,S=()=>c(p).logo_url,j=()=>c(p).highlighted,x=()=>c(p).cta_text,T=()=>c(p).extra_info.category;var H=Tl();H.__click=[Sl,s,y];var M=b(H);L(()=>ue(M,"src",Vt(S())));var C=E(M,2),D=b(C),A=b(D),B=E(D,2),O=b(B);L(()=>G(O,x()||o[T()]||ke("Stream")));var z=E(C,2);{var F=V=>{var W=El(),J=b(W);xl(J),k(V,W)};q(z,V=>{n()&&V(F)})}L(()=>{ue(H,"href",w()),ue(H,"data-playlink",y()),se(H,"highlighted",j()&&x()),G(A,y())}),k(v,H)});var m=E(_,2);{var g=v=>{var p=Il(),y=b(p);L(()=>G(y,ke("Title Unavailable"))),k(v,p)};q(m,v=>{t.playlinks.length||v(g)})}L(()=>se(f,"list",n())),k(e,l),oe()}fe(["click"]);var Pl=(e,t)=>P(t,!0),jl=I('<button class="show-more svelte-1u3je71">Show more</button>'),Ml=I('<div class="paragraph svelte-1u3je71" role="paragraph"> </div>'),Nl=I('<div><span class="paragraph svelte-1u3je71" role="paragraph"> <!> <!></span> <!></div>');function Ll(e,t){ae(t,!0);const n=N(t,"blurb",3,""),i=N(t,"limit",3,200);let r=U(!1);const a=K(()=>t.text.slice(0,i()));var o=Nl(),s=b(o),l=b(s),d=E(l);{var u=v=>{var p=Be("...");k(v,p)};q(d,v=>{!c(r)&&t.text.length>i()&&v(u)})}var f=E(d,2);{var _=v=>{var p=jl();p.__click=[Pl,r],k(v,p)};q(f,v=>{!c(r)&&(t.text.length>i()||n())&&v(_)})}var m=E(s,2);{var g=v=>{var p=Ml(),y=b(p);L(()=>G(y,n())),k(v,p)};q(m,v=>{c(r)&&v(g)})}L(()=>G(l,c(r)?t.text:c(a))),k(e,o),oe()}fe(["click"]);var Ol=Ne('<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 0.351929L9.163 4.72803L14 5.43408L10.5 8.8385L11.326 13.648L7 11.3761L2.674 13.648L3.5 8.8385L0 5.43408L4.837 4.72803L7 0.351929Z" fill="#F6C045"></path></svg>');function Br(e){var t=Ol();k(e,t)}var Dl=I('<div class="top svelte-1026zg0"><img class="poster svelte-1026zg0"></div>'),Rl=I("<div> </div>"),ql=I('<img alt="" class="svelte-1026zg0">'),Hl=I('<div class="content svelte-1026zg0" data-playpilot-link-injections-title=""><div class="header svelte-1026zg0"><!> <div class="heading svelte-1026zg0" id="title"> </div> <div class="info svelte-1026zg0"><div class="imdb svelte-1026zg0"><!> </div> <!> <div> </div> <div class="capitalize svelte-1026zg0"> </div> <!></div></div> <div class="main"><!> <!></div></div> <div class="background svelte-1026zg0"><!></div>',1);function Fr(e,t){ae(t,!0);const n=N(t,"small",3,!1),i=N(t,"compact",3,!1);let r=U(!1),a=U(!1),o=U(!1);var s=Hl(),l=ne(s),d=b(l),u=b(d);{var f=F=>{var V=Dl(),W=b(V);L(()=>ue(W,"src",Vt(t.title.standing_poster))),L(()=>{ue(W,"alt",`Movie poster for '${t.title.title??""}'`),se(W,"loaded",c(r))}),ce("load",W,()=>P(r,!0)),k(F,V)};q(u,F=>{i()||F(f)})}var _=E(u,2),m=b(_);Qt(_,(F,V)=>xe==null?void 0:xe(F,V),()=>2);var g=E(_,2),v=b(g),p=b(v);Br(p);var y=E(p),w=E(v,2);wl(w,{get genres(){return t.title.genres}});var S=E(w,2),j=b(S),x=E(S,2),T=b(x);L(()=>G(T,ke(`Type: ${t.title.type}`)));var H=E(x,2);{var M=F=>{var V=Rl(),W=b(V);L(()=>G(W,`${t.title.length??""} ${ke("Minutes")??""}`)),k(F,V)};q(H,F=>{!n()&&t.title.length&&F(M)})}var C=E(d,2),D=b(C);Cl(D,{get playlinks(){return t.title.providers},get title(){return t.title},list:!0});var A=E(D,2);{var B=F=>{Ll(F,{get text(){return t.title.description},get blurb(){return t.title.blurb}})};q(A,F=>{n()||F(B)})}var O=E(l,2),z=b(O);Er(z,()=>c(o),F=>{var V=ql();L(()=>ue(V,"src",Vt(c(o)?t.title.standing_poster:t.title.medium_poster))),L(()=>{se(V,"loaded",c(a)),se(V,"blur",c(o))}),ce("load",V,()=>P(a,!0)),ce("error",V,()=>P(o,!0)),k(F,V)}),L(()=>{se(l,"small",n()),se(l,"compact",i()),se(_,"truncate",n()),G(m,t.title.title),G(y,` ${t.title.imdb_score??""}`),G(j,t.title.year),se(O,"faded",i())}),k(e,s),oe()}function Bl(e,t){ae(t,!0),be(ye.TitleModalView,t.title);let n=!1;function i(){n||(be(ye.TitleModalScroll,t.title),n=!0)}Hr(e,{get onclose(){return t.onclose},onscroll:i,children:(r,a)=>{Fr(r,{get title(){return t.title}})},$$slots:{default:!0}}),oe()}var Fl=I('<div class="popover svelte-tb2xdq" tabindex="-1" aria-hidden="true"><div class="dialog svelte-tb2xdq" data-view-transition-old=""><!></div></div>');function Vl(e,t){ae(t,!0);let n=N(t,"maxHeight",15);wr("scope","popover");let i=U(null),r=U(!1);Je(async()=>{await Bn(),a(),await Bn(),o()});function a(){if(!c(i))return;const{top:f,right:_,bottom:m,height:g}=c(i).getBoundingClientRect(),v=s();P(r,X(f-v<0&&window.innerHeight-m>f+g));const p=window.innerWidth-_-v;_+v>window.innerWidth&&(c(i).style.left=`${p}px`)}function o(){if(!c(i))return;const{top:f,height:_}=c(i).getBoundingClientRect(),m=s(),g=c(r)?window.innerHeight-f-m:f+_-m;n(Math.min(g,window.innerHeight*.8))}function s(){return parseFloat(getComputedStyle(document.documentElement).fontSize)}var l=Fl(),d=b(l),u=b(d);Ct(u,()=>t.children),$t(l,f=>P(i,f),()=>c(i)),L(()=>{se(l,"flip",c(r)),xn(l,"--max-height",n()?n()+"px":null)}),je(7,d,()=>En,()=>({duration:ui.current?0:100,y:10})),k(e,l),oe()}var Ul=I('<div class="title-popover svelte-d86q0q" data-playpilot-title-popover="" role="region" aria-labelledby="title"><!></div>');function zl(e,t){ae(t,!0);let n=U(0),i=U(null);be(ye.TitlePopoverView,t.title),Je(r);function r(){const s=t.event.target;if(!(s!=null&&s.getClientRects))return;const l=Array.from(s.getClientRects()),u=l.map(_=>_.x).map(_=>Math.abs(_-t.event.clientX)),f=l[u.indexOf(Math.min(...u))];c(i).style.top=f.top+window.scrollY+"px",c(i).style.left=f.left+window.scrollX+"px",c(i).style.height=f.height+"px"}var a=Ul(),o=b(a);Vl(o,{get maxHeight(){return c(n)},set maxHeight(s){P(n,X(s))},children:(s,l)=>{var d=K(()=>!!c(n)&&c(n)<250);Fr(s,{get title(){return t.title},small:!0,get compact(){return c(d)}})},$$slots:{default:!0}}),$t(a,s=>P(i,s),()=>c(i)),k(e,a),oe()}var Wl=e=>e.stopPropagation(),Kl=(e,t,n,i)=>t(e,c(n).title_details,c(i)),Yl=I(' <span class="svelte-pfvkex"><button class="svelte-pfvkex"> </button></span>',1),Zl=(e,t,n,i)=>t(c(n).title_details,i()),Gl=I('<!> <a target="_blank"> </a>',1),Xl=I(" <!>.",1),Jl=I("<!> <br>",1),Ql=I(" <br>",1),$l=I('<span class="svelte-pfvkex"><!></span>'),es=I('<p class="svelte-pfvkex"></p>');function ts(e,t){ae(t,!0);const n=N(t,"onclickmodal",3,()=>null);function i(l,d){be(ye.AfterArticlePlaylinkClick,l,{playlink:d})}function r(l,d,u){be(ye.AfterArticleModalButtonClick,d),n()(l,u)}var a=Fe(),o=ne(a);{var s=l=>{var d=es();at(d,21,()=>t.linkInjections,xt,(u,f)=>{var _=$l();const m=K(()=>{const{key:w,title:S,title_details:j,after_article_style:x}=c(f);return{key:w,title:S,title_details:j,after_article_style:x}}),g=K(()=>{var w;return((w=c(m).title_details)==null?void 0:w.providers)||[]});var v=b(_);{var p=w=>{var S=Jl(),j=ne(S);{var x=H=>{var M=Yl(),C=ne(M);L(()=>G(C,`"${c(m).title??""}" ${ke("Is Available To Stream")??""} `));var D=E(C);D.__click=[Wl];var A=b(D);A.__click=[Kl,r,m,f];var B=b(A);L(()=>G(B,ke("View Streaming Options"))),k(H,M)},T=H=>{var M=Xl(),C=ne(M);L(()=>G(C,`"${c(m).title??""}" ${ke("Is Available To Stream On")??""} `));var D=E(C);at(D,17,()=>c(g),xt,(A,B,O)=>{let z=()=>c(B).name,F=()=>c(B).url;var V=Gl(),W=ne(V);{var J=de=>{var Ae=Be();L(()=>G(Ae,O===c(g).length-1?`, ${ke("And")}`:",")),k(de,Ae)};q(W,de=>{O&&de(J)})}var ee=E(W,2);ee.__click=[Zl,i,m,z];var re=b(ee);L(()=>{ue(ee,"href",F()),G(re,z())}),k(A,V)}),k(H,M)};q(j,H=>{c(m).after_article_style==="modal_button"?H(x):H(T,!1)})}k(w,S)},y=w=>{var S=Ql(),j=ne(S);L(()=>G(j,`"${c(m).title??""}" ${ke("Title Unavailable Suffix")??""} `)),k(w,S)};q(v,w=>{c(g).length?w(p):w(y,!1)})}L(()=>ue(_,"data-playpilot-injection-key",c(m).key)),k(u,_)}),k(l,d)};q(o,l=>{t.linkInjections.length&&l(s)})}k(e,a),oe()}fe(["click"]);function ns(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function di(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||""}function Ni(e,t,n=[]){var a,o;const i=document.createTreeWalker(t);let r;for(;(r=i.nextNode())&&!((a=r.nodeValue)!=null&&a.includes(e)&&!n.includes(((o=r.parentNode)==null?void 0:o.nodeName)||"")););return r}function Li(e){const t=e.parentNode;return t?t.nodeName==="A"||!!t.closest("a"):!1}function is(e,t,n,i){const r=ns(t),a=di(t),o=e.slice(0,i),s=e.slice(i),l=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${a.replace(l,"\\$&")}|${r.replace(l,"\\$&")}`),u=s.replace(d,n);return o+u}function rs(e,t,n,i){return e.substring(0,n)+t+e.substring(i)}function Te(e){return di(e).toLowerCase().replace(/\s+/g,"")}function Vr(e,t,n){const r=e.indexOf(t),a=Math.floor((n-t.length)/2);let o=Math.max(0,r-a),s=o+n;s>e.length&&(s=e.length,o=Math.max(0,s-n));let l=e.slice(o,s).trim();return o>0&&(l="…"+l),s<e.length&&(l+="…"),l}function as(e,t,n){const i=e.nodeType===Node.TEXT_NODE&&e.parentNode?e.parentElement:e;if(!i||!e.textContent)return{before:"",after:""};const r=i.innerText.indexOf(e.textContent),a=Oi(i.innerText.slice(0,t+r)),o=i.innerText.slice(n+r),s=Oi(Di(a,2)),l=Di(o,2);return{before:s,after:l}}function Oi(e){return e.split("").reverse().join("")}function Di(e,t=1){const n=e.match(/[^\s]+/g);return n?n.slice(0,t).join(" ").replace(/[.,!?;:]+$/u,""):""}function os(e,t){let n=0,i=0;for(;(i=e.indexOf(t,i))!==-1;)n++,i+=t.length;return n}function ls(e,t,n){const i=[];let r=0;for(;r<=e.length;){const a=t?e.indexOf(t,r):r;if(a===-1&&t)break;const o=t?a+t.length:a,s=n?e.indexOf(n,o):e.length;if(n&&s===-1)break;const l=e.slice(o,s);i.push({match:l,index:o}),r=n?s+n.length:e.length+1}return i}function ss(e,t,n,i){const a=ls(e,n,i).filter(({match:s})=>di(s).includes(t));return a.length?a.reduce((s,l)=>!s||l.match.length<s.match.length?l:s):null}function cs(e){var t,n;return{leadingSpaces:((t=e.match(/^\s*/))==null?void 0:t[0].length)||0,trailingSpaces:((n=e.match(/\s*$/))==null?void 0:n[0].length)||0}}function Ur(e){return e.ctrlKey||e.metaKey||e.button!==0}function us(e,t){if(!document.startViewTransition||!t){e();return}document.startViewTransition(()=>{const n=document.querySelector("[data-view-transition-old]");if(!n)return;const i=window.getComputedStyle(n).getPropertyValue("view-transition-name");n.style.viewTransitionName="none",e();const r=document.querySelector("[data-view-transition-new]");r&&(r.style.viewTransitionName=i)})}const ut="data-playpilot-injection-key",Nt=`[${ut}]`;let vn=null,dt=null,Lt=null,Ot=null;function zr(e,t=""){const n=[],i=[e];for(;i.length>0;){const r=i.pop();if(n.includes(r)||t&&r.matches(t)||/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|H1)$/.test(r.tagName)||r.offsetWidth<=1)continue;const a=Array.from(r.childNodes).some(l=>{var d;return l.nodeType===Node.TEXT_NODE&&((d=l.nodeValue)==null?void 0:d.trim())!==""});if(a&&r.tagName==="LI"){const l=r.closest("ul, ol");l&&!n.includes(l)&&n.push(l);continue}const o=r.tagName==="P"&&!!r.textContent;if(a||o){n.push(r);continue}const s=Array.from(r.children);for(let l=s.length-1;l>=0;l--)i.push(s[l])}return n}function Ut(){var t;const e=(t=window.PlayPilotLinkInjections)==null?void 0:t.selector;if(e){const n=e.replace(/(:)/g,"\\$1"),i=document.querySelector(n);if(i)return i}return document.querySelector("article")||document.querySelector("main")||document.body}function ds(e,t={aiInjections:[],manualInjections:[]}){fi();const n=ys(t);if(!n)return[];const i=Te(e.map(l=>l.innerText).join(" ")),r=ws(n),a=r.filter(l=>i.includes(Te(l.sentence))),o={};for(const l of a){const d=e.findIndex(S=>Te(S.innerText).includes(Te(l.sentence))),u=e[d];if(!u)continue;const f=Ni(l.title,u,["A"]);if(!(f!=null&&f.nodeValue)||Li(f)){const S=Ni(l.title,u);if(S&&Li(S)){o[l.key]="Given text is already inside of a link.";continue}}const{injectionElement:_,linkElement:m}=fs(l),{phrase_before:g,phrase_after:v}=l;let p=-1,y=!1;if(os(Te(u.innerText),Te(l.title))===1&&(p=u.innerHTML.indexOf(l.title)),p===-1&&(g||v)){const S=[g,l.title,v].filter(Boolean).join(" ");if(p=u.innerHTML.indexOf(S),p===-1){const j=ss(u.innerHTML,l.title,g||"",v||"");if(j){const{leadingSpaces:x,trailingSpaces:T}=cs(j.match);m.innerHTML=j.match.trim();const H=j.index+x,M=j.index+j.match.length-T;u.innerHTML=rs(u.innerHTML,_.outerHTML,H,M),p=j.index,y=!0}}}if(p===-1&&(f!=null&&f.nodeValue)){const S=u.innerHTML.indexOf(f.nodeValue),j=u.innerHTML.indexOf(l.sentence);p=Math.max(S,j,0)}p!==-1&&(y||(u.innerHTML=is(u.innerHTML,l.title,_.outerHTML,p)))}_s(r),vs();const s=ks(n);return s.length&&gs(e,s),n.filter(l=>l.title_details).map((l,d)=>{const u=l.duplicate??(!l.manual&&bs(l,d,n)),f=document.querySelector(`[${ut}="${l.key}"]`),_=Tn(l)&&!l.inactive&&!l.after_article&&!f,m=!!e.find(v=>Te(v.innerText).includes(Te(l.sentence))),g=_?o[l.key]||(m?"The link failed to inject for unknown reasons.":"Given sentence was not found in the article."):"";return{...l,inactive:l.inactive??!1,duplicate:u,failed:_,failed_message:g}})}function fs(e){const t=document.createElement("span");t.dataset.playpilotInjectionKey=e.key;const n=document.createElement("a");return n.innerText=e.title,n.href=e.playpilot_url,n.target="_blank",n.rel="noopener nofollow noreferrer",t.insertAdjacentElement("beforeend",n),{injectionElement:t,linkElement:n}}function vs(){const e=Array.from(document.querySelectorAll(`${Nt} a`)),t=["--playpilot-injection-text-color","--playpilot-injection-text-color-hover","--playpilot-injection-font-weight","--playpilot-injection-font-weight-headings","--playpilot-injection-text-decoration","--playpilot-injection-text-decoration-hover","--playpilot-injection-background-color","--playpilot-injection-background-color-hover"];e.forEach(n=>{t.forEach(i=>{getComputedStyle(n).getPropertyValue(i)&&(n.dataset.usedCssVariables=`${n.dataset.usedCssVariables||""} ${i}`)})})}function _s(e){window.addEventListener("click",n=>{if(Ur(n))return;let i=n.target;if(!i||(i.hasAttribute(ut)||(i=i.closest(Nt)),!i))return;const r=i.getAttribute(ut);if(!r)return;const a=e.find(o=>r===o.key);a&&(n.preventDefault(),us(()=>{_n(!1),Wr(n,a)},!ui.current&&window.innerWidth>=600&&!window.matchMedia("(pointer: coarse)").matches))}),window.addEventListener("mousemove",n=>{if(!dt)return;const i=n.target;i.hasAttribute("data-playpilot-title-popover")||i.closest("[data-playpilot-title-popover]")||i.hasAttribute(ut)||i.closest(Nt)||_n()}),Array.from(document.querySelectorAll(Nt)).forEach(n=>{const i=n.dataset.playpilotInjectionKey,r=e.find(a=>i===a.key);r&&(n.addEventListener("mouseenter",a=>{dt||hs(a,r)}),n.addEventListener("mouseleave",()=>vn=null))})}function Wr(e,t){Ur(e)||Ot||(e.preventDefault(),Ot=Jt(Bl,{target:Jr(),props:{title:t.title_details,onclose:Kr}}))}function Kr(e=!0){Ot&&(bn(Ot,{outro:e}),Ot=null)}function hs(e,t){if(window.matchMedia("(pointer: coarse)").matches)return;dt&&_n();const n=e.currentTarget;vn=n,setTimeout(()=>{vn===n&&(dt=Jt(zl,{target:Jr(),props:{event:e,title:t.title_details}}))},100)}function _n(e=!0){dt&&(bn(dt,{outro:e}),vn=null,dt=null)}function gs(e,t){var o,s;if(Lt||!t.length)return;const n=document.createElement("div"),i=(o=window.PlayPilotLinkInjections)==null?void 0:o.after_article_selector,r=(i?document.querySelector(i):null)||e[e.length-1],a=((s=window.PlayPilotLinkInjections)==null?void 0:s.after_article_insert_position)||"afterend";n.dataset.playpilotAfterArticlePlaylinks="true",r.insertAdjacentElement(a,n),Lt=Jt(ts,{target:n,props:{linkInjections:t,onclickmodal:(l,d)=>Wr(l,d)}})}function ms(){var e;Lt&&(bn(Lt),(e=document.querySelector("[data-playpilot-after-article-playlinks]"))==null||e.remove(),Lt=null)}function fi(){document.querySelectorAll(Nt).forEach(t=>ps(t.getAttribute(ut)||"")),ms(),Kr(!1),_n(!1)}function ps(e){var i;const t=document.querySelector(`[${ut}="${e}"]`);if(!t)return;const n=(i=t.querySelector("a"))==null?void 0:i.innerHTML;t.outerHTML=n||""}function ys({aiInjections:e,manualInjections:t}){return[...t.map(n=>({...n,manual:!0})),...e]}function Yr(e){return{aiInjections:e.filter(t=>!t.manual),manualInjections:e.filter(t=>t.manual)}}function Zr(e){return!e.inactive&&!e.removed&&!e.duplicate&&!!e.title_details&&Tn(e)}function Tn(e){return e.in_text||e.in_text===void 0?!0:!!e.after_article}function ws(e){return Gr(e).filter(t=>t.in_text!==!1&&Zr(t))}function ks(e){return Gr(e).filter(t=>t.after_article===!0&&Zr(t))}function Gr(e){return e.filter(t=>t.removed||t.inactive?!1:t.manual&&!t.removed&&!t.inactive?!0:!e.some(n=>n.manual&&(n.removed||n.inactive)&&Xr(n,t)))}function bs(e,t,n){return n.some((i,r)=>t!==r&&i.manual&&Xr(i,e))}function Xr(e,t){return e.title===t.title&&Te(e.sentence)===Te(t.sentence)}function Jr(){return document.querySelector("[data-playpilot-link-injections]")||document.body}function Qr(){const e=Ut();return{content_heading:xs(e),content_modified_time:Ss(e),content_published_time:Es(e)}}function xs(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function Ss(e){const t=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||e.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?vi(n):null}function Es(e){const t=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||e.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||e.querySelector("time")||document.querySelector("time")||e.querySelector("[datetime]")||document.querySelector("[datetime]")||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?vi(n):null}function vi(e){try{return new Date(e).toISOString()}catch{return null}}let On=null;async function en(e,{url:t=ai(),hash:n=il(e||""),params:i={}}={}){const r=new Headers({"Content-Type":"application/json"}),a=In(),o=Or()?await Lr():!1,s=Rr();if(!a)throw new Error("No token was provided");i.metadata=Qr(),i.run_ai&&(i.hash=n,i.page_text=e);const l=await fetch(Sn+`/external-pages/?api-token=${a}&include_title_details=true${o?"&editorial_mode_enabled=true":""}&language=${s}`,{headers:r,method:"POST",body:JSON.stringify({url:t,...i})});if(!l.ok)throw l;return await l.json()}async function Ri(e,{requireCompletedResult:t=!1,runAiWhenRelevant:n=!1,pollInterval:i=3e3,maxTries:r=600,onpoll:a=()=>null}={}){let o=0;On&&clearTimeout(On);const s=async(l,d)=>{let u;try{if(u=await en(e),n&&(u=await Ts(e,u)),t&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=qi(u.manual_injections||[]),u.ai_injections=qi(u.ai_injections||[]),l(u);return}catch{if(o++,o>=r){r>1&&console.error("Max poll limit exceeded. Please return later."),l();return}u&&a(u),On=setTimeout(()=>s(l),i)}};return new Promise(s)}async function Ts(e,t){if(!e||!t.ai_enabled||t.ai_running)return t;const n=Qr().content_modified_time,i=t.content_modified_time?vi(t.content_modified_time):null,r=n&&i===n;return t.ai_last_run&&r?t:await en(e,{params:{run_ai:!0}})}async function Is(e,t){var o;const n=(o=window.PlayPilotLinkInjections)==null?void 0:o.selector,r=e.filter(s=>s.manual).map(s=>({sid:s.sid,title:s.title,sentence:s.sentence,phrase_before:s.phrase_before,phrase_after:s.phrase_after,playpilot_url:s.playpilot_url,after_article:!!s.after_article,after_article_style:s.after_article_style||null,in_text:s.in_text??!0,inactive:!!s.inactive,removed:!!s.removed}));if(!await en(t,{params:{private_token:li(),manual_injections:r,content_text_selector:n}}))throw new Error("saveLinkInjections response was faulty");return e}async function As(){const e=new Headers({"Content-Type":"application/json"}),t=In();if(!t)throw new Error("No token was provided");const n=await fetch(Sn+`/domains/config?api-token=${t}`,{headers:e});if(!n.ok)throw n;try{return await n.json()||null}catch{return null}}function qi(e){return e.map(t=>({...t,key:$r(t.sid)}))}function $r(e){return e+"-"+Dr()}function In(){var e;return(e=window.PlayPilotLinkInjections)==null?void 0:e.token}function Cs(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}var Ps=Ne('<svg width="8" height="4" viewBox="0 0 8 4" fill="none" class="svelte-by11ix"><path d="M1 0.5L4 3.5L7 0.5" stroke="currentColor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function js(e,t){const n=N(t,"expanded",3,!1);var i=Ps();L(()=>se(i,"expanded",n())),k(e,i)}var Ms=Ne('<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="17" r="1" fill="var(--playpilot-warning)"></circle><path d="M12 10L12 14" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.44722 18.1056L10.2111 4.57771C10.9482 3.10361 13.0518 3.10362 13.7889 4.57771L20.5528 18.1056C21.2177 19.4354 20.2507 21 18.7639 21H5.23607C3.7493 21 2.78231 19.4354 3.44722 18.1056Z" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Ns(e){var t=Ms();k(e,t)}function Ls(e,t,n){t(!t()),n()(t())}var Os=I('<button class="switch svelte-91s87b"><div class="label svelte-91s87b"><!></div> <div class="track svelte-91s87b"><div class="knob svelte-91s87b"></div></div></button>');function Wn(e,t){ae(t,!0);let n=N(t,"active",15),i=N(t,"fullwidth",3,!1),r=N(t,"label",3,""),a=N(t,"onclick",3,()=>null);var o=Os();o.__click=[Ls,n,a];var s=b(o),l=b(s);Ct(l,()=>t.children),L(()=>{ue(o,"aria-label",`Toggle ${r()??""} ${(n()?"off":"on")??""}`),se(o,"active",n()),se(o,"fullwidth",i())}),k(e,o),oe()}fe(["click"]);var Ds=I('<input type="text" autocomplete="off" class="svelte-1vrer3i">');function _i(e,t){let n=N(t,"value",15),i=N(t,"label",3,""),r=N(t,"name",3,""),a=N(t,"readonly",3,!1),o=N(t,"oninput",3,()=>null);var s=Ds();s.__input=function(...l){var d;(d=o())==null||d.apply(this,l)},L(()=>{ue(s,"name",r()),ue(s,"aria-label",i()),ue(s,"placeholder",i()),s.readOnly=a()}),Ho(s,n),k(e,s)}fe(["input"]);var Rs=Ne('<path d="M13.5833 13.6667L4.41667 13.6667M5.5 1.5H12.5C13.9001 1.5 14.6002 1.5 15.135 1.77248C15.6054 2.01217 15.9878 2.39462 16.2275 2.86502C16.5 3.3998 16.5 4.09987 16.5 5.5V12.5C16.5 13.9001 16.5 14.6002 16.2275 15.135C15.9878 15.6054 15.6054 15.9878 15.135 16.2275C14.6002 16.5 13.9001 16.5 12.5 16.5H5.5C4.09987 16.5 3.3998 16.5 2.86502 16.2275C2.39462 15.9878 2.01217 15.6054 1.77248 15.135C1.5 14.6002 1.5 13.9001 1.5 12.5V5.5C1.5 4.09987 1.5 3.3998 1.77248 2.86502C2.01217 2.39462 2.39462 2.01217 2.86502 1.77248C3.3998 1.5 4.09987 1.5 5.5 1.5Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),qs=Ne('<path d="M13.5833 8.58342H4.41667M5.5 1.50009H12.5C13.9001 1.50009 14.6002 1.50009 15.135 1.77258C15.6054 2.01226 15.9878 2.39471 16.2275 2.86512C16.5 3.39989 16.5 4.09996 16.5 5.50009V12.5001C16.5 13.9002 16.5 14.6003 16.2275 15.1351C15.9878 15.6055 15.6054 15.9879 15.135 16.2276C14.6002 16.5001 13.9001 16.5001 12.5 16.5001H5.5C4.09987 16.5001 3.3998 16.5001 2.86502 16.2276C2.39462 15.9879 2.01217 15.6055 1.77248 15.1351C1.5 14.6003 1.5 13.9002 1.5 12.5001V5.50009C1.5 4.09996 1.5 3.39989 1.77248 2.86512C2.01217 2.39471 2.39462 2.01226 2.86502 1.77258C3.3998 1.50009 4.09987 1.50009 5.5 1.50009Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),Hs=Ne('<svg width="18" height="18" viewBox="0 0 18 18" fill="none"><!></svg>');function Hi(e,t){const n=N(t,"align",3,"bottom");var i=Hs(),r=b(i);{var a=s=>{var l=Rs();k(s,l)},o=s=>{var l=Fe(),d=ne(l);{var u=f=>{var _=qs();k(f,_)};q(d,f=>{n()==="center"&&f(u)},!0)}k(s,l)};q(r,s=>{n()==="bottom"?s(a):s(o,!1)})}k(e,i)}var Bs=I("<div><!></div>");function ht(e,t){ae(t,!0);const n=N(t,"type",3,"error"),i=N(t,"fixed",3,!1);var r=Bs(),a=b(r);Ct(a,()=>t.children),L(()=>{No(r,`alert ${n()??""} svelte-df5n87`),se(r,"fixed",i())}),k(e,r),oe()}var Fs=I("<!> In-text Playlink",1),Vs=I("<!> Bottom Playlink",1),Us=I('<div class="alert svelte-1shw34x"><!></div>'),zs=(e,t)=>t().after_article_style="playlinks",Ws=(e,t)=>t().after_article_style="modal_button",Ks=I('<div><div class="label svelte-1shw34x">Bottom playlinks style</div> <div class="group svelte-1shw34x" role="listbox" tabindex="0" aria-label="Playlink type"><button role="option" id="playlinks-in-text" class="svelte-1shw34x">Playlinks sentence</button> <button role="option" id="playlinks-after-article" class="svelte-1shw34x">Modal button</button> <div class="active-marker svelte-1shw34x"></div></div></div>'),Ys=I('<div class="switches svelte-1shw34x"><!> <!></div> <!> <!>',1);function Zs(e,t){ae(t,!0);const n=N(t,"linkInjection",7),i=K(()=>n().after_article_style==="modal_button");var r=Ys(),a=ne(r),o=b(a),s=K(()=>n().in_text??!0);Wn(o,{fullwidth:!0,get active(){return c(s)},onclick:g=>{n().in_text=g,n().manual=!0},label:"In-text Playlink",children:(g,v)=>{var p=Fs(),y=ne(p);Hi(y,{align:"center"}),k(g,p)},$$slots:{default:!0}});var l=E(o,2),d=K(()=>n().after_article??!1);Wn(l,{fullwidth:!0,get active(){return c(d)},onclick:g=>{n().after_article=g,n().manual=!0},label:"Bottom Playlink",children:(g,v)=>{var p=Vs(),y=ne(p);Hi(y,{align:"bottom"}),k(g,p)},$$slots:{default:!0}});var u=E(a,2);{var f=g=>{var v=Us(),p=b(v);ht(p,{type:"warning",children:(y,w)=>{var S=Be("At least one layout option must be selected for the playlink to be visible.");k(y,S)},$$slots:{default:!0}}),je(3,v,()=>Ft,()=>({duration:200})),k(g,v)};q(u,g=>{Tn(n())||g(f)})}var _=E(u,2);{var m=g=>{var v=Ks(),p=E(b(v),2),y=b(p);y.__click=[zs,n];var w=E(y,2);w.__click=[Ws,n];var S=E(w,2);L(()=>{ue(p,"aria-activedescendant",`playlinks-${(c(i)?"after-article":"in-text")??""}`),ue(y,"aria-selected",!c(i)||null),se(y,"active",!c(i)),ue(w,"aria-selected",c(i)||null),se(w,"active",c(i)),se(S,"right",c(i))}),je(3,v,()=>Ft,()=>({duration:100})),k(g,v)};q(_,g=>{n().after_article&&g(m)})}k(e,r),oe()}fe(["click"]);var Gs=Ne('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.99984 10.8333C10.4601 10.8333 10.8332 10.4602 10.8332 10C10.8332 9.53977 10.4601 9.16668 9.99984 9.16668C9.5396 9.16668 9.1665 9.53977 9.1665 10C9.1665 10.4602 9.5396 10.8333 9.99984 10.8333Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 5.00001C10.4601 5.00001 10.8332 4.62691 10.8332 4.16668C10.8332 3.70644 10.4601 3.33334 9.99984 3.33334C9.5396 3.33334 9.1665 3.70644 9.1665 4.16668C9.1665 4.62691 9.5396 5.00001 9.99984 5.00001Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 16.6667C10.4601 16.6667 10.8332 16.2936 10.8332 15.8333C10.8332 15.3731 10.4601 15 9.99984 15C9.5396 15 9.1665 15.3731 9.1665 15.8333C9.1665 16.2936 9.5396 16.6667 9.99984 16.6667Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Xs(e){var t=Gs();k(e,t)}var Js=(e,t)=>P(t,!c(t)),Qs=I('<div class="content svelte-zpsd2z"><!></div>'),$s=I('<div class="context-menu svelte-zpsd2z"><button class="svelte-zpsd2z"><!></button> <!></div>');function ec(e,t){ae(t,!0);let n=U(!1),i=U(null);function r(u){var _;const f=u.target;f===c(i)||(_=c(i))!=null&&_.contains(f)||P(n,!1)}var a=$s();ce("click",pe,r);var o=b(a);o.__click=[Js,n];var s=b(o);Xs(s),$t(o,u=>P(i,u),()=>c(i));var l=E(o,2);{var d=u=>{var f=Qs(),_=b(f);Ct(_,()=>t.children),je(1,f,()=>En,()=>({duration:150,y:5})),k(u,f)};q(l,u=>{c(n)&&u(d)})}L(()=>{ue(o,"aria-label",t.ariaLabel),ue(o,"aria-expanded",c(n))}),k(e,a),oe()}fe(["click"]);function tc(e,t,n,i){var r,a;c(t)&&(be(ye.ManualReport,n.linkInjection.title_details,{report_reason:c(t),sid:n.linkInjection.sid,title:n.linkInjection.title,sentence:n.linkInjection.sentence,failed:(r=n.linkInjection.failed)==null?void 0:r.toString(),failed_message:n.linkInjection.failed_message,manual:(a=n.linkInjection.manual)==null?void 0:a.toString()}),P(i,!0),setTimeout(n.onclose,3e3))}var nc=(e,t,n)=>P(t,X(n())),ic=I('<option class="svelte-o5qkco"> </option>'),rc=I('<div class="sent svelte-o5qkco">Report has been sent, thank you! Closing window...</div>'),ac=I('<button class="submit svelte-o5qkco">Send report</button>'),oc=I('<div class="form svelte-o5qkco"><div class="heading svelte-o5qkco">Report issue</div> <div class="info svelte-o5qkco"><div><strong class="svelte-o5qkco">Title</strong> </div> <div><strong class="svelte-o5qkco">Sentence</strong> </div></div> <label for="reason">What would you like to report?</label> <select id="reason" name="reason" class="svelte-o5qkco"><option class="svelte-o5qkco">Select an issue...</option><!></select> <div><!></div></div>');function lc(e,t){ae(t,!0);const n=[{value:"failed_injection",label:"The link failed to appear on the page."},{value:"layout_issue",label:"The link is breaking the layout or formatting of my page."},{value:"wrong_content",label:"The link points to the wrong movie or show."},{value:"inappropriate_title",label:"The link points to an inappropriate movie or show."},{value:"broken_link",label:"The link is broken or leads to an error page."},{value:"other",label:"My issue is not listed, but please have a look regardless."}];let i=U(""),r=U(!1);Hr(e,{get onclose(){return t.onclose},children:(a,o)=>{var s=oc(),l=b(s);Qt(l,(x,T)=>xe==null?void 0:xe(x,T),()=>2);var d=E(l,2),u=b(d),f=E(b(u)),_=E(u,2),m=E(b(_));L(()=>G(m,`:
9
- ${Vr(t.linkInjection.sentence,t.linkInjection.title,100)??""}`));var g=E(d,4),v=b(g);v.value=((v.__value="")==null,"");var p=E(v);at(p,17,()=>n,xt,(x,T)=>{let H=()=>c(T).value,M=()=>c(T).label;var C=ic(),D={};C.__click=[nc,i,H];var A=b(C);L(()=>{D!==(D=H())&&(C.value=(C.__value=H())==null?"":H()),G(A,M())}),k(x,C)});var y=E(g,2),w=b(y);{var S=x=>{var T=rc();je(1,T,()=>Bt,()=>({duration:200})),k(x,T)},j=x=>{var T=ac();T.__click=[tc,i,t,r],L(()=>T.disabled=!c(i)),k(x,T)};q(w,x=>{c(r)?x(S):x(j,!1)})}L(()=>G(f,`: ${t.linkInjection.title??""}`)),Fo(g,()=>c(i),x=>P(i,x)),k(a,s)},$$slots:{default:!0}}),oe()}fe(["click"]);function sc(e,t,n){requestAnimationFrame(()=>t());const i=e.target;if(["BUTTON","INPUT"].includes(i.nodeName)||i.closest("button")||i.closest("input"))return;const r=n()[0];r&&r.scrollIntoView({behavior:"smooth"})}function cc(e,t){const n=Jt(lc,{target:document.body,props:{linkInjection:t(),onclose:()=>bn(n)}})}var uc=(e,t)=>P(t,!c(t)),dc=I('<button class="expand-sentence svelte-lo6h85"> </button>'),fc=I('<button class="context-menu-action svelte-lo6h85">Remove</button> <button class="context-menu-action svelte-lo6h85">Report issue</button>',1),vc=(e,t)=>P(t,!c(t)),_c=I('<div class="warning svelte-lo6h85" aria-label="Invalid playlink settings"><!></div>'),hc=I('<div class="actions svelte-lo6h85"><button class="expand svelte-lo6h85" aria-label="Expand"><!></button> <!> <!></div>'),gc=I('<div class="expanded svelte-lo6h85"><div class="label svelte-lo6h85">Link URL</div> <!> <div class="label offset svelte-lo6h85">Layout options</div> <div class="type-select svelte-lo6h85"><!></div></div>'),mc=I('<div class="item svelte-lo6h85"><div class="header svelte-lo6h85"><img class="poster svelte-lo6h85" alt="" width="32" height="48"> <div class="info svelte-lo6h85"><div class="title svelte-lo6h85"> </div> <div class="sentence svelte-lo6h85"><!> <!></div></div> <div class="context-menu svelte-lo6h85"><!></div></div> <div class="content svelte-lo6h85"><!> <!></div></div>');function pc(e,t){ae(t,!0);const n=N(t,"linkInjection",15),i=N(t,"onremove",3,()=>null),r=N(t,"onhighlight",3,()=>null),a=K(()=>n()||{}),o=K(()=>c(a).key),s=K(()=>c(a).sentence),l=K(()=>c(a).title_details),d=K(()=>c(a).failed),u=K(()=>c(a).failed_message),f=K(()=>c(a).inactive),_=K(()=>c(l)),m=K(()=>Vr(n().sentence,n().title,60));let g=U(!1),v=U(!1),p=U(!1),y=U(null);Je(()=>{c(d)&&be(ye.InjectionFailed,c(_),{phrase:n().title,sentence:c(s)})});function w(Q=!0){j().forEach(le=>{le.classList.toggle("playpilot-injection-highlight",Q)})}function S(Q){let te=Q.target,le=te==null?void 0:te.dataset.playpilotInjectionKey;te&&!le&&(te=te.closest(`[data-playpilot-injection-key="${c(o)}"]`),le=te==null?void 0:te.dataset.playpilotInjectionKey),P(p,le===c(o)),c(y)&&c(p)&&r()(c(y))}function j(){const Q=Array.from(document.querySelectorAll(`[data-playpilot-injection-key="${c(o)}"]`));return Q.length?Q:zr(Ut()).filter(te=>Te(te.innerText).includes(Te(n().sentence)))||[]}var x=mc();ce("mouseover",pe,S),x.__click=[sc,w,j];var T=b(x),H=b(T);L(()=>ue(H,"src",Vt(c(_).standing_poster)));var M=E(H,2),C=b(M),D=b(C),A=E(C,2),B=b(A);Io(B,()=>(c(v)?c(s):c(m)).replace(n().title,`<em>${n().title}</em>`));var O=E(B,2);{var z=Q=>{var te=dc();te.__click=[uc,v];var le=b(te);L(()=>G(le,c(v)?"Less":"More")),k(Q,te)};q(O,Q=>{c(m).length<c(s).length&&Q(z)})}var F=E(M,2),V=b(F);ec(V,{ariaLabel:"More options",children:(Q,te)=>{var le=fc(),Ce=ne(le);Ce.__click=function(...ot){var R;(R=i())==null||R.apply(this,ot)};var Qe=E(Ce,2);Qe.__click=[cc,n],k(Q,le)},$$slots:{default:!0}});var W=E(T,2),J=b(W);{var ee=Q=>{ht(Q,{children:(te,le)=>{var Ce=Be();L(()=>G(Ce,c(u))),k(te,Ce)},$$slots:{default:!0}})},re=Q=>{var te=hc(),le=b(te);le.__click=[vc,g];var Ce=b(le);js(Ce,{get expanded(){return c(g)}});var Qe=E(le,2);{var ot=ve=>{var Se=_c(),Le=b(Se);Ns(Le),je(3,Se,()=>Bt,()=>({duration:100})),k(ve,Se)};q(Qe,ve=>{Tn(n())||ve(ot)})}var R=E(Qe,2),Y=K(()=>c(f)?"Inactive":"Visible"),_e=K(()=>!n().inactive);Wn(R,{get label(){return c(Y)},get active(){return c(_e)},onclick:ve=>{n(n().inactive=!ve,!0),n(n().manual=!0,!0)},children:(ve,Se)=>{var Le=Be();L(()=>G(Le,c(f)?"Inactive":"Visible")),k(ve,Le)},$$slots:{default:!0}}),L(()=>ue(le,"aria-expanded",c(g))),k(Q,te)};q(J,Q=>{c(d)?Q(ee):Q(re,!1)})}var de=E(J,2);{var Ae=Q=>{var te=gc(),le=E(b(te),2);_i(le,{oninput:()=>n(n().manual=!0,!0),label:"Playlink URL",get value(){return n().playpilot_url},set value(ot){n(n().playpilot_url=ot,!0)}});var Ce=E(le,4),Qe=b(Ce);Zs(Qe,{get linkInjection(){return n()}}),je(3,te,()=>Ft,()=>({duration:100})),k(Q,te)};q(de,Q=>{c(g)&&Q(Ae)})}$t(x,Q=>P(y,Q),()=>c(y)),L(()=>{se(x,"highlighted",c(p)),se(x,"inactive",c(f)),G(D,c(_).title)}),ce("mouseenter",x,()=>w(!0)),ce("mouseleave",x,()=>w(!1)),ce("error",H,({target:Q})=>Q.src=jr),je(6,x,()=>Ft,()=>({duration:200})),k(e,x),oe()}fe(["click"]);var yc=I('<button class="drag-handle svelte-19mcc5g" aria-label="Move editor"></button>');function wc(e,t){ae(t,!0);let n=N(t,"element",7),i=N(t,"position",23,()=>({x:0,y:0})),r=N(t,"limit",19,()=>({x:0,y:0})),a=N(t,"onchange",3,()=>null),o=!1,s={x:0,y:0},l=i();Je(()=>{d(i().x,i().y)});function d(v,p){const y=window.innerWidth,w=window.innerHeight,S=n().clientWidth,j=n().clientHeight;v=Math.min(Math.max(v,r().x),y-S-r().x),p=Math.min(Math.max(p,r().y),w-j-r().y),n().style.right=v+"px",n().style.bottom=Math.max(p,r().y)+"px",i({x:v,y:p}),a()(i())}function u(v){var p,y;return{x:v.pageX||((p=v.touches)==null?void 0:p[0].pageX)||0,y:v.pageY||((y=v.touches)==null?void 0:y[0].pageY)||0}}function f(v){o=!0,s=u(v),l=i()}function _(v){if(!o)return;const p=u(v),y=p.x-s.x,w=p.y-s.y,S=l.x-y,j=l.y-w;d(S,j)}function m(){o&&(o=!1)}var g=yc();ce("mousemove",pe,_),ce("touchmove",pe,_,void 0,!0),ce("mouseup",pe,m),ce("touchend",pe,m),ce("resize",pe,()=>d(i().x,i().y)),g.__mousedown=f,g.__touchstart=f,k(e,g),oe()}fe(["mousedown","touchstart"]);var kc=I('<button class="resize-handle svelte-sxkuxk" aria-label="Move editor"></button>');function bc(e,t){ae(t,!0);let n=N(t,"element",7),i=N(t,"height",7,200),r=N(t,"onchange",3,()=>null);const a=16;let o=!1,s=0,l=i();Je(()=>{i()&&d(i())});function d(v){const p=window.getComputedStyle(n()).minHeight||"0",y=Math.max(parseInt(p),Math.min(v,m()));n().style.height=`${y}px`,i(y),r()(y)}function u(v){var p,y;o=!0,s=v.pageY||((y=(p=v.touches)==null?void 0:p[0])==null?void 0:y.pageY)||0,l=n().clientHeight}function f(v){var S,j;if(!o)return;const p=v.pageY||((j=(S=v.touches)==null?void 0:S[0])==null?void 0:j.pageY)||0,y=s-p,w=l+y;d(w)}function _(){o=!1}function m(){const v=window.innerHeight-n().getBoundingClientRect().bottom;return Math.max(window.innerHeight-a*2-v,0)}var g=kc();ce("mousemove",pe,f),ce("touchmove",pe,f,void 0,!0),ce("mouseup",pe,_),ce("touchend",pe,_),ce("resize",pe,()=>{i()&&d(i())}),g.__mousedown=u,g.__touchstart=u,k(e,g),oe()}fe(["mousedown","touchstart"]);var xc=Ne('<svg width="4" height="8" viewBox="0 0 4 8" fill="none"><path d="M3.5 7L0.5 4L3.5 1" stroke="currentcolor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Sc(e){var t=xc();k(e,t)}async function Ec(e){const t=new Headers({"Content-Type":"application/json"}),n=In();if(!n)throw new Error("No token was provided");const i=await fetch(Sn+`/search/titles/?api-token=${n}&query=${e}`,{headers:t});if(!i.ok)throw i;return await i.json()}var Tc=Ne('<svg viewBox="0 -960 960 960" width="18" height="18"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"></path></svg>');function Ic(e){var t=Tc();k(e,t)}var Ac=I("<div> </div>"),Cc=e=>e.stopImmediatePropagation(),Pc=I('<button class="item svelte-rjq94e"><img class="poster svelte-rjq94e" alt="" width="28" height="42"> <div class="content"><div class="name svelte-rjq94e"> </div> <div class="meta svelte-rjq94e"><div class="imdb svelte-rjq94e"><!> </div> <div> </div> <div> </div> <!></div></div> <a target="_blank" class="open-in-new-tab svelte-rjq94e"><!></a></button>');function Bi(e,t){ae(t,!0);const n=N(t,"hoverable",3,!0),i=N(t,"onclick",3,()=>null);var r=Pc();r.__click=function(...x){var T;(T=i())==null||T.apply(this,x)};var a=b(r);L(()=>ue(a,"src",Vt(t.title.standing_poster)));var o=E(a,2),s=b(o),l=b(s),d=E(s,2),u=b(d),f=b(u);Br(f);var _=E(f),m=E(u,2),g=b(m),v=E(m,2),p=b(v),y=E(v,2);{var w=x=>{var T=Ac(),H=b(T);L(()=>G(H,`${t.title.length??""} min`)),k(x,T)};q(y,x=>{t.title.length&&x(w)})}var S=E(o,2);S.__click=[Cc];var j=b(S);Ic(j),L(()=>{se(r,"hoverable",n()),G(l,t.title.title),G(_,` ${t.title.imdb_score??""}`),G(g,t.title.year),G(p,t.title.type),ue(S,"href",`${Pr}/${t.title.type??""}/${t.title.slug??""}`)}),ce("error",a,({target:x})=>x.src=jr),k(e,r),oe()}fe(["click"]);var jc=I('<em class="empty svelte-1olb8n0">No results found</em>'),Mc=I('<div class="results svelte-1olb8n0" data-testid="search-results"></div>'),Nc=I('<div class="selected svelte-1olb8n0"><!></div>'),Lc=I('<div class="search svelte-1olb8n0"><!> <!> <!></div>');function Oc(e,t){ae(t,!0);let n=N(t,"onselect",3,()=>null),i=N(t,"query",15),r=U(X([])),a=U(null),o=U(!1);pn(()=>{i()&&s(i())});async function s(v){P(o,!0);try{P(r,X(await Ec(v)))}finally{P(o,!1)}}function l(v){i(v.title),P(a,X(v)),n()(v)}var d=Lc(),u=b(d);_i(u,{oninput:()=>P(a,null),name:"search",label:"Search...",get value(){return i()},set value(v){i(v)}});var f=E(u,2);{var _=v=>{var p=Mc();at(p,21,()=>c(r),y=>y.sid,(y,w)=>{Bi(y,{get title(){return c(w)},onclick:()=>l(c(w))})},y=>{var w=Fe(),S=ne(w);{var j=x=>{var T=jc();k(x,T)};q(S,x=>{c(o)||x(j)})}k(y,w)}),k(v,p)};q(f,v=>{i()&&!c(a)&&v(_)})}var m=E(f,2);{var g=v=>{var p=Nc(),y=b(p);Bi(y,{get title(){return c(a)},hoverable:!1}),k(v,p)};q(m,v=>{c(a)&&v(g)})}k(e,d),oe()}function Dc(e,t=e.anchorNode){if(!e.anchorNode||!t)return{start:-1,end:-1};const n=e.toString().trim(),i=e.toString().search(/\S/);if(e.anchorNode===t&&t.nodeType===Node.TEXT_NODE){const d=Math.min(e.anchorOffset,e.focusOffset)+i;return{start:d,end:d+n.length}}const r=e.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(t),a.setEnd(r.startContainer,r.startOffset);const s=a.toString().length+i,l=s+n.length;return{start:s,end:l}}function Rc(e,t,n,i,r,a,o,s){if(!c(t)||!c(n))return;const l=c(n).type==="movie"?"movie":"show",d=Pr+`/${l}/${c(n).slug}`,u={sid:c(n).sid,title:c(t),sentence:c(i),phrase_before:c(r),phrase_after:c(a),playpilot_url:d,key:$r(c(n).sid),title_details:c(n),manual:!0};o.onsave(u),s()()}var qc=I('<div class="error svelte-1i8p6op"><!></div>'),Hc=I('<label for="text" class="svelte-1i8p6op">Paired title</label> <!>',1),Bc=I('<section class="layout svelte-1i8p6op"><div class="header svelte-1i8p6op"><!> <div class="heading svelte-1i8p6op">Add Playlink manually</div></div> <p class="svelte-1i8p6op">Highlight the text section in your post that you want to turn into a Playlink.</p> <label for="text" class="svelte-1i8p6op">Selected text</label> <!> <!> <!> <button class="save svelte-1i8p6op">Add playlink</button></section>');function Fc(e,t){ae(t,!0);const n=N(t,"pageText",3,""),i=N(t,"onclose",3,()=>null);let r=U(""),a=U(""),o=U(null),s=U(""),l=U(""),d=U(""),u=U("");Je(f);function f(){const C=window.getSelection();if(!(C!=null&&C.anchorNode)||C.anchorNode.parentElement&&!Ut().contains(C.anchorNode.parentElement))return;const D=C.toString().trim();if(!D)return;P(d,""),P(r,X(D));const A=C.getRangeAt(0).cloneContents();if(Array.from(A.childNodes).filter(ee=>{var re;return(re=ee.textContent)==null?void 0:re.trim()}).find(ee=>{var re;return ee.nodeName==="A"||((re=ee.querySelector)==null?void 0:re.call(ee,"a"))})){P(d,"Selection is or contains a link. Injections can not be created around already existing links.");return}P(u,X(c(r)));const{node:O,sentence:z}=_(C,D);if(!O)return;P(a,X(z));const{start:F,end:V}=Dc(C,O);(ee=>(P(l,X(ee.before)),P(s,X(ee.after))))(as(O,F,V)),z.includes(c(l))||P(l,""),z.includes(c(s))||P(s,"");const W=C.getRangeAt(0).commonAncestorContainer.textContent,J=Te(n());(!W||!J.includes(Te(W)))&&P(d,"Selection was not inside of given content")}function _(C,D){const A=C.getRangeAt(0),B=Ut();let O=A.startContainer;for(;(O.textContent||"").length<=D.length*3&&O.parentNode&&O.parentNode.textContent!==B.textContent;)O=O.parentNode;if(!O||!O.textContent)return{node:null,sentence:""};const z=O.textContent,F=m(O,A.startContainer,A.startOffset),V=m(O,A.endContainer,A.endOffset),W=z.slice(0,F).lastIndexOf("."),J=z.slice(V).match(/[.!?]/),ee=J?V+J.index:z.length,re=W===-1?0:W+1,de=ee,Ae=z.slice(re,de+1).trim();return{node:O,sentence:Ae}}function m(C,D,A){let B=0;const O=C,z=F=>{var V;if(F===D)return B+=A,!0;F.nodeType===Node.TEXT_NODE&&(B+=((V=F.textContent)==null?void 0:V.length)||0);for(let W=F.firstChild;W;W=W.nextSibling)if(z(W))return!0;return!1};return z(O),B}function g(C){var D,A;P(o,X(C)),(A=(D=window.getSelection())==null?void 0:D.removeAllRanges)==null||A.call(D)}var v=Bc();ce("mouseup",pe,f);var p=b(v),y=b(p);ci(y,{get onclick(){return i()},size:"24px",children:(C,D)=>{Sc(C)},$$slots:{default:!0}});var w=E(y,2);Qt(w,(C,D)=>xe==null?void 0:xe(C,D),()=>2);var S=E(p,6);_i(S,{get value(){return c(r)},label:"Select text on the page",name:"selected-text",readonly:!0});var j=E(S,2);{var x=C=>{var D=qc(),A=b(D);ht(A,{children:(B,O)=>{var z=Be();L(()=>G(z,c(d))),k(B,z)},$$slots:{default:!0}}),k(C,D)};q(j,C=>{c(d)&&C(x)})}var T=E(j,2);{var H=C=>{var D=Hc(),A=E(ne(D),2);Er(A,()=>c(a)+c(r),B=>{Oc(B,{onselect:g,get query(){return c(u)},set query(O){P(u,X(O))}})}),k(C,D)};q(T,C=>{c(d)||C(H)})}var M=E(T,2);M.__click=[Rc,r,o,a,l,s,t,i],L(()=>M.disabled=!c(r)||!c(o)),k(e,v),oe()}fe(["click"]);const Kn="PlayPilotEditorialSessionId",ea=5e3,Vc=ea*2;async function Uc(e){const{ai_enabled:t,injections_enabled:n,ai_last_run:i,session_id:r,session_last_ping:a}=await en(e),o=na(r||null,a||null),s={ai_enabled:t,ai_last_run:i,injections_enabled:n,session_id:r,session_last_ping:a};return o?await ta(e):s}async function ta(e){const t=ia(),n=new Date(Date.now()).toISOString(),i={session_id:t,session_last_ping:n.toString()},{ai_enabled:r,injections_enabled:a,ai_last_run:o}=await en(e,{params:i});return{ai_enabled:r,ai_last_run:o,injections_enabled:a,...i}}function na(e,t){if(!e||!t)return!0;const n=Date.now(),i=new Date(t),r=ia();return n-i.getTime()>Vc?!0:r===e}function ia(){return sessionStorage.getItem(Kn)||zc()}function zc(){const e=sessionStorage.getItem(Kn)||Dr();return sessionStorage.setItem(Kn,e),e}function Wc(e,t,n){ta(t()),n()()}var Kc=I('<p class="svelte-2m2urs"><strong>Someone else is currently editing this document.</strong> Wait for them to exit the page or take over edit permissions, preventing them from making more changes.</p> <button class="button svelte-2m2urs">Take over editing</button>',1),Yc=I('<div class="alert svelte-2m2urs"><!></div>');function Zc(e,t){ae(t,!0);const n=N(t,"pageText",3,""),i=N(t,"onpoll",3,()=>null),r=N(t,"onallow",3,()=>null),a=N(t,"ondisallow",3,()=>null),o=N(t,"ontakeover",3,()=>null);let s=null,l=U(!0);Je(()=>(d(),()=>{s&&clearInterval(s)}));function d(){u(),s=setInterval(u,ea)}async function u(){const g=await Uc(n());g&&(P(l,X(na(g.session_id||null,g.session_last_ping||null))),c(l)?r()():a()(),i()({injectionsEnabled:!!g.injections_enabled,aiEnabled:!!g.ai_enabled}))}var f=Fe(),_=ne(f);{var m=g=>{var v=Yc(),p=b(v);ht(p,{type:"warning",children:(y,w)=>{var S=Kc(),j=E(ne(S),2);j.__click=[Wc,n,o],k(y,S)},$$slots:{default:!0}}),k(g,v)};q(_,g=>{c(l)||g(m)})}k(e,f),oe()}fe(["click"]);var Gc=Ne('<svg width="24px" height="24px" viewBox="0 0 64 64" stroke-width="3" stroke="currentColor" fill="none"><circle cx="34.52" cy="11.43" r="5.82"></circle><circle cx="53.63" cy="31.6" r="5.82"></circle><circle cx="34.52" cy="50.57" r="5.82"></circle><circle cx="15.16" cy="42.03" r="5.82"></circle><circle cx="15.16" cy="19.27" r="5.82"></circle><circle cx="34.51" cy="29.27" r="4.7"></circle><line x1="20.17" y1="16.3" x2="28.9" y2="12.93"></line><line x1="38.6" y1="15.59" x2="49.48" y2="27.52"></line><line x1="50.07" y1="36.2" x2="38.67" y2="46.49"></line><line x1="18.36" y1="24.13" x2="30.91" y2="46.01"></line><line x1="20.31" y1="44.74" x2="28.7" y2="48.63"></line><line x1="17.34" y1="36.63" x2="31.37" y2="16.32"></line><line x1="20.52" y1="21.55" x2="30.34" y2="27.1"></line><line x1="39.22" y1="29.8" x2="47.81" y2="30.45"></line><line x1="34.51" y1="33.98" x2="34.52" y2="44.74"></line></svg>');function Xc(e){var t=Gc();k(e,t)}var Jc=I('<strong class="svelte-1kpafo0">AI processing is disabled.</strong> Enable AI from the <a href="https://partner.playpilot.net" class="svelte-1kpafo0">Partner Portal</a>',1),Qc=I('<span class="svelte-1kpafo0">.</span>'),$c=I(`<strong class="svelte-1kpafo0">AI links are currently processing.</strong> This can take several minutes. We'll insert all found injections once ready. <div class="message svelte-1kpafo0"> <span class="ellipses svelte-1kpafo0"></span></div> <div class="loading-bar svelte-1kpafo0"><div class="loading-bar-progress svelte-1kpafo0"><div class="loading-bar-fill svelte-1kpafo0" data-testid="loading-bar"></div></div> <div class="loading-bar-label svelte-1kpafo0"> </div></div>`,1),eu=(e,t)=>P(t,!0),tu=I('<p class="svelte-1kpafo0"><strong class="svelte-1kpafo0">AI has finished processing.</strong> <br class="svelte-1kpafo0"> <!></p> <button class="dismiss svelte-1kpafo0">Dismiss</button>',1),nu=I('<div class="animator svelte-1kpafo0" data-test-id="animator"></div>'),iu=I('<div class="ai-indicator svelte-1kpafo0" data-testid="ai-indicator"><div class="content svelte-1kpafo0"><div class="icon svelte-1kpafo0"><!></div> <div class="svelte-1kpafo0"><!></div></div> <div class="border svelte-1kpafo0"><!></div></div>');function ru(e,t){const n=N(t,"aiRunning",3,!1),i=N(t,"aiEnabled",3,!1),r=N(t,"message",3,""),a=N(t,"percentage",3,0),o=N(t,"aiInjectionsCount",3,0),s=o();let l=U(!1);var d=Fe(),u=ne(d);{var f=_=>{var m=iu(),g=b(m),v=b(g),p=b(v);Xc(p);var y=E(v,2),w=b(y);{var S=M=>{var C=Jc();k(M,C)},j=M=>{var C=Fe(),D=ne(C);{var A=O=>{var z=$c(),F=E(ne(z),2),V=b(F),W=E(V);at(W,20,()=>({length:3}),xt,(te,le)=>{var Ce=Qc();k(te,Ce)});var J=E(F,2),ee=b(J),re=b(ee);const de=K(()=>`${Math.max(a(),3)??""}%`);L(()=>xn(re,"width",c(de)));var Ae=E(ee,2),Q=b(Ae);L(()=>G(Q,`${Math.floor(a())??""}%`)),L(()=>G(V,`${r()??""} `)),k(O,z)},B=O=>{var z=tu(),F=ne(z),V=E(b(F),4);{var W=re=>{var de=Be("No new injections where found.");k(re,de)},J=re=>{var de=Be();L(()=>G(de,`${o()??""} Injections where found and added to the page.`)),k(re,de)};q(V,re=>{s===o()?re(W):re(J,!1)})}var ee=E(F,2);ee.__click=[eu,l],k(O,z)};q(D,O=>{n()?O(A):O(B,!1)},!0)}k(M,C)};q(w,M=>{i()?M(j,!1):M(S)})}var x=E(g,2),T=b(x);{var H=M=>{var C=nu();k(M,C)};q(T,M=>{n()&&M(H)})}L(()=>se(m,"running",n())),k(_,m)};q(u,_=>{c(l)||_(f)})}k(e,d)}fe(["click"]);async function au(e,t,n,i,r,a,o){try{P(t,!0),P(n,!1),i(await Is(i(),r())),P(a,X(c(o)))}catch{P(n,!0)}finally{P(t,!1)}}var ou=I('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:400,600,700">'),lu=I('<div class="handles svelte-11aj6xq"><div class="handle svelte-11aj6xq"><!></div> <div class="handle svelte-11aj6xq"><!></div></div>'),su=I('<div class="loading svelte-11aj6xq">Loading...</div>'),cu=I('<div class="bubble svelte-11aj6xq"> </div> <!>',1),uu=I(`<strong>Playlinks are currently not published.</strong> Visitors to this page will not see any of the injected links.
10
- Publish playlinks from the <a href="https://partner.playpilot.net">Partner Portal.</a>`,1),du=I('<div class="alert svelte-11aj6xq"><!></div>'),fu=I('<div class="error svelte-11aj6xq"><!></div>'),vu=I('<div class="empty svelte-11aj6xq">No links available. Add links manually by clicking the + button and select text to add a link to.</div>'),_u=I('<button class="save svelte-11aj6xq"> </button>'),hu=I('<!> <!> <div class="items svelte-11aj6xq"></div> <!>',1),gu=I("<!> <!> <!>",1),mu=I('<div class="panel playpilot-styled-scrollbar svelte-11aj6xq"><!></div>'),pu=I('<section class="editor playpilot-styled-scrollbar svelte-11aj6xq"><!> <header class="header svelte-11aj6xq"><div class="heading svelte-11aj6xq">Playlinks</div> <!></header> <!> <!></section>');function yu(e,t){ae(t,!0);let n=N(t,"linkInjections",15),i=N(t,"pageText",3,""),r=N(t,"loading",3,!1),a=N(t,"injectionsEnabled",7,!1),o=N(t,"aiStatus",23,()=>({})),s=N(t,"onreinitialize",3,()=>null);const l="editor-position",d="editor-height",u=JSON.parse(localStorage.getItem(l)||'{ "x": 0, "y": 0 }'),f=parseInt(localStorage.getItem(d)||"0");let _=U(null),m=U(!1),g=U(!1),v=U(!1),p=U(!0),y=U(0),w=U("");const S=K(()=>sn(o().aiEnabled,!1)),j=K(()=>sn(o().aiRunning,!1)),x=K(()=>JSON.stringify(n())),T=K(()=>!c(j)&&c(p)),H=K(()=>c(w)&&c(w)!==c(x)),M=K(()=>n().filter(R=>R.title_details&&!R.removed&&!R.duplicate&&(R.manual||!R.manual&&!R.failed))),C=K(()=>A(c(M))),D=K(()=>!r()&&Ke(()=>o().aiRunning));pn(()=>{r()||Ke(()=>{requestAnimationFrame(()=>P(w,X(c(x)))),V()})});function A(R){return R.sort((Y,_e)=>Y.failed!==_e.failed?Y.failed?1:-1:Y.title_details.title.localeCompare(_e.title_details.title))}function B(R,Y){localStorage.setItem(R,Y)}function O(R){const Y=n().findIndex(_e=>_e.key===R);n(n()[Y].manual=!0,!0),n(n()[Y].removed=!0,!0),n([...n()])}function z(R){if(!c(_))return;const Y=R.offsetTop,_e=Y+R.offsetHeight,ve=c(_).scrollTop,Se=ve+c(_).clientHeight;Y>=ve&&_e<=Se||c(_).scrollTo({top:Y-c(_).clientHeight/2,behavior:"smooth"})}function F(R){const Y=R.target;P(y,X(Y.scrollTop))}function V(){const R={total:n().length,failed_automatic:n().filter(Y=>Y.failed&&!Y.manual).length,failed_manual:n().filter(Y=>Y.failed&&Y.manual).length,final_injected:c(M).length};be(ye.TotalInjectionsCount,null,R)}var W=pu();ko(R=>{var Y=ou();k(R,Y)});var J=b(W);{var ee=R=>{var Y=lu(),_e=b(Y),ve=b(_e);bc(ve,{get element(){return c(_)},height:f,onchange:Ze=>B(d,JSON.stringify(Ze))});var Se=E(_e,2),Le=b(Se);wc(Le,{get element(){return c(_)},position:u,limit:{x:16,y:16},onchange:Ze=>B(l,JSON.stringify(Ze))}),k(R,Y)};q(J,R=>{c(_)&&!r()&&R(ee)})}var re=E(J,2),de=b(re);Qt(de,R=>xe==null?void 0:xe(R));var Ae=E(de,2);{var Q=R=>{var Y=su();k(R,Y)},te=R=>{var Y=Fe(),_e=ne(Y);{var ve=Se=>{var Le=cu(),Ze=ne(Le),Oe=b(Ze),tn=E(Ze,2);ci(tn,{onclick:()=>P(m,!0),size:"24px","aria-label":"Add manual injection",children:(nn,hi)=>{var rn=Be("+");k(nn,rn)},$$slots:{default:!0}}),L(()=>{ue(Ze,"aria-label",`${c(M).length??""} found playlinks`),G(Oe,c(M).length)}),k(Se,Le)};q(_e,Se=>{c(T)&&Se(ve)},!0)}k(R,Y)};q(Ae,R=>{r()?R(Q):R(te,!1)})}var le=E(re,2);{var Ce=R=>{var Y=gu(),_e=ne(Y);Zc(_e,{get pageText(){return i()},onallow:()=>P(p,!0),ondisallow:()=>P(p,!1),get ontakeover(){return s()},onpoll:Oe=>{a(Oe.injectionsEnabled),o({...o(),aiEnabled:Oe.aiEnabled})}});var ve=E(_e,2);{var Se=Oe=>{ru(Oe,Yo(o,{get aiInjectionsCount(){return Yr(n()).aiInjections.length}}))};q(ve,Oe=>{c(p)&&(c(D)||!c(S))&&Oe(Se)})}var Le=E(ve,2);{var Ze=Oe=>{var tn=hu(),nn=ne(tn);{var hi=he=>{var ge=du(),$e=b(ge);ht($e,{type:"warning",children:(lt,la)=>{var An=uu();k(lt,An)},$$slots:{default:!0}}),k(he,ge)};q(nn,he=>{a()||he(hi)})}var rn=E(nn,2);{var ra=he=>{var ge=fu(),$e=b(ge);ht($e,{children:(lt,la)=>{var An=Be("Something went wrong, check your links below.");k(lt,An)},$$slots:{default:!0}}),je(7,ge,()=>Ft,()=>({duration:150})),k(he,ge)};q(rn,he=>{c(v)&&he(ra)})}var gi=E(rn,2);at(gi,21,()=>c(C),he=>he.key,(he,ge)=>{const $e=K(()=>n().findIndex(lt=>lt.key===c(ge).key));pc(he,{onremove:()=>O(c(ge).key),onhighlight:z,get linkInjection(){return n()[c($e)]},set linkInjection(lt){n(n()[c($e)]=lt,!0)}})},he=>{var ge=vu();k(he,ge)});var aa=E(gi,2);{var oa=he=>{var ge=_u();ge.__click=[au,g,v,n,i,w,x];var $e=b(ge);L(()=>{ge.disabled=c(g),G($e,c(g)?"Saving...":"Save links")}),je(1,ge,()=>Bt,()=>({duration:100})),k(he,ge)};q(aa,he=>{c(H)&&n().length&&c(p)&&he(oa)})}k(Oe,tn)};q(Le,Oe=>{c(T)&&Oe(Ze)})}k(R,Y)};q(le,R=>{r()||R(Ce)})}var Qe=E(le,2);{var ot=R=>{var Y=mu(),_e=b(Y);Fc(_e,{get pageText(){return i()},onclose:()=>P(m,!1),onsave:ve=>n().push(ve)}),L(()=>xn(Y,"top",`${c(y)??""}px`)),je(3,Y,()=>En,()=>({x:Math.min(window.innerWidth,320),duration:200,opacity:1})),k(R,Y)};q(Qe,R=>{c(m)&&R(ot)})}$t(W,R=>P(_,R),()=>c(_)),L(()=>{se(W,"panel-open",c(m)),se(W,"loading",r())}),ce("scroll",W,F),k(e,W),oe()}fe(["click"]);var wu=Ne('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 57.48 62.96"><defs><style>.playpilot-logo{fill:url(#playpilot-linear-gradient);}</style><linearGradient id="playpilot-linear-gradient" x1="-90.03" y1="-40.23" x2="-34.8" y2="-101.48" gradientTransform="translate(74.02 108.65)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#de00b9"></stop><stop offset="0.99" stop-color="#ff557b"></stop></linearGradient></defs><path class="playpilot-logo" d="M57.48,31.48C57.48,22.17,20.85,2.19,9.2.18,7.42-.12,3.78-.37,1.36,2.25-4.32,8.39,9.62,21.5,9.62,31.48S-4.32,54.57,1.36,60.72c2.42,2.61,6.06,2.37,7.84,2.06C20.85,60.78,57.48,40.79,57.48,31.48Z"></path></svg>');function ku(e){var t=wu();k(e,t)}var bu=I('<div class="trigger svelte-qee95d"><button type="button" class="button svelte-qee95d" title="Show PlayPilot TPI editor"><!></button> <button type="button" class="button close svelte-qee95d" title="Close PlayPilot TPI"><!></button></div>');function xu(e,t){var n=bu(),i=b(n);i.__click=function(...s){var l;(l=t.onclick)==null||l.apply(this,s)};var r=b(i);ku(r);var a=E(i,2);a.__click=function(...s){var l;(l=t.onclose)==null||l.apply(this,s)};var o=b(a);qr(o),k(e,n)}fe(["click"]);var Su=I('<div class="playpilot-link-injections svelte-13rmd3g" data-playpilot-link-injections=""><!> <!></div>');function Eu(e,t){ae(t,!0);let n=U(null),i=U(X([])),r=U(null),a=U(X(Or())),o=U(!!li()),s=U(!1),l=U(!0),d=U(!0),u=U(X([]));const f=K(()=>c(r)||{}),_=K(()=>sn(c(f).ai_injections,()=>[],!0)),m=K(()=>sn(c(f).manual_injections,()=>[],!0)),g=K(()=>c(i).map(A=>A.innerText).join(`
8
+ `}}Ia();var cl=Le('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M14 2L2 14M2 2L14 14" stroke="currentColor" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Br(e){var t=cl();k(e,t)}function ci(e,t){ae(t,!0);const n=L(t,"size",3,"margin(2)"),i=L(t,"onclick",3,()=>null),r=Ko(t,["$$slots","$$events","$$legacy","children","size","onclick"]);var a=Fe(),o=ne(a);Po(o,()=>t.href?"a":"button",!1,(s,l)=>{let d;N(()=>{d=Lo(s,d,{role:t.href?"link":"button",onclick:i(),class:"button",...r},"svelte-1qqv88o",s.namespaceURI===Ji,s.nodeName.includes("-")),xn(s,"--size",n())});var u=Fe(),f=ne(u);Ct(f,()=>t.children??st),k(l,u)}),k(e,a),oe()}function ul(e){P(e,e.v+1)}function dl(e){let t=0,n=Ee(0),i;return()=>{Za()&&(c(n),yn(()=>(t===0&&(i=Ke(()=>e(()=>ul(n)))),t+=1,()=>{Bn().then(()=>{t-=1,t===0&&(i==null||i(),i=void 0)})})))}}var zt,Wt;class fl{constructor(t,n){Cn(this,zt);Cn(this,Wt);jn(this,zt,t),jn(this,Wt,dl(n))}get current(){return Pn(this,Wt).call(this),Pn(this,zt).call(this)}}zt=new WeakMap,Wt=new WeakMap;const vl=/\(.+\)/;class _l extends fl{constructor(t,n){let i=vl.test(t)?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,a=>ko(r,"change",a))}}const ui=new _l("(prefers-reduced-motion: reduce)");var hl=(e,t)=>t()(),gl=I('<div class="modal svelte-aqwna4"><div class="dialog svelte-aqwna4" role="dialog" aria-labelledby="title" data-view-transition-new=""><div class="close svelte-aqwna4"><!></div> <!></div> <div class="backdrop svelte-aqwna4"></div></div>');function Fr(e,t){ae(t,!0);const n=L(t,"onclose",3,()=>null),i=L(t,"onscroll",3,()=>null);br("scope","modal"),Ze(()=>{const f=document.body.style.overflowY;return document.body.style.overflowY="hidden",()=>document.body.style.overflowY=f||""});function r(f){return ui.current?Ft(f,{duration:0}):window.innerWidth<600?En(f,{duration:250,y:window.innerHeight}):sl(f,{duration:150,start:.85})}var a=gl();ce("keydown",we,({key:f})=>{f==="Escape"&&n()()});var o=b(a),s=b(o),l=b(s);ci(l,{onclick:()=>n()(),children:(f,_)=>{Br(f)},$$slots:{default:!0}});var d=E(s,2);Ct(d,()=>t.children);var u=E(o,2);u.__click=[hl,n],ce("scroll",o,function(...f){var _;(_=i())==null||_.apply(this,f)}),je(7,o,()=>r),je(7,a,()=>Ft,()=>({duration:150})),k(e,a),oe()}fe(["click"]);const ml=[{slug:"100",name:"All",categories:{movie:100,series:100,documentary:100,kids:100,cinema:100,podcasts:100}},{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];var pl=I('<div class="genre svelte-1ebula3"> </div>'),yl=(e,t)=>P(t,!0),wl=I('<button class="genre expand svelte-1ebula3"> </button>'),kl=I("<!> <!>",1);function bl(e,t){ae(t,!0);let n=U(!1);const i=K(()=>c(n)?t.genres:[t.genres[0]]);var r=kl(),a=ne(r);at(a,17,()=>c(i),xt,(l,d)=>{var u=Fe();const f=K(()=>{var g;return(g=ml.find(v=>v.slug===c(d)))==null?void 0:g.name});var _=ne(u);{var m=g=>{var v=pl(),p=b(v);N(()=>G(p,be(c(f)))),k(g,v)};q(_,g=>{c(f)&&g(m)})}k(l,u)});var o=E(a,2);{var s=l=>{var d=wl();d.__click=[yl,n];var u=b(d);N(()=>G(u,`+${t.genres.length-1}`)),k(l,d)};q(o,l=>{!c(n)&&t.genres.length>1&&l(s)})}k(e,r),oe()}fe(["click"]);function xl(e){let t=[];for(const n of e){let i=n;const r=t.find(s=>s.name===i.name),a=r==null?void 0:r.extra_info.category,o=i.extra_info.category;(a==="RENT"&&o==="BUY"||a==="BUY"&&o==="RENT")&&(t=t.filter(s=>s.name!==i.name),i={...i,extra_info:{...i.extra_info,category:"TVOD"}}),t.push(i)}return t}function xe(e,t=1){e.role="heading",e.ariaLevel=t.toString()}var Sl=Le('<svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 11L5 6L0 1" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function El(e){var t=Sl();k(e,t)}function Ut(e){return e?e.replace("/src/img",""):null}var Tl=(e,t,n)=>t(n()),Il=I('<div class="arrow svelte-g63n1y"><!></div>'),Al=I('<a target="_blank" class="playlink svelte-g63n1y" rel="sponsored"><img alt="" height="32" width="32" class="svelte-g63n1y"> <div><span class="name svelte-g63n1y"> </span> <div class="category svelte-g63n1y"> </div></div> <!></a>'),Pl=I('<div class="playlink empty svelte-g63n1y"> </div>'),Cl=I('<div class="heading svelte-g63n1y"> </div> <div class="playlinks svelte-g63n1y"><!> <!></div>',1);function jl(e,t){ae(t,!0);const n=L(t,"list",3,!1),i=so("scope")==="modal",r=K(()=>t.playlinks.filter(v=>!!v.logo_url)),a=K(()=>xl(c(r))),o={SVOD:be("Stream"),BUY:be("Buy"),RENT:be("Rent"),TVOD:be("Rent Or Buy")};function s(v){pe(i?he.TitleModalPlaylinkClick:he.TitlePopoverPlaylinkClick,t.title,{playlink:v})}var l=Cl(),d=ne(l),u=b(d);N(()=>G(u,be("Where To Stream Online"))),Qt(d,(v,p)=>xe==null?void 0:xe(v,p),()=>3);var f=E(d,2),_=b(f);at(_,17,()=>c(a),xt,(v,p)=>{let y=()=>c(p).name,w=()=>c(p).url,S=()=>c(p).logo_url,j=()=>c(p).highlighted,x=()=>c(p).cta_text,T=()=>c(p).extra_info.category;var H=Al();H.__click=[Tl,s,y];var M=b(H);N(()=>ue(M,"src",Ut(S())));var A=E(M,2),O=b(A),C=b(O),B=E(O,2),D=b(B);N(()=>G(D,x()||o[T()]||be("Stream")));var z=E(A,2);{var F=V=>{var W=Il(),J=b(W);El(J),k(V,W)};q(z,V=>{n()&&V(F)})}N(()=>{ue(H,"href",w()),ue(H,"data-playlink",y()),se(H,"highlighted",j()&&x()),G(C,y())}),k(v,H)});var m=E(_,2);{var g=v=>{var p=Pl(),y=b(p);N(()=>G(y,be("Title Unavailable"))),k(v,p)};q(m,v=>{t.playlinks.length||v(g)})}N(()=>se(f,"list",n())),k(e,l),oe()}fe(["click"]);var Ml=(e,t)=>P(t,!0),Ll=I('<button class="show-more svelte-1u3je71">Show more</button>'),Nl=I('<div class="paragraph svelte-1u3je71" role="paragraph"> </div>'),Dl=I('<div><span class="paragraph svelte-1u3je71" role="paragraph"> <!> <!></span> <!></div>');function Ol(e,t){ae(t,!0);const n=L(t,"blurb",3,""),i=L(t,"limit",3,200);let r=U(!1);const a=K(()=>t.text.slice(0,i()));var o=Dl(),s=b(o),l=b(s),d=E(l);{var u=v=>{var p=Be("...");k(v,p)};q(d,v=>{!c(r)&&t.text.length>i()&&v(u)})}var f=E(d,2);{var _=v=>{var p=Ll();p.__click=[Ml,r],k(v,p)};q(f,v=>{!c(r)&&(t.text.length>i()||n())&&v(_)})}var m=E(s,2);{var g=v=>{var p=Nl(),y=b(p);N(()=>G(y,n())),k(v,p)};q(m,v=>{c(r)&&v(g)})}N(()=>G(l,c(r)?t.text:c(a))),k(e,o),oe()}fe(["click"]);var Rl=Le('<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 0.351929L9.163 4.72803L14 5.43408L10.5 8.8385L11.326 13.648L7 11.3761L2.674 13.648L3.5 8.8385L0 5.43408L4.837 4.72803L7 0.351929Z" fill="#F6C045"></path></svg>');function Vr(e){var t=Rl();k(e,t)}var ql=I('<div class="top svelte-1026zg0"><img class="poster svelte-1026zg0"></div>'),Hl=I("<div> </div>"),Bl=I('<img alt="" class="svelte-1026zg0">'),Fl=I('<div class="content svelte-1026zg0" data-playpilot-link-injections-title=""><div class="header svelte-1026zg0"><!> <div class="heading svelte-1026zg0" id="title"> </div> <div class="info svelte-1026zg0"><div class="imdb svelte-1026zg0"><!> </div> <!> <div> </div> <div class="capitalize svelte-1026zg0"> </div> <!></div></div> <div class="main"><!> <!></div></div> <div class="background svelte-1026zg0"><!></div>',1);function Ur(e,t){ae(t,!0);const n=L(t,"small",3,!1),i=L(t,"compact",3,!1);let r=U(!1),a=U(!1),o=U(!1);var s=Fl(),l=ne(s),d=b(l),u=b(d);{var f=F=>{var V=ql(),W=b(V);N(()=>ue(W,"src",Ut(t.title.standing_poster))),N(()=>{ue(W,"alt",`Movie poster for '${t.title.title??""}'`),se(W,"loaded",c(r))}),ce("load",W,()=>P(r,!0)),k(F,V)};q(u,F=>{i()||F(f)})}var _=E(u,2),m=b(_);Qt(_,(F,V)=>xe==null?void 0:xe(F,V),()=>2);var g=E(_,2),v=b(g),p=b(v);Vr(p);var y=E(p),w=E(v,2);bl(w,{get genres(){return t.title.genres}});var S=E(w,2),j=b(S),x=E(S,2),T=b(x);N(()=>G(T,be(`Type: ${t.title.type}`)));var H=E(x,2);{var M=F=>{var V=Hl(),W=b(V);N(()=>G(W,`${t.title.length??""} ${be("Minutes")??""}`)),k(F,V)};q(H,F=>{!n()&&t.title.length&&F(M)})}var A=E(d,2),O=b(A);jl(O,{get playlinks(){return t.title.providers},get title(){return t.title},list:!0});var C=E(O,2);{var B=F=>{Ol(F,{get text(){return t.title.description},get blurb(){return t.title.blurb}})};q(C,F=>{n()||F(B)})}var D=E(l,2),z=b(D);Ir(z,()=>c(o),F=>{var V=Bl();N(()=>ue(V,"src",Ut(c(o)?t.title.standing_poster:t.title.medium_poster))),N(()=>{se(V,"loaded",c(a)),se(V,"blur",c(o))}),ce("load",V,()=>P(a,!0)),ce("error",V,()=>P(o,!0)),k(F,V)}),N(()=>{se(l,"small",n()),se(l,"compact",i()),se(_,"truncate",n()),G(m,t.title.title),G(y,` ${t.title.imdb_score??""}`),G(j,t.title.year),se(D,"faded",i())}),k(e,s),oe()}function Vl(e,t){ae(t,!0),pe(he.TitleModalView,t.title);let n=!1;Ze(()=>{const r=Date.now();return()=>pe(he.TitleModalClose,t.title,{time_spent:Date.now()-r})});function i(){n||(pe(he.TitleModalScroll,t.title),n=!0)}Fr(e,{get onclose(){return t.onclose},onscroll:i,children:(r,a)=>{Ur(r,{get title(){return t.title}})},$$slots:{default:!0}}),oe()}var Ul=I('<div class="popover svelte-tb2xdq" tabindex="-1" aria-hidden="true"><div class="dialog svelte-tb2xdq" data-view-transition-old=""><!></div></div>');function zl(e,t){ae(t,!0);let n=L(t,"maxHeight",15);br("scope","popover");let i=U(null),r=U(!1);Ze(async()=>{await Bn(),a(),await Bn(),o()});function a(){if(!c(i))return;const{top:f,right:_,bottom:m,height:g}=c(i).getBoundingClientRect(),v=s();P(r,X(f-v<0&&window.innerHeight-m>f+g));const p=window.innerWidth-_-v;_+v>window.innerWidth&&(c(i).style.left=`${p}px`)}function o(){if(!c(i))return;const{top:f,height:_}=c(i).getBoundingClientRect(),m=s(),g=c(r)?window.innerHeight-f-m:f+_-m;n(Math.min(g,window.innerHeight*.8))}function s(){return parseFloat(getComputedStyle(document.documentElement).fontSize)}var l=Ul(),d=b(l),u=b(d);Ct(u,()=>t.children),$t(l,f=>P(i,f),()=>c(i)),N(()=>{se(l,"flip",c(r)),xn(l,"--max-height",n()?n()+"px":null)}),je(7,d,()=>En,()=>({duration:ui.current?0:100,y:10})),k(e,l),oe()}var Wl=I('<div class="title-popover svelte-d86q0q" data-playpilot-title-popover="" role="region" aria-labelledby="title"><!></div>');function Kl(e,t){ae(t,!0);let n=U(0),i=U(null);pe(he.TitlePopoverView,t.title),Ze(()=>{r();const s=Date.now();return()=>pe(he.TitlePopoverClose,t.title,{time_spent:Date.now()-s})});function r(){const s=t.event.target;if(!(s!=null&&s.getClientRects))return;const l=Array.from(s.getClientRects()),u=l.map(_=>_.x).map(_=>Math.abs(_-t.event.clientX)),f=l[u.indexOf(Math.min(...u))];c(i).style.top=f.top+window.scrollY+"px",c(i).style.left=f.left+window.scrollX+"px",c(i).style.height=f.height+"px"}var a=Wl(),o=b(a);zl(o,{get maxHeight(){return c(n)},set maxHeight(s){P(n,X(s))},children:(s,l)=>{var d=K(()=>!!c(n)&&c(n)<250);Ur(s,{get title(){return t.title},small:!0,get compact(){return c(d)}})},$$slots:{default:!0}}),$t(a,s=>P(i,s),()=>c(i)),k(e,a),oe()}var Yl=e=>e.stopPropagation(),Zl=(e,t,n,i)=>t(e,c(n).title_details,c(i)),Gl=I(' <span class="svelte-pfvkex"><button class="svelte-pfvkex"> </button></span>',1),Xl=(e,t,n,i)=>t(c(n).title_details,i()),Jl=I('<!> <a target="_blank"> </a>',1),Ql=I(" <!>.",1),$l=I("<!> <br>",1),es=I(" <br>",1),ts=I('<span class="svelte-pfvkex"><!></span>'),ns=I('<p class="svelte-pfvkex"></p>');function is(e,t){ae(t,!0);const n=L(t,"onclickmodal",3,()=>null);function i(l,d){pe(he.AfterArticlePlaylinkClick,l,{playlink:d})}function r(l,d,u){pe(he.AfterArticleModalButtonClick,d),n()(l,u)}var a=Fe(),o=ne(a);{var s=l=>{var d=ns();at(d,21,()=>t.linkInjections,xt,(u,f)=>{var _=ts();const m=K(()=>{const{key:w,title:S,title_details:j,after_article_style:x}=c(f);return{key:w,title:S,title_details:j,after_article_style:x}}),g=K(()=>{var w;return((w=c(m).title_details)==null?void 0:w.providers)||[]});var v=b(_);{var p=w=>{var S=$l(),j=ne(S);{var x=H=>{var M=Gl(),A=ne(M);N(()=>G(A,`"${c(m).title??""}" ${be("Is Available To Stream")??""} `));var O=E(A);O.__click=[Yl];var C=b(O);C.__click=[Zl,r,m,f];var B=b(C);N(()=>G(B,be("View Streaming Options"))),k(H,M)},T=H=>{var M=Ql(),A=ne(M);N(()=>G(A,`"${c(m).title??""}" ${be("Is Available To Stream On")??""} `));var O=E(A);at(O,17,()=>c(g),xt,(C,B,D)=>{let z=()=>c(B).name,F=()=>c(B).url;var V=Jl(),W=ne(V);{var J=de=>{var Ae=Be();N(()=>G(Ae,D===c(g).length-1?`, ${be("And")}`:",")),k(de,Ae)};q(W,de=>{D&&de(J)})}var ee=E(W,2);ee.__click=[Xl,i,m,z];var re=b(ee);N(()=>{ue(ee,"href",F()),G(re,z())}),k(C,V)}),k(H,M)};q(j,H=>{c(m).after_article_style==="modal_button"?H(x):H(T,!1)})}k(w,S)},y=w=>{var S=es(),j=ne(S);N(()=>G(j,`"${c(m).title??""}" ${be("Title Unavailable Suffix")??""} `)),k(w,S)};q(v,w=>{c(g).length?w(p):w(y,!1)})}N(()=>ue(_,"data-playpilot-injection-key",c(m).key)),k(u,_)}),k(l,d)};q(o,l=>{t.linkInjections.length&&l(s)})}k(e,a),oe()}fe(["click"]);function rs(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function di(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||""}function Di(e,t,n=[]){var a,o;const i=document.createTreeWalker(t);let r;for(;(r=i.nextNode())&&!((a=r.nodeValue)!=null&&a.includes(e)&&!n.includes(((o=r.parentNode)==null?void 0:o.nodeName)||"")););return r}function Oi(e){const t=e.parentNode;return t?t.nodeName==="A"||!!t.closest("a"):!1}function as(e,t,n,i){const r=rs(t),a=di(t),o=e.slice(0,i),s=e.slice(i),l=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${a.replace(l,"\\$&")}|${r.replace(l,"\\$&")}`),u=s.replace(d,n);return o+u}function os(e,t,n,i){return e.substring(0,n)+t+e.substring(i)}function Te(e){return di(e).toLowerCase().replace(/\s+/g,"")}function zr(e,t,n){const r=e.indexOf(t),a=Math.floor((n-t.length)/2);let o=Math.max(0,r-a),s=o+n;s>e.length&&(s=e.length,o=Math.max(0,s-n));let l=e.slice(o,s).trim();return o>0&&(l="…"+l),s<e.length&&(l+="…"),l}function ls(e,t,n){const i=e.nodeType===Node.TEXT_NODE&&e.parentNode?e.parentElement:e;if(!i||!e.textContent)return{before:"",after:""};const r=i.innerText.indexOf(e.textContent),a=Ri(i.innerText.slice(0,t+r)),o=i.innerText.slice(n+r),s=Ri(qi(a,2)),l=qi(o,2);return{before:s,after:l}}function Ri(e){return e.split("").reverse().join("")}function qi(e,t=1){const n=e.match(/[^\s]+/g);return n?n.slice(0,t).join(" ").replace(/[.,!?;:]+$/u,""):""}function ss(e,t){let n=0,i=0;for(;(i=e.indexOf(t,i))!==-1;)n++,i+=t.length;return n}function cs(e,t,n){const i=[];let r=0;for(;r<=e.length;){const a=t?e.indexOf(t,r):r;if(a===-1&&t)break;const o=t?a+t.length:a,s=n?e.indexOf(n,o):e.length;if(n&&s===-1)break;const l=e.slice(o,s);i.push({match:l,index:o}),r=n?s+n.length:e.length+1}return i}function us(e,t,n,i){const a=cs(e,n,i).filter(({match:s})=>di(s).includes(t));return a.length?a.reduce((s,l)=>!s||l.match.length<s.match.length?l:s):null}function ds(e){var t,n;return{leadingSpaces:((t=e.match(/^\s*/))==null?void 0:t[0].length)||0,trailingSpaces:((n=e.match(/\s*$/))==null?void 0:n[0].length)||0}}function Wr(e){return e.ctrlKey||e.metaKey||e.button!==0}function fs(e,t){if(!document.startViewTransition||!t){e();return}document.startViewTransition(()=>{const n=document.querySelector("[data-view-transition-old]");if(!n)return;const i=window.getComputedStyle(n).getPropertyValue("view-transition-name");n.style.viewTransitionName="none",e();const r=document.querySelector("[data-view-transition-new]");r&&(r.style.viewTransitionName=i)})}const ut="data-playpilot-injection-key",Nt=`[${ut}]`;let vn=null,dt=null,Dt=null,Ot=null;function fi(e,t=""){const n=[],i=[e];for(;i.length>0;){const r=i.pop();if(n.includes(r)||t&&r.matches(t)||/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|H1)$/.test(r.tagName)||r.offsetWidth<=1)continue;const a=Array.from(r.childNodes).some(l=>{var d;return l.nodeType===Node.TEXT_NODE&&((d=l.nodeValue)==null?void 0:d.trim())!==""});if(a&&r.tagName==="LI"){const l=r.closest("ul, ol");l&&!n.includes(l)&&n.push(l);continue}const o=r.tagName==="P"&&!!r.textContent;if(a||o){n.push(r);continue}const s=Array.from(r.children);for(let l=s.length-1;l>=0;l--)i.push(s[l])}return n}function St(){var t;const e=(t=window.PlayPilotLinkInjections)==null?void 0:t.selector;if(e){const n=e.replace(/(:)/g,"\\$1"),i=document.querySelector(n);if(i)return i}return document.querySelector("article")||document.querySelector("main")||document.body}function Kr(e){return e.map(t=>t.innerText).join(`
11
9
 
12
- `));pn(()=>{c(a)&&!c(l)&&p()}),Je(()=>{if(!Cs())return(async()=>(await v(),be(ye.ArticlePageView)))(),()=>fi()});async function v(){P(l,!0),c(a)&&P(s,X(await Lr()));try{const A=await As(),B=ai();if(P(d,!!(A!=null&&A.exclude_urls_pattern&&B.match(new RegExp(A.exclude_urls_pattern)))),c(d))return;A!=null&&A.custom_style&&x(A.custom_style||""),S((A==null?void 0:A.html_selector)||"",(A==null?void 0:A.exclude_elements_selector)||"")}catch(A){be(ye.FetchingConfigFailed),console.error("TPI Config failed to fetch",A);return}try{if(P(r,X(await Ri(c(g),{maxTries:1,runAiWhenRelevant:!0}))),P(l,!1),!c(r))return;if(Qo({organizationSid:c(r).organization_sid,domainSid:c(r).domain_sid}),!c(r).ai_running||!c(r).ai_enabled){w({aiInjections:c(_),manualInjections:c(m)});return}if(!c(a))return;P(r,X(await Ri(c(g),{requireCompletedResult:!0,onpoll:A=>P(r,X(A))}))),w({aiInjections:c(_),manualInjections:c(m)})}catch(A){console.error(A),be(ye.InjectionError,null,{message:A.message})}}function p(){w(Yr(c(u)))}function y(){P(a,!1),requestAnimationFrame(()=>{P(a,!0),v()})}function w(A={aiInjections:c(_),manualInjections:c(m)}){const B=ds(c(i),A);JSON.stringify(B)!==JSON.stringify(c(u))&&P(u,X(B));const O=B.filter(z=>!z.failed);O.length&&(c(a)||be(ye.ArticleInjected,null,{manual:O.filter(z=>z.manual).length,ai:O.filter(z=>!z.manual).length}))}function S(A,B){A&&(window.PlayPilotLinkInjections.selector=A),P(n,X(Ut())),P(i,X(zr(c(n),B)))}function j(){P(a,!0),tl(),v()}function x(A){const B="playpilot-custom-style",O=document.getElementById(B),z=O||document.createElement("style");z.textContent=`[data-playpilot-link-injections] { ${A} }`,z.id=B,O||document.body.appendChild(z)}var T=Su(),H=b(T);{var M=A=>{xu(A,{onclick:j,onclose:()=>{P(o,!1),el()}})};q(H,A=>{!c(d)&&c(o)&&!c(a)&&A(M)})}var C=E(H,2);{var D=A=>{var B=Fe(),O=ne(B);Zo(O,{onerror:F=>be(ye.EditorError,null,{message:F.message}),failed:F=>{ht(F,{fixed:!0,children:(V,W)=>{var J=Be("An error has occured in the PlayPilot Linkinjections editor view. We've been notified and will investigate!");k(V,J)},$$slots:{default:!0}})}},F=>{var V=K(()=>{var J;return(J=c(r))==null?void 0:J.injections_enabled}),W=K(()=>{var J,ee,re,de,Ae;return{aiEnabled:(J=c(r))==null?void 0:J.ai_enabled,aiRunning:((ee=c(r))==null?void 0:ee.ai_running)&&((re=c(r))==null?void 0:re.ai_enabled),message:(de=c(r))==null?void 0:de.ai_progress_message,percentage:(Ae=c(r))==null?void 0:Ae.ai_progress_percentage}});yu(F,{get pageText(){return c(g)},get loading(){return c(l)},onreinitialize:y,get injectionsEnabled(){return c(V)},get aiStatus(){return c(W)},get linkInjections(){return c(u)},set linkInjections(J){P(u,X(J))}})}),k(A,B)};q(C,A=>{!c(d)&&c(a)&&c(s)&&A(D)})}k(e,T),oe()}window.PlayPilotLinkInjections={token:"",editorial_token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,app:null,initialize(e={token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,editorial_token:""}){if(!e.token){console.error("An API token is required.");return}this.token=e.token,this.editorial_token=e.editorial_token,this.selector=e.selector,this.after_article_selector=e.after_article_selector,this.after_article_insert_position=e.after_article_insert_position,this.language=e.language,this.organization_sid=e.organization_sid,this.domain_sid=e.domain_sid,this.app&&this.destroy();const t=document.createElement("div");t.id="playpilot-link-injection",document.body.insertAdjacentElement("beforeend",t),this.app=Jt(Eu,{target:t})},destroy(){if(!this.app)return;this.app=null;const e=document.getElementById("playpilot-link-injection");e&&e.remove(),fi()}};
10
+ `)}function vs(e,t={aiInjections:[],manualInjections:[]}){vi();const n=ks(t);if(!n)return[];const i=Te(e.map(l=>l.innerText).join(" ")),r=bs(n),a=r.filter(l=>i.includes(Te(l.sentence))),o={};for(const l of a){const d=e.findIndex(S=>Te(S.innerText).includes(Te(l.sentence))),u=e[d];if(!u)continue;const f=Di(l.title,u,["A"]);if(!(f!=null&&f.nodeValue)||Oi(f)){const S=Di(l.title,u);if(S&&Oi(S)){o[l.key]="Given text is already inside of a link.";continue}}const{injectionElement:_,linkElement:m}=_s(l),{phrase_before:g,phrase_after:v}=l;let p=-1,y=!1;if(ss(Te(u.innerText),Te(l.title))===1&&(p=u.innerHTML.indexOf(l.title)),p===-1&&(g||v)){const S=[g,l.title,v].filter(Boolean).join(" ");if(p=u.innerHTML.indexOf(S),p===-1){const j=us(u.innerHTML,l.title,g||"",v||"");if(j){const{leadingSpaces:x,trailingSpaces:T}=ds(j.match);m.innerHTML=j.match.trim();const H=j.index+x,M=j.index+j.match.length-T;u.innerHTML=os(u.innerHTML,_.outerHTML,H,M),p=j.index,y=!0}}}if(p===-1&&(f!=null&&f.nodeValue)){const S=u.innerHTML.indexOf(f.nodeValue),j=u.innerHTML.indexOf(l.sentence);p=Math.max(S,j,0)}p!==-1&&(y||(u.innerHTML=as(u.innerHTML,l.title,_.outerHTML,p)))}gs(r),hs();const s=xs(n);return s.length&&ps(e,s),n.filter(l=>l.title_details).map((l,d)=>{const u=l.duplicate??(!l.manual&&Ss(l,d,n)),f=document.querySelector(`[${ut}="${l.key}"]`),_=Tn(l)&&!l.inactive&&!l.after_article&&!f,m=!!e.find(v=>Te(v.innerText).includes(Te(l.sentence))),g=_?o[l.key]||(m?"The link failed to inject for unknown reasons.":"Given sentence was not found in the article."):"";return{...l,inactive:l.inactive??!1,duplicate:u,failed:_,failed_message:g}})}function _s(e){const t=document.createElement("span");t.dataset.playpilotInjectionKey=e.key;const n=document.createElement("a");return n.innerText=e.title,n.href=e.playpilot_url,n.target="_blank",n.rel="noopener nofollow noreferrer",t.insertAdjacentElement("beforeend",n),{injectionElement:t,linkElement:n}}function hs(){const e=Array.from(document.querySelectorAll(`${Nt} a`)),t=["--playpilot-injection-text-color","--playpilot-injection-text-color-hover","--playpilot-injection-font-weight","--playpilot-injection-font-weight-headings","--playpilot-injection-text-decoration","--playpilot-injection-text-decoration-hover","--playpilot-injection-background-color","--playpilot-injection-background-color-hover"];e.forEach(n=>{t.forEach(i=>{getComputedStyle(n).getPropertyValue(i)&&(n.dataset.usedCssVariables=`${n.dataset.usedCssVariables||""} ${i}`)})})}function gs(e){window.addEventListener("click",n=>{if(Wr(n))return;let i=n.target;if(!i||(i.hasAttribute(ut)||(i=i.closest(Nt)),!i))return;const r=i.getAttribute(ut);if(!r)return;const a=e.find(o=>r===o.key);a&&(n.preventDefault(),fs(()=>{_n(!1),Yr(n,a)},!ui.current&&window.innerWidth>=600&&!window.matchMedia("(pointer: coarse)").matches))}),window.addEventListener("mousemove",n=>{if(!dt)return;const i=n.target;i.hasAttribute("data-playpilot-title-popover")||i.closest("[data-playpilot-title-popover]")||i.hasAttribute(ut)||i.closest(Nt)||_n()}),Array.from(document.querySelectorAll(Nt)).forEach(n=>{const i=n.dataset.playpilotInjectionKey,r=e.find(a=>i===a.key);r&&(n.addEventListener("mouseenter",a=>{dt||ms(a,r)}),n.addEventListener("mouseleave",()=>vn=null))})}function Yr(e,t){Wr(e)||Ot||(e.preventDefault(),Ot=Jt(Vl,{target:$r(),props:{title:t.title_details,onclose:Zr}}))}function Zr(e=!0){Ot&&(bn(Ot,{outro:e}),Ot=null)}function ms(e,t){if(window.matchMedia("(pointer: coarse)").matches)return;dt&&_n();const n=e.currentTarget;vn=n,setTimeout(()=>{vn===n&&(dt=Jt(Kl,{target:$r(),props:{event:e,title:t.title_details}}))},100)}function _n(e=!0){dt&&(bn(dt,{outro:e}),vn=null,dt=null)}function ps(e,t){var o,s;if(Dt||!t.length)return;const n=document.createElement("div"),i=(o=window.PlayPilotLinkInjections)==null?void 0:o.after_article_selector,r=(i?document.querySelector(i):null)||e[e.length-1],a=((s=window.PlayPilotLinkInjections)==null?void 0:s.after_article_insert_position)||"afterend";n.dataset.playpilotAfterArticlePlaylinks="true",r.insertAdjacentElement(a,n),Dt=Jt(is,{target:n,props:{linkInjections:t,onclickmodal:(l,d)=>Yr(l,d)}})}function ys(){var e;Dt&&(bn(Dt),(e=document.querySelector("[data-playpilot-after-article-playlinks]"))==null||e.remove(),Dt=null)}function vi(){document.querySelectorAll(Nt).forEach(t=>ws(t.getAttribute(ut)||"")),ys(),Zr(!1),_n(!1)}function ws(e){var i;const t=document.querySelector(`[${ut}="${e}"]`);if(!t)return;const n=(i=t.querySelector("a"))==null?void 0:i.innerHTML;t.outerHTML=n||""}function ks({aiInjections:e,manualInjections:t}){return[...t.map(n=>({...n,manual:!0})),...e]}function Gr(e){return{aiInjections:e.filter(t=>!t.manual),manualInjections:e.filter(t=>t.manual)}}function Xr(e){return!e.inactive&&!e.removed&&!e.duplicate&&!!e.title_details&&Tn(e)}function Tn(e){return e.in_text||e.in_text===void 0?!0:!!e.after_article}function bs(e){return Jr(e).filter(t=>t.in_text!==!1&&Xr(t))}function xs(e){return Jr(e).filter(t=>t.after_article===!0&&Xr(t))}function Jr(e){return e.filter(t=>t.removed||t.inactive?!1:t.manual&&!t.removed&&!t.inactive?!0:!e.some(n=>n.manual&&(n.removed||n.inactive)&&Qr(n,t)))}function Ss(e,t,n){return n.some((i,r)=>t!==r&&i.manual&&Qr(i,e))}function Qr(e,t){return e.title===t.title&&Te(e.sentence)===Te(t.sentence)}function $r(){return document.querySelector("[data-playpilot-link-injections]")||document.body}function _i(){const e=St();return{content_heading:Es(e),content_modified_time:Ts(e),content_published_time:Is(e)}}function Es(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function Ts(e){const t=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||e.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?hi(n):null}function Is(e){const t=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||e.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||e.querySelector("time")||document.querySelector("time")||e.querySelector("[datetime]")||document.querySelector("[datetime]")||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?hi(n):null}function hi(e){try{return new Date(e).toISOString()}catch{return null}}let Dn=null;async function en(e,{url:t=ai(),hash:n=al(e||""),params:i={}}={}){const r=new Headers({"Content-Type":"application/json"}),a=In(),o=Rr()?await Or():!1,s=Hr();if(!a)throw new Error("No token was provided");i.metadata=_i(),i.run_ai&&(i.hash=n,i.page_text=e);const l=await fetch(Sn+`/external-pages/?api-token=${a}&include_title_details=true${o?"&editorial_mode_enabled=true":""}&language=${s}`,{headers:r,method:"POST",body:JSON.stringify({url:t,...i})});if(!l.ok)throw l;const d=await l.json();return window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function Hi(e,{requireCompletedResult:t=!1,runAiWhenRelevant:n=!1,pollInterval:i=3e3,maxTries:r=600,onpoll:a=()=>null}={}){let o=0;Dn&&clearTimeout(Dn);const s=async(l,d)=>{let u;try{if(u=await en(e),n&&(u=await As(e,u)),t&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=Bi(u.manual_injections||[]),u.ai_injections=Bi(u.ai_injections||[]),l(u);return}catch{if(o++,o>=r){r>1&&console.error("Max poll limit exceeded. Please return later."),l();return}u&&a(u),Dn=setTimeout(()=>s(l),i)}};return new Promise(s)}async function As(e,t){if(!e||!t.ai_enabled||t.ai_running)return t;const n=_i().content_modified_time,i=t.content_modified_time?hi(t.content_modified_time):null,r=n&&i===n;return t.ai_last_run&&r?t:await en(e,{params:{run_ai:!0}})}async function Ps(e,t){var o;const n=(o=window.PlayPilotLinkInjections)==null?void 0:o.selector,r=e.filter(s=>s.manual).map(s=>({sid:s.sid,title:s.title,sentence:s.sentence,phrase_before:s.phrase_before,phrase_after:s.phrase_after,playpilot_url:s.playpilot_url,after_article:!!s.after_article,after_article_style:s.after_article_style||null,in_text:s.in_text??!0,inactive:!!s.inactive,removed:!!s.removed}));if(!await en(t,{params:{private_token:li(),manual_injections:r,content_text_selector:n}}))throw new Error("saveLinkInjections response was faulty");return e}async function Cs(){const e=new Headers({"Content-Type":"application/json"}),t=In();if(!t)throw new Error("No token was provided");const n=await fetch(Sn+`/domains/config?api-token=${t}`,{headers:e});if(!n.ok)throw n;try{return await n.json()||null}catch{return null}}function Bi(e){return e.map(t=>({...t,key:ea(t.sid)}))}function ea(e){return e+"-"+qr()}function In(){var e;return(e=window.PlayPilotLinkInjections)==null?void 0:e.token}function js(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}var Ms=Le('<svg width="8" height="4" viewBox="0 0 8 4" fill="none" class="svelte-by11ix"><path d="M1 0.5L4 3.5L7 0.5" stroke="currentColor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Ls(e,t){const n=L(t,"expanded",3,!1);var i=Ms();N(()=>se(i,"expanded",n())),k(e,i)}var Ns=Le('<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="17" r="1" fill="var(--playpilot-warning)"></circle><path d="M12 10L12 14" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.44722 18.1056L10.2111 4.57771C10.9482 3.10361 13.0518 3.10362 13.7889 4.57771L20.5528 18.1056C21.2177 19.4354 20.2507 21 18.7639 21H5.23607C3.7493 21 2.78231 19.4354 3.44722 18.1056Z" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Ds(e){var t=Ns();k(e,t)}function Os(e,t,n){t(!t()),n()(t())}var Rs=I('<button class="switch svelte-91s87b"><div class="label svelte-91s87b"><!></div> <div class="track svelte-91s87b"><div class="knob svelte-91s87b"></div></div></button>');function Wn(e,t){ae(t,!0);let n=L(t,"active",15),i=L(t,"fullwidth",3,!1),r=L(t,"label",3,""),a=L(t,"onclick",3,()=>null);var o=Rs();o.__click=[Os,n,a];var s=b(o),l=b(s);Ct(l,()=>t.children),N(()=>{ue(o,"aria-label",`Toggle ${r()??""} ${(n()?"off":"on")??""}`),se(o,"active",n()),se(o,"fullwidth",i())}),k(e,o),oe()}fe(["click"]);var qs=I('<input type="text" autocomplete="off" class="svelte-1vrer3i">');function gi(e,t){let n=L(t,"value",15),i=L(t,"label",3,""),r=L(t,"name",3,""),a=L(t,"readonly",3,!1),o=L(t,"oninput",3,()=>null);var s=qs();s.__input=function(...l){var d;(d=o())==null||d.apply(this,l)},N(()=>{ue(s,"name",r()),ue(s,"aria-label",i()),ue(s,"placeholder",i()),s.readOnly=a()}),Bo(s,n),k(e,s)}fe(["input"]);var Hs=Le('<path d="M13.5833 13.6667L4.41667 13.6667M5.5 1.5H12.5C13.9001 1.5 14.6002 1.5 15.135 1.77248C15.6054 2.01217 15.9878 2.39462 16.2275 2.86502C16.5 3.3998 16.5 4.09987 16.5 5.5V12.5C16.5 13.9001 16.5 14.6002 16.2275 15.135C15.9878 15.6054 15.6054 15.9878 15.135 16.2275C14.6002 16.5 13.9001 16.5 12.5 16.5H5.5C4.09987 16.5 3.3998 16.5 2.86502 16.2275C2.39462 15.9878 2.01217 15.6054 1.77248 15.135C1.5 14.6002 1.5 13.9001 1.5 12.5V5.5C1.5 4.09987 1.5 3.3998 1.77248 2.86502C2.01217 2.39462 2.39462 2.01217 2.86502 1.77248C3.3998 1.5 4.09987 1.5 5.5 1.5Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),Bs=Le('<path d="M13.5833 8.58342H4.41667M5.5 1.50009H12.5C13.9001 1.50009 14.6002 1.50009 15.135 1.77258C15.6054 2.01226 15.9878 2.39471 16.2275 2.86512C16.5 3.39989 16.5 4.09996 16.5 5.50009V12.5001C16.5 13.9002 16.5 14.6003 16.2275 15.1351C15.9878 15.6055 15.6054 15.9879 15.135 16.2276C14.6002 16.5001 13.9001 16.5001 12.5 16.5001H5.5C4.09987 16.5001 3.3998 16.5001 2.86502 16.2276C2.39462 15.9879 2.01217 15.6055 1.77248 15.1351C1.5 14.6003 1.5 13.9002 1.5 12.5001V5.50009C1.5 4.09996 1.5 3.39989 1.77248 2.86512C2.01217 2.39471 2.39462 2.01226 2.86502 1.77258C3.3998 1.50009 4.09987 1.50009 5.5 1.50009Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),Fs=Le('<svg width="18" height="18" viewBox="0 0 18 18" fill="none"><!></svg>');function Fi(e,t){const n=L(t,"align",3,"bottom");var i=Fs(),r=b(i);{var a=s=>{var l=Hs();k(s,l)},o=s=>{var l=Fe(),d=ne(l);{var u=f=>{var _=Bs();k(f,_)};q(d,f=>{n()==="center"&&f(u)},!0)}k(s,l)};q(r,s=>{n()==="bottom"?s(a):s(o,!1)})}k(e,i)}var Vs=I("<div><!></div>");function ht(e,t){ae(t,!0);const n=L(t,"type",3,"error"),i=L(t,"fixed",3,!1);var r=Vs(),a=b(r);Ct(a,()=>t.children),N(()=>{No(r,`alert ${n()??""} svelte-df5n87`),se(r,"fixed",i())}),k(e,r),oe()}var Us=I("<!> In-text Playlink",1),zs=I("<!> Bottom Playlink",1),Ws=I('<div class="alert svelte-1shw34x"><!></div>'),Ks=(e,t)=>t().after_article_style="playlinks",Ys=(e,t)=>t().after_article_style="modal_button",Zs=I('<div><div class="label svelte-1shw34x">Bottom playlinks style</div> <div class="group svelte-1shw34x" role="listbox" tabindex="0" aria-label="Playlink type"><button role="option" id="playlinks-in-text" class="svelte-1shw34x">Playlinks sentence</button> <button role="option" id="playlinks-after-article" class="svelte-1shw34x">Modal button</button> <div class="active-marker svelte-1shw34x"></div></div></div>'),Gs=I('<div class="switches svelte-1shw34x"><!> <!></div> <!> <!>',1);function Xs(e,t){ae(t,!0);const n=L(t,"linkInjection",7),i=K(()=>n().after_article_style==="modal_button");var r=Gs(),a=ne(r),o=b(a),s=K(()=>n().in_text??!0);Wn(o,{fullwidth:!0,get active(){return c(s)},onclick:g=>{n().in_text=g,n().manual=!0},label:"In-text Playlink",children:(g,v)=>{var p=Us(),y=ne(p);Fi(y,{align:"center"}),k(g,p)},$$slots:{default:!0}});var l=E(o,2),d=K(()=>n().after_article??!1);Wn(l,{fullwidth:!0,get active(){return c(d)},onclick:g=>{n().after_article=g,n().manual=!0},label:"Bottom Playlink",children:(g,v)=>{var p=zs(),y=ne(p);Fi(y,{align:"bottom"}),k(g,p)},$$slots:{default:!0}});var u=E(a,2);{var f=g=>{var v=Ws(),p=b(v);ht(p,{type:"warning",children:(y,w)=>{var S=Be("At least one layout option must be selected for the playlink to be visible.");k(y,S)},$$slots:{default:!0}}),je(3,v,()=>Vt,()=>({duration:200})),k(g,v)};q(u,g=>{Tn(n())||g(f)})}var _=E(u,2);{var m=g=>{var v=Zs(),p=E(b(v),2),y=b(p);y.__click=[Ks,n];var w=E(y,2);w.__click=[Ys,n];var S=E(w,2);N(()=>{ue(p,"aria-activedescendant",`playlinks-${(c(i)?"after-article":"in-text")??""}`),ue(y,"aria-selected",!c(i)||null),se(y,"active",!c(i)),ue(w,"aria-selected",c(i)||null),se(w,"active",c(i)),se(S,"right",c(i))}),je(3,v,()=>Vt,()=>({duration:100})),k(g,v)};q(_,g=>{n().after_article&&g(m)})}k(e,r),oe()}fe(["click"]);var Js=Le('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.99984 10.8333C10.4601 10.8333 10.8332 10.4602 10.8332 10C10.8332 9.53977 10.4601 9.16668 9.99984 9.16668C9.5396 9.16668 9.1665 9.53977 9.1665 10C9.1665 10.4602 9.5396 10.8333 9.99984 10.8333Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 5.00001C10.4601 5.00001 10.8332 4.62691 10.8332 4.16668C10.8332 3.70644 10.4601 3.33334 9.99984 3.33334C9.5396 3.33334 9.1665 3.70644 9.1665 4.16668C9.1665 4.62691 9.5396 5.00001 9.99984 5.00001Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 16.6667C10.4601 16.6667 10.8332 16.2936 10.8332 15.8333C10.8332 15.3731 10.4601 15 9.99984 15C9.5396 15 9.1665 15.3731 9.1665 15.8333C9.1665 16.2936 9.5396 16.6667 9.99984 16.6667Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Qs(e){var t=Js();k(e,t)}var $s=(e,t)=>P(t,!c(t)),ec=I('<div class="content svelte-zpsd2z"><!></div>'),tc=I('<div class="context-menu svelte-zpsd2z"><button class="svelte-zpsd2z"><!></button> <!></div>');function nc(e,t){ae(t,!0);let n=U(!1),i=U(null);function r(u){var _;const f=u.target;f===c(i)||(_=c(i))!=null&&_.contains(f)||P(n,!1)}var a=tc();ce("click",we,r);var o=b(a);o.__click=[$s,n];var s=b(o);Qs(s),$t(o,u=>P(i,u),()=>c(i));var l=E(o,2);{var d=u=>{var f=ec(),_=b(f);Ct(_,()=>t.children),je(1,f,()=>En,()=>({duration:150,y:5})),k(u,f)};q(l,u=>{c(n)&&u(d)})}N(()=>{ue(o,"aria-label",t.ariaLabel),ue(o,"aria-expanded",c(n))}),k(e,a),oe()}fe(["click"]);function ic(e,t,n,i){var r,a;c(t)&&(pe(he.ManualReport,n.linkInjection.title_details,{report_reason:c(t),sid:n.linkInjection.sid,title:n.linkInjection.title,sentence:n.linkInjection.sentence,failed:(r=n.linkInjection.failed)==null?void 0:r.toString(),failed_message:n.linkInjection.failed_message,manual:(a=n.linkInjection.manual)==null?void 0:a.toString()}),P(i,!0),setTimeout(n.onclose,3e3))}var rc=(e,t,n)=>P(t,X(n())),ac=I('<option class="svelte-o5qkco"> </option>'),oc=I('<div class="sent svelte-o5qkco">Report has been sent, thank you! Closing window...</div>'),lc=I('<button class="submit svelte-o5qkco">Send report</button>'),sc=I('<div class="form svelte-o5qkco"><div class="heading svelte-o5qkco">Report issue</div> <div class="info svelte-o5qkco"><div><strong class="svelte-o5qkco">Title</strong> </div> <div><strong class="svelte-o5qkco">Sentence</strong> </div></div> <label for="reason">What would you like to report?</label> <select id="reason" name="reason" class="svelte-o5qkco"><option class="svelte-o5qkco">Select an issue...</option><!></select> <div><!></div></div>');function cc(e,t){ae(t,!0);const n=[{value:"failed_injection",label:"The link failed to appear on the page."},{value:"layout_issue",label:"The link is breaking the layout or formatting of my page."},{value:"wrong_content",label:"The link points to the wrong movie or show."},{value:"inappropriate_title",label:"The link points to an inappropriate movie or show."},{value:"broken_link",label:"The link is broken or leads to an error page."},{value:"other",label:"My issue is not listed, but please have a look regardless."}];let i=U(""),r=U(!1);Fr(e,{get onclose(){return t.onclose},children:(a,o)=>{var s=sc(),l=b(s);Qt(l,(x,T)=>xe==null?void 0:xe(x,T),()=>2);var d=E(l,2),u=b(d),f=E(b(u)),_=E(u,2),m=E(b(_));N(()=>G(m,`:
11
+ ${zr(t.linkInjection.sentence,t.linkInjection.title,100)??""}`));var g=E(d,4),v=b(g);v.value=((v.__value="")==null,"");var p=E(v);at(p,17,()=>n,xt,(x,T)=>{let H=()=>c(T).value,M=()=>c(T).label;var A=ac(),O={};A.__click=[rc,i,H];var C=b(A);N(()=>{O!==(O=H())&&(A.value=(A.__value=H())==null?"":H()),G(C,M())}),k(x,A)});var y=E(g,2),w=b(y);{var S=x=>{var T=oc();je(1,T,()=>Ft,()=>({duration:200})),k(x,T)},j=x=>{var T=lc();T.__click=[ic,i,t,r],N(()=>T.disabled=!c(i)),k(x,T)};q(w,x=>{c(r)?x(S):x(j,!1)})}N(()=>G(f,`: ${t.linkInjection.title??""}`)),Vo(g,()=>c(i),x=>P(i,x)),k(a,s)},$$slots:{default:!0}}),oe()}fe(["click"]);function uc(e,t,n){requestAnimationFrame(()=>t());const i=e.target;if(["BUTTON","INPUT"].includes(i.nodeName)||i.closest("button")||i.closest("input"))return;const r=n()[0];r&&r.scrollIntoView({behavior:"smooth"})}function dc(e,t){const n=Jt(cc,{target:document.body,props:{linkInjection:t(),onclose:()=>bn(n)}})}var fc=(e,t)=>P(t,!c(t)),vc=I('<button class="expand-sentence svelte-lo6h85"> </button>'),_c=I('<button class="context-menu-action svelte-lo6h85">Remove</button> <button class="context-menu-action svelte-lo6h85">Report issue</button>',1),hc=(e,t)=>P(t,!c(t)),gc=I('<div class="warning svelte-lo6h85" aria-label="Invalid playlink settings"><!></div>'),mc=I('<div class="actions svelte-lo6h85"><button class="expand svelte-lo6h85" aria-label="Expand"><!></button> <!> <!></div>'),pc=I('<div class="expanded svelte-lo6h85"><div class="label svelte-lo6h85">Link URL</div> <!> <div class="label offset svelte-lo6h85">Layout options</div> <div class="type-select svelte-lo6h85"><!></div></div>'),yc=I('<div class="item svelte-lo6h85"><div class="header svelte-lo6h85"><img class="poster svelte-lo6h85" alt="" width="32" height="48"> <div class="info svelte-lo6h85"><div class="title svelte-lo6h85"> </div> <div class="sentence svelte-lo6h85"><!> <!></div></div> <div class="context-menu svelte-lo6h85"><!></div></div> <div class="content svelte-lo6h85"><!> <!></div></div>');function wc(e,t){ae(t,!0);const n=L(t,"linkInjection",15),i=L(t,"onremove",3,()=>null),r=L(t,"onhighlight",3,()=>null),a=K(()=>n()||{}),o=K(()=>c(a).key),s=K(()=>c(a).sentence),l=K(()=>c(a).title_details),d=K(()=>c(a).failed),u=K(()=>c(a).failed_message),f=K(()=>c(a).inactive),_=K(()=>c(l)),m=K(()=>zr(n().sentence,n().title,60));let g=U(!1),v=U(!1),p=U(!1),y=U(null);Ze(()=>{c(d)&&pe(he.InjectionFailed,c(_),{phrase:n().title,sentence:c(s)})});function w(Q=!0){j().forEach(le=>{le.classList.toggle("playpilot-injection-highlight",Q)})}function S(Q){let te=Q.target,le=te==null?void 0:te.dataset.playpilotInjectionKey;te&&!le&&(te=te.closest(`[data-playpilot-injection-key="${c(o)}"]`),le=te==null?void 0:te.dataset.playpilotInjectionKey),P(p,le===c(o)),c(y)&&c(p)&&r()(c(y))}function j(){const Q=Array.from(document.querySelectorAll(`[data-playpilot-injection-key="${c(o)}"]`));return Q.length?Q:fi(St()).filter(te=>Te(te.innerText).includes(Te(n().sentence)))||[]}var x=yc();ce("mouseover",we,S),x.__click=[uc,w,j];var T=b(x),H=b(T);N(()=>ue(H,"src",Ut(c(_).standing_poster)));var M=E(H,2),A=b(M),O=b(A),C=E(A,2),B=b(C);Ao(B,()=>(c(v)?c(s):c(m)).replace(n().title,`<em>${n().title}</em>`));var D=E(B,2);{var z=Q=>{var te=vc();te.__click=[fc,v];var le=b(te);N(()=>G(le,c(v)?"Less":"More")),k(Q,te)};q(D,Q=>{c(m).length<c(s).length&&Q(z)})}var F=E(M,2),V=b(F);nc(V,{ariaLabel:"More options",children:(Q,te)=>{var le=_c(),Pe=ne(le);Pe.__click=function(...ot){var R;(R=i())==null||R.apply(this,ot)};var Qe=E(Pe,2);Qe.__click=[dc,n],k(Q,le)},$$slots:{default:!0}});var W=E(T,2),J=b(W);{var ee=Q=>{ht(Q,{children:(te,le)=>{var Pe=Be();N(()=>G(Pe,c(u))),k(te,Pe)},$$slots:{default:!0}})},re=Q=>{var te=mc(),le=b(te);le.__click=[hc,g];var Pe=b(le);Ls(Pe,{get expanded(){return c(g)}});var Qe=E(le,2);{var ot=ve=>{var Se=gc(),Ne=b(Se);Ds(Ne),je(3,Se,()=>Ft,()=>({duration:100})),k(ve,Se)};q(Qe,ve=>{Tn(n())||ve(ot)})}var R=E(Qe,2),Y=K(()=>c(f)?"Inactive":"Visible"),_e=K(()=>!n().inactive);Wn(R,{get label(){return c(Y)},get active(){return c(_e)},onclick:ve=>{n(n().inactive=!ve,!0),n(n().manual=!0,!0)},children:(ve,Se)=>{var Ne=Be();N(()=>G(Ne,c(f)?"Inactive":"Visible")),k(ve,Ne)},$$slots:{default:!0}}),N(()=>ue(le,"aria-expanded",c(g))),k(Q,te)};q(J,Q=>{c(d)?Q(ee):Q(re,!1)})}var de=E(J,2);{var Ae=Q=>{var te=pc(),le=E(b(te),2);gi(le,{oninput:()=>n(n().manual=!0,!0),label:"Playlink URL",get value(){return n().playpilot_url},set value(ot){n(n().playpilot_url=ot,!0)}});var Pe=E(le,4),Qe=b(Pe);Xs(Qe,{get linkInjection(){return n()}}),je(3,te,()=>Vt,()=>({duration:100})),k(Q,te)};q(de,Q=>{c(g)&&Q(Ae)})}$t(x,Q=>P(y,Q),()=>c(y)),N(()=>{se(x,"highlighted",c(p)),se(x,"inactive",c(f)),G(O,c(_).title)}),ce("mouseenter",x,()=>w(!0)),ce("mouseleave",x,()=>w(!1)),ce("error",H,({target:Q})=>Q.src=Lr),je(6,x,()=>Vt,()=>({duration:200})),k(e,x),oe()}fe(["click"]);var kc=I('<button class="drag-handle svelte-19mcc5g" aria-label="Move editor"></button>');function bc(e,t){ae(t,!0);let n=L(t,"element",7),i=L(t,"position",23,()=>({x:0,y:0})),r=L(t,"limit",19,()=>({x:0,y:0})),a=L(t,"onchange",3,()=>null),o=!1,s={x:0,y:0},l=i();Ze(()=>{d(i().x,i().y)});function d(v,p){const y=window.innerWidth,w=window.innerHeight,S=n().clientWidth,j=n().clientHeight;v=Math.min(Math.max(v,r().x),y-S-r().x),p=Math.min(Math.max(p,r().y),w-j-r().y),n().style.right=v+"px",n().style.bottom=Math.max(p,r().y)+"px",i({x:v,y:p}),a()(i())}function u(v){var p,y;return{x:v.pageX||((p=v.touches)==null?void 0:p[0].pageX)||0,y:v.pageY||((y=v.touches)==null?void 0:y[0].pageY)||0}}function f(v){o=!0,s=u(v),l=i()}function _(v){if(!o)return;const p=u(v),y=p.x-s.x,w=p.y-s.y,S=l.x-y,j=l.y-w;d(S,j)}function m(){o&&(o=!1)}var g=kc();ce("mousemove",we,_),ce("touchmove",we,_,void 0,!0),ce("mouseup",we,m),ce("touchend",we,m),ce("resize",we,()=>d(i().x,i().y)),g.__mousedown=f,g.__touchstart=f,k(e,g),oe()}fe(["mousedown","touchstart"]);var xc=I('<button class="resize-handle svelte-sxkuxk" aria-label="Move editor"></button>');function Sc(e,t){ae(t,!0);let n=L(t,"element",7),i=L(t,"height",7,200),r=L(t,"onchange",3,()=>null);const a=16;let o=!1,s=0,l=i();Ze(()=>{i()&&d(i())});function d(v){const p=window.getComputedStyle(n()).minHeight||"0",y=Math.max(parseInt(p),Math.min(v,m()));n().style.height=`${y}px`,i(y),r()(y)}function u(v){var p,y;o=!0,s=v.pageY||((y=(p=v.touches)==null?void 0:p[0])==null?void 0:y.pageY)||0,l=n().clientHeight}function f(v){var S,j;if(!o)return;const p=v.pageY||((j=(S=v.touches)==null?void 0:S[0])==null?void 0:j.pageY)||0,y=s-p,w=l+y;d(w)}function _(){o=!1}function m(){const v=window.innerHeight-n().getBoundingClientRect().bottom;return Math.max(window.innerHeight-a*2-v,0)}var g=xc();ce("mousemove",we,f),ce("touchmove",we,f,void 0,!0),ce("mouseup",we,_),ce("touchend",we,_),ce("resize",we,()=>{i()&&d(i())}),g.__mousedown=u,g.__touchstart=u,k(e,g),oe()}fe(["mousedown","touchstart"]);var Ec=Le('<svg width="4" height="8" viewBox="0 0 4 8" fill="none"><path d="M3.5 7L0.5 4L3.5 1" stroke="currentcolor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Tc(e){var t=Ec();k(e,t)}async function Ic(e){const t=new Headers({"Content-Type":"application/json"}),n=In();if(!n)throw new Error("No token was provided");const i=await fetch(Sn+`/search/titles/?api-token=${n}&query=${e}`,{headers:t});if(!i.ok)throw i;return await i.json()}var Ac=Le('<svg viewBox="0 -960 960 960" width="18" height="18"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"></path></svg>');function Pc(e){var t=Ac();k(e,t)}var Cc=I("<div> </div>"),jc=e=>e.stopImmediatePropagation(),Mc=I('<button class="item svelte-rjq94e"><img class="poster svelte-rjq94e" alt="" width="28" height="42"> <div class="content"><div class="name svelte-rjq94e"> </div> <div class="meta svelte-rjq94e"><div class="imdb svelte-rjq94e"><!> </div> <div> </div> <div> </div> <!></div></div> <a target="_blank" class="open-in-new-tab svelte-rjq94e"><!></a></button>');function Vi(e,t){ae(t,!0);const n=L(t,"hoverable",3,!0),i=L(t,"onclick",3,()=>null);var r=Mc();r.__click=function(...x){var T;(T=i())==null||T.apply(this,x)};var a=b(r);N(()=>ue(a,"src",Ut(t.title.standing_poster)));var o=E(a,2),s=b(o),l=b(s),d=E(s,2),u=b(d),f=b(u);Vr(f);var _=E(f),m=E(u,2),g=b(m),v=E(m,2),p=b(v),y=E(v,2);{var w=x=>{var T=Cc(),H=b(T);N(()=>G(H,`${t.title.length??""} min`)),k(x,T)};q(y,x=>{t.title.length&&x(w)})}var S=E(o,2);S.__click=[jc];var j=b(S);Pc(j),N(()=>{se(r,"hoverable",n()),G(l,t.title.title),G(_,` ${t.title.imdb_score??""}`),G(g,t.title.year),G(p,t.title.type),ue(S,"href",`${Mr}/${t.title.type??""}/${t.title.slug??""}`)}),ce("error",a,({target:x})=>x.src=Lr),k(e,r),oe()}fe(["click"]);var Lc=I('<em class="empty svelte-1olb8n0">No results found</em>'),Nc=I('<div class="results svelte-1olb8n0" data-testid="search-results"></div>'),Dc=I('<div class="selected svelte-1olb8n0"><!></div>'),Oc=I('<div class="search svelte-1olb8n0"><!> <!> <!></div>');function Rc(e,t){ae(t,!0);let n=L(t,"onselect",3,()=>null),i=L(t,"query",15),r=U(X([])),a=U(null),o=U(!1);pn(()=>{i()&&s(i())});async function s(v){P(o,!0);try{P(r,X(await Ic(v)))}finally{P(o,!1)}}function l(v){i(v.title),P(a,X(v)),n()(v)}var d=Oc(),u=b(d);gi(u,{oninput:()=>P(a,null),name:"search",label:"Search...",get value(){return i()},set value(v){i(v)}});var f=E(u,2);{var _=v=>{var p=Nc();at(p,21,()=>c(r),y=>y.sid,(y,w)=>{Vi(y,{get title(){return c(w)},onclick:()=>l(c(w))})},y=>{var w=Fe(),S=ne(w);{var j=x=>{var T=Lc();k(x,T)};q(S,x=>{c(o)||x(j)})}k(y,w)}),k(v,p)};q(f,v=>{i()&&!c(a)&&v(_)})}var m=E(f,2);{var g=v=>{var p=Dc(),y=b(p);Vi(y,{get title(){return c(a)},hoverable:!1}),k(v,p)};q(m,v=>{c(a)&&v(g)})}k(e,d),oe()}function qc(e,t=e.anchorNode){if(!e.anchorNode||!t)return{start:-1,end:-1};const n=e.toString().trim(),i=e.toString().search(/\S/);if(e.anchorNode===t&&t.nodeType===Node.TEXT_NODE){const d=Math.min(e.anchorOffset,e.focusOffset)+i;return{start:d,end:d+n.length}}const r=e.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(t),a.setEnd(r.startContainer,r.startOffset);const s=a.toString().length+i,l=s+n.length;return{start:s,end:l}}function Hc(e,t,n,i,r,a,o,s){if(!c(t)||!c(n))return;const l=c(n).type==="movie"?"movie":"show",d=Mr+`/${l}/${c(n).slug}`,u={sid:c(n).sid,title:c(t),sentence:c(i),phrase_before:c(r),phrase_after:c(a),playpilot_url:d,key:ea(c(n).sid),title_details:c(n),manual:!0};o.onsave(u),s()()}var Bc=I('<div class="error svelte-1i8p6op"><!></div>'),Fc=I('<label for="text" class="svelte-1i8p6op">Paired title</label> <!>',1),Vc=I('<section class="layout svelte-1i8p6op"><div class="header svelte-1i8p6op"><!> <div class="heading svelte-1i8p6op">Add Playlink manually</div></div> <p class="svelte-1i8p6op">Highlight the text section in your post that you want to turn into a Playlink.</p> <label for="text" class="svelte-1i8p6op">Selected text</label> <!> <!> <!> <button class="save svelte-1i8p6op">Add playlink</button></section>');function Uc(e,t){ae(t,!0);const n=L(t,"pageText",3,""),i=L(t,"onclose",3,()=>null);let r=U(""),a=U(""),o=U(null),s=U(""),l=U(""),d=U(""),u=U("");Ze(f);function f(){const A=window.getSelection();if(!(A!=null&&A.anchorNode)||A.anchorNode.parentElement&&!St().contains(A.anchorNode.parentElement))return;const O=A.toString().trim();if(!O)return;P(d,""),P(r,X(O));const C=A.getRangeAt(0).cloneContents();if(Array.from(C.childNodes).filter(ee=>{var re;return(re=ee.textContent)==null?void 0:re.trim()}).find(ee=>{var re;return ee.nodeName==="A"||((re=ee.querySelector)==null?void 0:re.call(ee,"a"))})){P(d,"Selection is or contains a link. Injections can not be created around already existing links.");return}P(u,X(c(r)));const{node:D,sentence:z}=_(A,O);if(!D)return;P(a,X(z));const{start:F,end:V}=qc(A,D);(ee=>(P(l,X(ee.before)),P(s,X(ee.after))))(ls(D,F,V)),z.includes(c(l))||P(l,""),z.includes(c(s))||P(s,"");const W=A.getRangeAt(0).commonAncestorContainer.textContent,J=Te(n());(!W||!J.includes(Te(W)))&&P(d,"Selection was not inside of given content")}function _(A,O){const C=A.getRangeAt(0),B=St();let D=C.startContainer;for(;(D.textContent||"").length<=O.length*3&&D.parentNode&&D.parentNode.textContent!==B.textContent;)D=D.parentNode;if(!D||!D.textContent)return{node:null,sentence:""};const z=D.textContent,F=m(D,C.startContainer,C.startOffset),V=m(D,C.endContainer,C.endOffset),W=z.slice(0,F).lastIndexOf("."),J=z.slice(V).match(/[.!?]/),ee=J?V+J.index:z.length,re=W===-1?0:W+1,de=ee,Ae=z.slice(re,de+1).trim();return{node:D,sentence:Ae}}function m(A,O,C){let B=0;const D=A,z=F=>{var V;if(F===O)return B+=C,!0;F.nodeType===Node.TEXT_NODE&&(B+=((V=F.textContent)==null?void 0:V.length)||0);for(let W=F.firstChild;W;W=W.nextSibling)if(z(W))return!0;return!1};return z(D),B}function g(A){var O,C;P(o,X(A)),(C=(O=window.getSelection())==null?void 0:O.removeAllRanges)==null||C.call(O)}var v=Vc();ce("mouseup",we,f);var p=b(v),y=b(p);ci(y,{get onclick(){return i()},size:"24px",children:(A,O)=>{Tc(A)},$$slots:{default:!0}});var w=E(y,2);Qt(w,(A,O)=>xe==null?void 0:xe(A,O),()=>2);var S=E(p,6);gi(S,{get value(){return c(r)},label:"Select text on the page",name:"selected-text",readonly:!0});var j=E(S,2);{var x=A=>{var O=Bc(),C=b(O);ht(C,{children:(B,D)=>{var z=Be();N(()=>G(z,c(d))),k(B,z)},$$slots:{default:!0}}),k(A,O)};q(j,A=>{c(d)&&A(x)})}var T=E(j,2);{var H=A=>{var O=Fc(),C=E(ne(O),2);Ir(C,()=>c(a)+c(r),B=>{Rc(B,{onselect:g,get query(){return c(u)},set query(D){P(u,X(D))}})}),k(A,O)};q(T,A=>{c(d)||A(H)})}var M=E(T,2);M.__click=[Hc,r,o,a,l,s,t,i],N(()=>M.disabled=!c(r)||!c(o)),k(e,v),oe()}fe(["click"]);const Kn="PlayPilotEditorialSessionId",ta=5e3,zc=ta*2;async function Wc(e){const{ai_enabled:t,injections_enabled:n,ai_last_run:i,session_id:r,session_last_ping:a}=await en(e),o=ia(r||null,a||null),s={ai_enabled:t,ai_last_run:i,injections_enabled:n,session_id:r,session_last_ping:a};return o?await na(e):s}async function na(e){const t=ra(),n=new Date(Date.now()).toISOString(),i={session_id:t,session_last_ping:n.toString()},{ai_enabled:r,injections_enabled:a,ai_last_run:o}=await en(e,{params:i});return{ai_enabled:r,ai_last_run:o,injections_enabled:a,...i}}function ia(e,t){if(!e||!t)return!0;const n=Date.now(),i=new Date(t),r=ra();return n-i.getTime()>zc?!0:r===e}function ra(){return sessionStorage.getItem(Kn)||Kc()}function Kc(){const e=sessionStorage.getItem(Kn)||qr();return sessionStorage.setItem(Kn,e),e}function Yc(e,t,n){na(t()),n()()}var Zc=I('<p class="svelte-2m2urs"><strong>Someone else is currently editing this document.</strong> Wait for them to exit the page or take over edit permissions, preventing them from making more changes.</p> <button class="button svelte-2m2urs">Take over editing</button>',1),Gc=I('<div class="alert svelte-2m2urs"><!></div>');function Xc(e,t){ae(t,!0);const n=L(t,"pageText",3,""),i=L(t,"onpoll",3,()=>null),r=L(t,"onallow",3,()=>null),a=L(t,"ondisallow",3,()=>null),o=L(t,"ontakeover",3,()=>null);let s=null,l=U(!0);Ze(()=>(d(),()=>{s&&clearInterval(s)}));function d(){u(),s=setInterval(u,ta)}async function u(){const g=await Wc(n());g&&(P(l,X(ia(g.session_id||null,g.session_last_ping||null))),c(l)?r()():a()(),i()({injectionsEnabled:!!g.injections_enabled,aiEnabled:!!g.ai_enabled}))}var f=Fe(),_=ne(f);{var m=g=>{var v=Gc(),p=b(v);ht(p,{type:"warning",children:(y,w)=>{var S=Zc(),j=E(ne(S),2);j.__click=[Yc,n,o],k(y,S)},$$slots:{default:!0}}),k(g,v)};q(_,g=>{c(l)||g(m)})}k(e,f),oe()}fe(["click"]);var Jc=Le('<svg width="24px" height="24px" viewBox="0 0 64 64" stroke-width="3" stroke="currentColor" fill="none"><circle cx="34.52" cy="11.43" r="5.82"></circle><circle cx="53.63" cy="31.6" r="5.82"></circle><circle cx="34.52" cy="50.57" r="5.82"></circle><circle cx="15.16" cy="42.03" r="5.82"></circle><circle cx="15.16" cy="19.27" r="5.82"></circle><circle cx="34.51" cy="29.27" r="4.7"></circle><line x1="20.17" y1="16.3" x2="28.9" y2="12.93"></line><line x1="38.6" y1="15.59" x2="49.48" y2="27.52"></line><line x1="50.07" y1="36.2" x2="38.67" y2="46.49"></line><line x1="18.36" y1="24.13" x2="30.91" y2="46.01"></line><line x1="20.31" y1="44.74" x2="28.7" y2="48.63"></line><line x1="17.34" y1="36.63" x2="31.37" y2="16.32"></line><line x1="20.52" y1="21.55" x2="30.34" y2="27.1"></line><line x1="39.22" y1="29.8" x2="47.81" y2="30.45"></line><line x1="34.51" y1="33.98" x2="34.52" y2="44.74"></line></svg>');function Qc(e){var t=Jc();k(e,t)}var $c=I('<strong class="svelte-1kpafo0">AI processing is disabled.</strong> Enable AI from the <a href="https://partner.playpilot.net" class="svelte-1kpafo0">Partner Portal</a>',1),eu=I('<span class="svelte-1kpafo0">.</span>'),tu=I(`<strong class="svelte-1kpafo0">AI links are currently processing.</strong> This can take several minutes. We'll insert all found injections once ready. <div class="message svelte-1kpafo0"> <span class="ellipses svelte-1kpafo0"></span></div> <div class="loading-bar svelte-1kpafo0"><div class="loading-bar-progress svelte-1kpafo0"><div class="loading-bar-fill svelte-1kpafo0" data-testid="loading-bar"></div></div> <div class="loading-bar-label svelte-1kpafo0"> </div></div>`,1),nu=(e,t)=>P(t,!0),iu=I('<p class="svelte-1kpafo0"><strong class="svelte-1kpafo0">AI has finished processing.</strong> <br class="svelte-1kpafo0"> <!></p> <button class="dismiss svelte-1kpafo0">Dismiss</button>',1),ru=I('<div class="animator svelte-1kpafo0" data-test-id="animator"></div>'),au=I('<div class="ai-indicator svelte-1kpafo0" data-testid="ai-indicator"><div class="content svelte-1kpafo0"><div class="icon svelte-1kpafo0"><!></div> <div class="svelte-1kpafo0"><!></div></div> <div class="border svelte-1kpafo0"><!></div></div>');function ou(e,t){const n=L(t,"aiRunning",3,!1),i=L(t,"aiEnabled",3,!1),r=L(t,"message",3,""),a=L(t,"percentage",3,0),o=L(t,"aiInjectionsCount",3,0),s=o();let l=U(!1);var d=Fe(),u=ne(d);{var f=_=>{var m=au(),g=b(m),v=b(g),p=b(v);Qc(p);var y=E(v,2),w=b(y);{var S=M=>{var A=$c();k(M,A)},j=M=>{var A=Fe(),O=ne(A);{var C=D=>{var z=tu(),F=E(ne(z),2),V=b(F),W=E(V);at(W,20,()=>({length:3}),xt,(te,le)=>{var Pe=eu();k(te,Pe)});var J=E(F,2),ee=b(J),re=b(ee);const de=K(()=>`${Math.max(a(),3)??""}%`);N(()=>xn(re,"width",c(de)));var Ae=E(ee,2),Q=b(Ae);N(()=>G(Q,`${Math.floor(a())??""}%`)),N(()=>G(V,`${r()??""} `)),k(D,z)},B=D=>{var z=iu(),F=ne(z),V=E(b(F),4);{var W=re=>{var de=Be("No new injections where found.");k(re,de)},J=re=>{var de=Be();N(()=>G(de,`${o()??""} Injections where found and added to the page.`)),k(re,de)};q(V,re=>{s===o()?re(W):re(J,!1)})}var ee=E(F,2);ee.__click=[nu,l],k(D,z)};q(O,D=>{n()?D(C):D(B,!1)},!0)}k(M,A)};q(w,M=>{i()?M(j,!1):M(S)})}var x=E(g,2),T=b(x);{var H=M=>{var A=ru();k(M,A)};q(T,M=>{n()&&M(H)})}N(()=>se(m,"running",n())),k(_,m)};q(u,_=>{c(l)||_(f)})}k(e,d)}fe(["click"]);async function lu(e,t,n,i,r,a,o){try{P(t,!0),P(n,!1),i(await Ps(i(),r())),P(a,X(c(o)))}catch{P(n,!0)}finally{P(t,!1)}}var su=I('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:400,600,700">'),cu=I('<div class="handles svelte-11aj6xq"><div class="handle svelte-11aj6xq"><!></div> <div class="handle svelte-11aj6xq"><!></div></div>'),uu=I('<div class="loading svelte-11aj6xq">Loading...</div>'),du=I('<div class="bubble svelte-11aj6xq"> </div> <!>',1),fu=I(`<strong>Playlinks are currently not published.</strong> Visitors to this page will not see any of the injected links.
12
+ Publish playlinks from the <a href="https://partner.playpilot.net">Partner Portal.</a>`,1),vu=I('<div class="alert svelte-11aj6xq"><!></div>'),_u=I('<div class="error svelte-11aj6xq"><!></div>'),hu=I('<div class="empty svelte-11aj6xq">No links available. Add links manually by clicking the + button and select text to add a link to.</div>'),gu=I('<button class="save svelte-11aj6xq"> </button>'),mu=I('<!> <!> <div class="items svelte-11aj6xq"></div> <!>',1),pu=I("<!> <!> <!>",1),yu=I('<div class="panel playpilot-styled-scrollbar svelte-11aj6xq"><!></div>'),wu=I('<section class="editor playpilot-styled-scrollbar svelte-11aj6xq"><!> <header class="header svelte-11aj6xq"><div class="heading svelte-11aj6xq">Playlinks</div> <!></header> <!> <!></section>');function ku(e,t){ae(t,!0);let n=L(t,"linkInjections",15),i=L(t,"pageText",3,""),r=L(t,"loading",3,!1),a=L(t,"injectionsEnabled",7,!1),o=L(t,"aiStatus",23,()=>({})),s=L(t,"onreinitialize",3,()=>null);const l="editor-position",d="editor-height",u=JSON.parse(localStorage.getItem(l)||'{ "x": 0, "y": 0 }'),f=parseInt(localStorage.getItem(d)||"0");let _=U(null),m=U(!1),g=U(!1),v=U(!1),p=U(!0),y=U(0),w=U("");const S=K(()=>sn(o().aiEnabled,!1)),j=K(()=>sn(o().aiRunning,!1)),x=K(()=>JSON.stringify(n())),T=K(()=>!c(j)&&c(p)),H=K(()=>c(w)&&c(w)!==c(x)),M=K(()=>n().filter(R=>R.title_details&&!R.removed&&!R.duplicate&&(R.manual||!R.manual&&!R.failed))),A=K(()=>C(c(M))),O=K(()=>!r()&&Ke(()=>o().aiRunning));pn(()=>{r()||Ke(()=>{requestAnimationFrame(()=>P(w,X(c(x)))),V()})});function C(R){return R.sort((Y,_e)=>Y.failed!==_e.failed?Y.failed?1:-1:Y.title_details.title.localeCompare(_e.title_details.title))}function B(R,Y){localStorage.setItem(R,Y)}function D(R){const Y=n().findIndex(_e=>_e.key===R);n(n()[Y].manual=!0,!0),n(n()[Y].removed=!0,!0),n([...n()])}function z(R){if(!c(_))return;const Y=R.offsetTop,_e=Y+R.offsetHeight,ve=c(_).scrollTop,Se=ve+c(_).clientHeight;Y>=ve&&_e<=Se||c(_).scrollTo({top:Y-c(_).clientHeight/2,behavior:"smooth"})}function F(R){const Y=R.target;P(y,X(Y.scrollTop))}function V(){const R={total:n().length,failed_automatic:n().filter(Y=>Y.failed&&!Y.manual).length,failed_manual:n().filter(Y=>Y.failed&&Y.manual).length,final_injected:c(M).length};pe(he.TotalInjectionsCount,null,R)}var W=wu();bo(R=>{var Y=su();k(R,Y)});var J=b(W);{var ee=R=>{var Y=cu(),_e=b(Y),ve=b(_e);Sc(ve,{get element(){return c(_)},height:f,onchange:Ge=>B(d,JSON.stringify(Ge))});var Se=E(_e,2),Ne=b(Se);bc(Ne,{get element(){return c(_)},position:u,limit:{x:16,y:16},onchange:Ge=>B(l,JSON.stringify(Ge))}),k(R,Y)};q(J,R=>{c(_)&&!r()&&R(ee)})}var re=E(J,2),de=b(re);Qt(de,R=>xe==null?void 0:xe(R));var Ae=E(de,2);{var Q=R=>{var Y=uu();k(R,Y)},te=R=>{var Y=Fe(),_e=ne(Y);{var ve=Se=>{var Ne=du(),Ge=ne(Ne),De=b(Ge),tn=E(Ge,2);ci(tn,{onclick:()=>P(m,!0),size:"24px","aria-label":"Add manual injection",children:(nn,mi)=>{var rn=Be("+");k(nn,rn)},$$slots:{default:!0}}),N(()=>{ue(Ge,"aria-label",`${c(M).length??""} found playlinks`),G(De,c(M).length)}),k(Se,Ne)};q(_e,Se=>{c(T)&&Se(ve)},!0)}k(R,Y)};q(Ae,R=>{r()?R(Q):R(te,!1)})}var le=E(re,2);{var Pe=R=>{var Y=pu(),_e=ne(Y);Xc(_e,{get pageText(){return i()},onallow:()=>P(p,!0),ondisallow:()=>P(p,!1),get ontakeover(){return s()},onpoll:De=>{a(De.injectionsEnabled),o({...o(),aiEnabled:De.aiEnabled})}});var ve=E(_e,2);{var Se=De=>{ou(De,Zo(o,{get aiInjectionsCount(){return Gr(n()).aiInjections.length}}))};q(ve,De=>{c(p)&&(c(O)||!c(S))&&De(Se)})}var Ne=E(ve,2);{var Ge=De=>{var tn=mu(),nn=ne(tn);{var mi=ge=>{var me=vu(),$e=b(me);ht($e,{type:"warning",children:(lt,sa)=>{var An=fu();k(lt,An)},$$slots:{default:!0}}),k(ge,me)};q(nn,ge=>{a()||ge(mi)})}var rn=E(nn,2);{var aa=ge=>{var me=_u(),$e=b(me);ht($e,{children:(lt,sa)=>{var An=Be("Something went wrong, check your links below.");k(lt,An)},$$slots:{default:!0}}),je(7,me,()=>Vt,()=>({duration:150})),k(ge,me)};q(rn,ge=>{c(v)&&ge(aa)})}var pi=E(rn,2);at(pi,21,()=>c(A),ge=>ge.key,(ge,me)=>{const $e=K(()=>n().findIndex(lt=>lt.key===c(me).key));wc(ge,{onremove:()=>D(c(me).key),onhighlight:z,get linkInjection(){return n()[c($e)]},set linkInjection(lt){n(n()[c($e)]=lt,!0)}})},ge=>{var me=hu();k(ge,me)});var oa=E(pi,2);{var la=ge=>{var me=gu();me.__click=[lu,g,v,n,i,w,x];var $e=b(me);N(()=>{me.disabled=c(g),G($e,c(g)?"Saving...":"Save links")}),je(1,me,()=>Ft,()=>({duration:100})),k(ge,me)};q(oa,ge=>{c(H)&&n().length&&c(p)&&ge(la)})}k(De,tn)};q(Ne,De=>{c(T)&&De(Ge)})}k(R,Y)};q(le,R=>{r()||R(Pe)})}var Qe=E(le,2);{var ot=R=>{var Y=yu(),_e=b(Y);Uc(_e,{get pageText(){return i()},onclose:()=>P(m,!1),onsave:ve=>n().push(ve)}),N(()=>xn(Y,"top",`${c(y)??""}px`)),je(3,Y,()=>En,()=>({x:Math.min(window.innerWidth,320),duration:200,opacity:1})),k(R,Y)};q(Qe,R=>{c(m)&&R(ot)})}$t(W,R=>P(_,R),()=>c(_)),N(()=>{se(W,"panel-open",c(m)),se(W,"loading",r())}),ce("scroll",W,F),k(e,W),oe()}fe(["click"]);var bu=Le('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 57.48 62.96"><defs><style>.playpilot-logo{fill:url(#playpilot-linear-gradient);}</style><linearGradient id="playpilot-linear-gradient" x1="-90.03" y1="-40.23" x2="-34.8" y2="-101.48" gradientTransform="translate(74.02 108.65)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#de00b9"></stop><stop offset="0.99" stop-color="#ff557b"></stop></linearGradient></defs><path class="playpilot-logo" d="M57.48,31.48C57.48,22.17,20.85,2.19,9.2.18,7.42-.12,3.78-.37,1.36,2.25-4.32,8.39,9.62,21.5,9.62,31.48S-4.32,54.57,1.36,60.72c2.42,2.61,6.06,2.37,7.84,2.06C20.85,60.78,57.48,40.79,57.48,31.48Z"></path></svg>');function xu(e){var t=bu();k(e,t)}var Su=I('<div class="trigger svelte-qee95d"><button type="button" class="button svelte-qee95d" title="Show PlayPilot TPI editor"><!></button> <button type="button" class="button close svelte-qee95d" title="Close PlayPilot TPI"><!></button></div>');function Eu(e,t){var n=Su(),i=b(n);i.__click=function(...s){var l;(l=t.onclick)==null||l.apply(this,s)};var r=b(i);xu(r);var a=E(i,2);a.__click=function(...s){var l;(l=t.onclose)==null||l.apply(this,s)};var o=b(a);Br(o),k(e,n)}fe(["click"]);var Tu=I('<div class="playpilot-link-injections svelte-13rmd3g" data-playpilot-link-injections=""><!> <!></div>');function Iu(e,t){ae(t,!0);let n=U(null),i=U(X([])),r=U(null),a=U(X(Rr())),o=U(!!li()),s=U(!1),l=U(!0),d=U(!0),u=U(X([]));const f=K(()=>c(r)||{}),_=K(()=>sn(c(f).ai_injections,()=>[],!0)),m=K(()=>sn(c(f).manual_injections,()=>[],!0)),g=K(()=>Kr(c(i)));pn(()=>{c(a)&&!c(l)&&p()}),Ze(()=>{if(!js())return(async()=>(await v(),pe(he.ArticlePageView)))(),()=>vi()});async function v(){P(l,!0),c(a)&&P(s,X(await Or()));try{const C=await Cs(),B=ai();if(P(d,!!(C!=null&&C.exclude_urls_pattern&&B.match(new RegExp(C.exclude_urls_pattern)))),c(d))return;C!=null&&C.custom_style&&x(C.custom_style||""),S((C==null?void 0:C.html_selector)||"",(C==null?void 0:C.exclude_elements_selector)||"")}catch(C){pe(he.FetchingConfigFailed),console.error("TPI Config failed to fetch",C);return}try{if(P(r,X(await Hi(c(g),{maxTries:1,runAiWhenRelevant:!0}))),P(l,!1),!c(r))return;if(el({organizationSid:c(r).organization_sid,domainSid:c(r).domain_sid}),!c(r).ai_running||!c(r).ai_enabled){w({aiInjections:c(_),manualInjections:c(m)});return}if(!c(a))return;P(r,X(await Hi(c(g),{requireCompletedResult:!0,onpoll:C=>P(r,X(C))}))),w({aiInjections:c(_),manualInjections:c(m)})}catch(C){console.error(C),pe(he.InjectionError,null,{message:C.message})}}function p(){w(Gr(c(u)))}function y(){P(a,!1),requestAnimationFrame(()=>{P(a,!0),v()})}function w(C={aiInjections:c(_),manualInjections:c(m)}){const B=vs(c(i),C);JSON.stringify(B)!==JSON.stringify(c(u))&&P(u,X(B));const D=B.filter(z=>!z.failed);D.length&&(c(a)||pe(he.ArticleInjected,null,{manual:D.filter(z=>z.manual).length,ai:D.filter(z=>!z.manual).length}))}function S(C,B){C&&(window.PlayPilotLinkInjections.selector=C),P(n,X(St())),P(i,X(fi(c(n),B)))}function j(){P(a,!0),il(),v()}function x(C){const B="playpilot-custom-style",D=document.getElementById(B),z=D||document.createElement("style");z.textContent=`[data-playpilot-link-injections] { ${C} }`,z.id=B,D||document.body.appendChild(z)}var T=Tu(),H=b(T);{var M=C=>{Eu(C,{onclick:j,onclose:()=>{P(o,!1),nl()}})};q(H,C=>{!c(d)&&c(o)&&!c(a)&&C(M)})}var A=E(H,2);{var O=C=>{var B=Fe(),D=ne(B);Go(D,{onerror:F=>pe(he.EditorError,null,{message:F.message}),failed:F=>{ht(F,{fixed:!0,children:(V,W)=>{var J=Be("An error has occured in the PlayPilot Linkinjections editor view. We've been notified and will investigate!");k(V,J)},$$slots:{default:!0}})}},F=>{var V=K(()=>{var J;return(J=c(r))==null?void 0:J.injections_enabled}),W=K(()=>{var J,ee,re,de,Ae;return{aiEnabled:(J=c(r))==null?void 0:J.ai_enabled,aiRunning:((ee=c(r))==null?void 0:ee.ai_running)&&((re=c(r))==null?void 0:re.ai_enabled),message:(de=c(r))==null?void 0:de.ai_progress_message,percentage:(Ae=c(r))==null?void 0:Ae.ai_progress_percentage}});ku(F,{get pageText(){return c(g)},get loading(){return c(l)},onreinitialize:y,get injectionsEnabled(){return c(V)},get aiStatus(){return c(W)},get linkInjections(){return c(u)},set linkInjections(J){P(u,X(J))}})}),k(C,B)};q(A,C=>{!c(d)&&c(a)&&c(s)&&C(O)})}k(e,T),oe()}window.PlayPilotLinkInjections={token:"",editorial_token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,last_successful_fetch:null,tracked_events:[],app:null,initialize(e={token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,editorial_token:""}){if(!e.token){console.error("An API token is required.");return}this.token=e.token,this.editorial_token=e.editorial_token,this.selector=e.selector,this.after_article_selector=e.after_article_selector,this.after_article_insert_position=e.after_article_insert_position,this.language=e.language,this.organization_sid=e.organization_sid,this.domain_sid=e.domain_sid,this.app&&this.destroy();const t=document.createElement("div");t.id="playpilot-link-injection",document.body.insertAdjacentElement("beforeend",t),this.app=Jt(Iu,{target:t})},destroy(){if(!this.app)return;this.app=null;const e=document.getElementById("playpilot-link-injection");e&&e.remove(),vi()},debug(){const e=St(),t=fi(e);console.group("PlayPilot Link Injection Debug"),console.groupCollapsed("Config"),console.table(Object.entries(this)),console.groupEnd(),console.groupCollapsed("Elements"),console.log("Parent element",e),console.log("Valid elements",t),console.groupEnd(),console.groupCollapsed("Last fetch"),console.log(this.last_successful_fetch),console.groupEnd(),console.groupCollapsed("Meta"),console.log(_i()),console.groupEnd(),console.groupCollapsed("Page text"),console.log(Kr(t)),console.groupEnd(),console.groupCollapsed("Tracked events"),console.log(this.tracked_events),console.groupEnd(),console.groupEnd()}};
13
13
 
14
14
  })();
package/events.md ADDED
@@ -0,0 +1,60 @@
1
+ This document highlights the purpose of each tracking event.
2
+
3
+ ## Payload
4
+
5
+ All events share a common payload:
6
+
7
+ - `url`: The URL of the related article. This is a URL with only the protocol, base url, and pathname. No parameters are included
8
+ - `organization_sid`: The sid for the related organization
9
+ - `domain_sid`: The sid for the related domain
10
+
11
+ Events related to titles share an additional set of data (referred to below as `Title`):
12
+
13
+ - `original_title`
14
+ - `title_sid`
15
+ - `title_type`: "movie" or "series"
16
+ - `providers`: An array of provider names
17
+
18
+ Events may have additional data in their payload.
19
+
20
+ ### General
21
+ Event | Action | Info | Payload
22
+ --- | --- | --- | ---
23
+ `ali_article_page_view` | _Fires any time an article is visited_ | This event will fire right after all data is fetched and will fire regardless of if there are injections or not | It will fire even on pages where injections are disabled. | -
24
+ `ali_links_injected` | _Fires as long as any injections are injected into the article_ | Includes an object with the number of injections for this article with `manual` and `ai` as two separate numbers. | `manual` (number of manual injection), `ai` (number of ai injections)
25
+
26
+ ### Modal
27
+ Event | Action | Info | Payload
28
+ --- | --- | --- | ---
29
+ `ali_title_modal_view` | _Fires any time a title modal is viewed_ | The title modal opens when clicking an injection both on desktop and mobile | `Title`
30
+ `ali_title_modal_scroll` | _Fires the first time a user scrolls inside of a titel modal._ | | `Title`
31
+ `ali_title_modal_playlink_click` | _Fires any time a playlink is clicked inside of a title modal_ | Includes data on which playlink was clicked. | `Title`, `playlink` (name of the clicked playlink)
32
+ `ali_title_modal_save_click` | _Currently unused, there is no save functionality._ | | `Title`
33
+
34
+ ### Popover
35
+ Event | Action | Info | Payload
36
+ --- | --- | --- | ---
37
+ `ali_title_popover_view` | _Fires any time a title popover is viewed_ | The title popover opens when hovering an injection. This will only occur on desktop. | `Title`
38
+ `ali_title_popover_save_click` | _Currently unused, there is no save functionality._ | | `Title`
39
+ `ali_title_popover_playlink_click` | _Fires any time a playlink is clicked inside of a title popover_ | Includes data on which playlink was clicked. | `Title`, `playlink` (name of the clicked playlink)
40
+
41
+ ### After Article
42
+ Event | Action | Info | Payload
43
+ --- | --- | --- | ---
44
+ `ali_after_article_playlink_click` | _Fires any time a playlink is clicked inside of an after article block_ | This block will only appear injections are configured for after article, which no one is currently using. Includes data on which playlink was clicked. | `Title`, `playlink` (name of the clicked playlink)
45
+ `ali_after_article_modal_button_click` | _Fires any time an after article modal button is clicked_ | This button will only appear in after article blocks when configured, which, which no one is currently using | `Title`
46
+
47
+ ### Data
48
+ Event | Action | Info | Payload
49
+ --- | --- | --- | ---
50
+ `ali_injection_failed` | _Fires only inside of the Editor for each injection that failed_ | Only includes visible failures, for instance, it will ignore failures because of already existing links. If a user is shown a message about a failed injection, this event will fire. Includes data on the phrase and sentence for the injection. | `Title`, `phrase`, `sentence`
51
+ `ali_injection_count` | _Fires the first time the Editor is shown_ | This logs the total amount of injections, the total amount of failed and manual injections, and the total amount of successful injections. | `total` (number of failed + successsful injections), `failed_automatic`, `failed_manual`, `final_injected` (number of successful injections)
52
+ `ali_fetch_config_failed` | _Fires whenever the config object failed to fetch_ | When this happens, injections are aborted.
53
+ `ali_auth_failed` | _Fires whenever authentication for the Editor fails._
54
+
55
+ ### Reporting
56
+ Event | Action | Info | Payload
57
+ --- | --- | --- | ---
58
+ `ali_manual_report` | _Fires only through manual action when reporting issues with an injection via the Editor._ | | `Title`, `report_reason`, `sid` (of injection), `title` (of injection), `sentence`, `failed` (true or false), `failed_message` (reason for failure as given in the editor), `manual` (true or false)
59
+ `ali_editor_error` | _Fires whenever an error occurs within the Editor._ | | `Title`, `phrase`, `sentence`
60
+ `ali_injection_error` | _Fires whenever an error occurs during injection_ | This includes fetching the injections as well as actually injecting itself. Does not include fetching of the config object. | `message` (error message as given by the browser)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "5.2.1",
3
+ "version": "5.3.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
package/src/lib/api.ts CHANGED
@@ -51,6 +51,9 @@ export async function fetchLinkInjections(
51
51
 
52
52
  const parsed = await response.json()
53
53
 
54
+ // This is used when debugging (using window.PlayPilotLinkInjections.debug())
55
+ window.PlayPilotLinkInjections.last_successful_fetch = parsed
56
+
54
57
  return parsed
55
58
  }
56
59
 
@@ -1,13 +1,16 @@
1
+ /** @see /events.md */
1
2
  export const TrackingEvent = Object.freeze({
2
3
  ArticlePageView: 'ali_article_page_view',
3
4
  ArticleInjected: 'ali_links_injected',
4
5
 
5
6
  TitleModalView: 'ali_title_modal_view',
7
+ TitleModalClose: 'ali_title_modal_close',
6
8
  TitleModalScroll: 'ali_title_modal_scroll',
7
9
  TitleModalPlaylinkClick: 'ali_title_modal_playlink_click',
8
10
  TitleModalSaveClick: 'ali_title_modal_save_click',
9
11
 
10
12
  TitlePopoverView: 'ali_title_popover_view',
13
+ TitlePopoverClose: 'ali_title_popover_close',
11
14
  TitlePopoverSaveClick: 'ali_title_popover_save_click',
12
15
  TitlePopoverPlaylinkClick: 'ali_title_popover_playlink_click',
13
16
 
@@ -103,6 +103,10 @@ export function getLinkInjectionsParentElement(): HTMLElement {
103
103
  return document.querySelector('article') || document.querySelector('main') || document.body
104
104
  }
105
105
 
106
+ export function getPageText(elements: HTMLElement[]): string {
107
+ return elements.map(element => element.innerText).join('\n\n')
108
+ }
109
+
106
110
  /**
107
111
  * Replace all found injections within all given elements on the page
108
112
  * @returns Returns an array of injections with injections that failed to be inserted marked as `failed`.
@@ -36,6 +36,14 @@ export async function track(event: string, title: TitleData | null = null, paylo
36
36
  source: 'ali',
37
37
  })),
38
38
  })
39
+
40
+ pushEventToWindow({ event, payload })
41
+ }
42
+
43
+ /** Save this event to the window object. Used when calling .debug() */
44
+ function pushEventToWindow(data: { event: string, payload: Record<string, any> }) {
45
+ if (!window.PlayPilotLinkInjections.tracked_events) window.PlayPilotLinkInjections.tracked_events = []
46
+ window.PlayPilotLinkInjections.tracked_events?.push(data)
39
47
  }
40
48
 
41
49
  /**
@@ -6,6 +6,7 @@ declare global {
6
6
  app: any | null
7
7
  initialize(config: ScriptConfig): void
8
8
  destroy(): void
9
+ debug(): void
9
10
  }
10
11
  }
11
12
  }
@@ -7,4 +7,6 @@ export type ScriptConfig = {
7
7
  after_article_selector?: string
8
8
  after_article_insert_position?: InsertPosition | ''
9
9
  language?: string | null
10
+ last_successful_fetch?: LinkInjectionResponse | null
11
+ tracked_events?: { event: string, payload: Record<string, any> }[]
10
12
  }
@@ -8,7 +8,7 @@ export type TitleData = {
8
8
  genres: string[]
9
9
  year: number
10
10
  imdb_score: number
11
- type: string
11
+ type: 'movie' | 'series'
12
12
  providers: PlaylinkData[]
13
13
  description: string
14
14
  small_poster: string
package/src/main.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { mount } from 'svelte'
2
2
  import App from './routes/+page.svelte'
3
- import { clearLinkInjections } from '$lib/linkInjection'
3
+ import { clearLinkInjections, getLinkInjectionElements, getLinkInjectionsParentElement, getPageText } from '$lib/linkInjection'
4
+ import { getPageMetaData } from '$lib/meta'
4
5
 
5
6
  window.PlayPilotLinkInjections = {
6
7
  token: '',
@@ -11,6 +12,8 @@ window.PlayPilotLinkInjections = {
11
12
  language: null,
12
13
  organization_sid: null,
13
14
  domain_sid: null,
15
+ last_successful_fetch: null,
16
+ tracked_events: [],
14
17
  app: null,
15
18
 
16
19
  initialize(config = { token: '', selector: '', after_article_selector: '', after_article_insert_position: '', language: null, organization_sid: null, domain_sid: null, editorial_token: '' }): void {
@@ -48,6 +51,38 @@ window.PlayPilotLinkInjections = {
48
51
 
49
52
  clearLinkInjections()
50
53
  },
54
+
55
+ debug(): void {
56
+ const parentElement = getLinkInjectionsParentElement()
57
+ const elements = getLinkInjectionElements(parentElement)
58
+
59
+ console.group('PlayPilot Link Injection Debug')
60
+ console.groupCollapsed('Config')
61
+ console.table(Object.entries(this))
62
+ console.groupEnd()
63
+
64
+ console.groupCollapsed('Elements')
65
+ console.log('Parent element', parentElement)
66
+ console.log('Valid elements', elements)
67
+ console.groupEnd()
68
+
69
+ console.groupCollapsed('Last fetch')
70
+ console.log(this.last_successful_fetch)
71
+ console.groupEnd()
72
+
73
+ console.groupCollapsed('Meta')
74
+ console.log(getPageMetaData())
75
+ console.groupEnd()
76
+
77
+ console.groupCollapsed('Page text')
78
+ console.log(getPageText(elements))
79
+ console.groupEnd()
80
+
81
+ console.groupCollapsed('Tracked events')
82
+ console.log(this.tracked_events)
83
+ console.groupEnd()
84
+ console.groupEnd()
85
+ }
51
86
  }
52
87
 
53
88
  export default window.PlayPilotLinkInjections
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { onMount } from 'svelte'
3
3
  import { fetchConfig, pollLinkInjections } from '$lib/api'
4
- import { clearLinkInjections, getLinkInjectionElements, getLinkInjectionsParentElement, injectLinksInDocument, separateLinkInjectionTypes } from '$lib/linkInjection'
4
+ import { clearLinkInjections, getLinkInjectionElements, getLinkInjectionsParentElement, getPageText, injectLinksInDocument, separateLinkInjectionTypes } from '$lib/linkInjection'
5
5
  import { setTrackingSids, track } from '$lib/tracking'
6
6
  import { getFullUrlPath } from '$lib/url'
7
7
  import { isCrawler } from '$lib/crawler'
@@ -26,7 +26,7 @@
26
26
  // @ts-ignore It's ok if the response is empty
27
27
  const { ai_injections: aiInjections = [], manual_injections: manualInjections = [] } = $derived(response || {})
28
28
 
29
- const pageText = $derived(elements.map(element => element.innerText).join('\n\n'))
29
+ const pageText = $derived(getPageText(elements))
30
30
 
31
31
  // Rerender link injections when linkInjections change. This is only relevant for editiorial mode.
32
32
  $effect(() => {
@@ -2,6 +2,7 @@
2
2
  import { TrackingEvent } from '$lib/enums/TrackingEvent'
3
3
  import { track } from '$lib/tracking'
4
4
  import type { TitleData } from '$lib/types/title'
5
+ import { onMount } from 'svelte'
5
6
  import Modal from './Modal.svelte'
6
7
  import Title from './Title.svelte'
7
8
 
@@ -16,6 +17,11 @@
16
17
 
17
18
  let hasTrackedScrolling = false
18
19
 
20
+ onMount(() => {
21
+ const openTimestamp = Date.now()
22
+ return () => track(TrackingEvent.TitleModalClose, title, { time_spent: Date.now() - openTimestamp })
23
+ })
24
+
19
25
  function onscroll(): void {
20
26
  if (hasTrackedScrolling) return
21
27
 
@@ -18,7 +18,12 @@
18
18
 
19
19
  track(TrackingEvent.TitlePopoverView, title)
20
20
 
21
- onMount(setOffset)
21
+ onMount(() => {
22
+ setOffset()
23
+
24
+ const openTimestamp = Date.now()
25
+ return () => track(TrackingEvent.TitlePopoverClose, title, { time_spent: Date.now() - openTimestamp })
26
+ })
22
27
 
23
28
  /**
24
29
  * An element can be split up over multiple lines, giving it multiple ClientRects.
@@ -1,5 +1,5 @@
1
1
  import { fireEvent, render } from '@testing-library/svelte'
2
- import { describe, expect, it, vi, beforeEach } from 'vitest'
2
+ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
3
3
 
4
4
  import TitleModal from '../../../routes/components/TitleModal.svelte'
5
5
  import { title } from '$lib/fakeData'
@@ -15,6 +15,10 @@ describe('TitleModal.svelte', () => {
15
15
  vi.resetAllMocks()
16
16
  })
17
17
 
18
+ afterEach(() => {
19
+ vi.useRealTimers()
20
+ })
21
+
18
22
  const onclose = vi.fn()
19
23
 
20
24
  it('Should call track function when rendered', () => {
@@ -30,4 +34,15 @@ describe('TitleModal.svelte', () => {
30
34
 
31
35
  expect(track).toHaveBeenCalledWith(TrackingEvent.TitleModalScroll, title)
32
36
  })
37
+
38
+ it('Should call track function with time_spent when destroyed', async () => {
39
+ vi.useFakeTimers()
40
+
41
+ const { unmount } = render(TitleModal, { onclose, title })
42
+
43
+ vi.advanceTimersByTime(200)
44
+ unmount()
45
+
46
+ expect(track).toHaveBeenCalledWith(TrackingEvent.TitleModalClose, title, { time_spent: 200 })
47
+ })
33
48
  })
@@ -1,5 +1,5 @@
1
1
  import { render } from '@testing-library/svelte'
2
- import { describe, expect, it, vi, beforeEach } from 'vitest'
2
+ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
3
3
 
4
4
  import TitlePopover from '../../../routes/components/TitlePopover.svelte'
5
5
  import { title } from '$lib/fakeData'
@@ -15,10 +15,26 @@ describe('TitlePopover.svelte', () => {
15
15
  vi.resetAllMocks()
16
16
  })
17
17
 
18
+ afterEach(() => {
19
+ vi.useRealTimers()
20
+ })
21
+
18
22
  it('Should call track function when rendered', () => {
19
23
  const event = new MouseEvent('mouseenter')
20
24
  render(TitlePopover, { event, title })
21
25
 
22
26
  expect(track).toHaveBeenCalledWith(TrackingEvent.TitlePopoverView, title)
23
27
  })
28
+
29
+ it('Should call track function with time_spent when destroyed', async () => {
30
+ vi.useFakeTimers()
31
+
32
+ const event = new MouseEvent('mouseenter')
33
+ const { unmount } = render(TitlePopover, { event, title })
34
+
35
+ vi.advanceTimersByTime(200)
36
+ unmount()
37
+
38
+ expect(track).toHaveBeenCalledWith(TrackingEvent.TitlePopoverClose, title, { time_spent: 200 })
39
+ })
24
40
  })