HEX
Server: Apache/2.4.41
System: Linux mainweb 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: nationalmedicaregrp (1119)
PHP: 8.3.7
Disabled: exec,passthru,shell_exec,system,popen,proc_open,pcntl_exec
Upload Files
File: /home/dv-pro/public_html/wp-content/plugins/simply-static/src/admin/build/reactPlayerTiktok.js
"use strict";(globalThis.webpackChunksimplystatic_settings=globalThis.webpackChunksimplystatic_settings||[]).push([[85],{188:(e,t,o)=>{o.r(t),o.d(t,{default:()=>w});var s=o(609);const n="https://www.tiktok.com/player/v1",i=/tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/,r={INIT:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3},a={[r.INIT]:"emptied",[r.PAUSED]:"pause",[r.ENDED]:"ended",[r.PLAYING]:"play",[r.BUFFERING]:"waiting"};function l(e,t={}){const o={src:u(e,t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture"};return t.config&&(o["data-config"]=JSON.stringify(t.config)),`\n    <style>\n      :host {\n        display:inline-block;\n        min-width: 300px;\n        min-height: 150px;\n        position: relative;\n      }\n      iframe {\n        position:absolute;\n        top:0;\n        left:0;\n        width:100%;\n        height:100%;\n        border:0;\n      }\n    </style>\n    <iframe ${function(e){let t="";for(const o in e){const s=e[o];t+=""===s?` ${h(o)}`:` ${h(o)}="${h(`${s}`)}"`}return t}(o)} title="TikTok video"></iframe>\n  `}function u(e,t={}){if(!e.src)return;const o=e.src.match(i),s=o&&o[1],r={controls:""===e.controls?null:0,autoplay:e.autoplay,muted:e.muted,loop:e.loop,rel:0,...t.config};return`${n}/${s}?${function(e){return String(new URLSearchParams(function(e){let t={};for(let o in e){let s=e[o];!0===s||""===s?t[o]=1:!1===s?t[o]=0:null!=s&&(t[o]=s)}return t}(e)))}(r)}`}class c extends(globalThis.HTMLElement??class{}){static getTemplateHTML=l;static shadowRootOptions={mode:"open"};static get observedAttributes(){return["src","controls","loop","autoplay","muted"]}loadComplete=new d;#e;#t;#o=!1;#s=0;#n=!0;#i=null;#r=100;#a=0;#l;constructor(){super(),this.#u("config")}async load(){if(this.#e)return;this.shadowRoot||this.attachShadow(c.shadowRootOptions);const e=!this.#t;if(this.#t&&(this.loadComplete=new d),this.#t=!0,await(this.#e=Promise.resolve()),this.#e=null,this.#s=0,this.#o=!1,this.#n=!0,!this.src)return this.shadowRoot.innerHTML="",void globalThis.removeEventListener("message",this.#c);let t=this.shadowRoot.querySelector("iframe");const o=function(e){let t={};for(let o of e)t[o.name]=o.value;return t}(this.attributes);e&&t&&(this.#i=JSON.parse(t.getAttribute("data-config")||"{}")),(null==t?void 0:t.src)&&t.src===u(o,this)||(this.shadowRoot.innerHTML=l(o,this),t=this.shadowRoot.querySelector("iframe")),this.#l=t,globalThis.addEventListener("message",this.#c)}async attributeChangedCallback(e,t,o){if(t!==o)switch(e){case"muted":await this.loadComplete,this.muted=null!=o;break;case"autoplay":case"controls":case"loop":case"src":return void this.load()}}get config(){return this.#i}set config(e){this.#i=e}#c=e=>{var t;if(e.source!==(null==(t=this.#l)?void 0:t.contentWindow))return;const o=e.data;if(null==o?void 0:o["x-tiktok-player"])switch(o.type){case"onPlayerReady":this.loadComplete.resolve();break;case"onStateChange":{this.#n=[r.INIT,r.PAUSED,r.ENDED].includes(o.value);const e=a[o.value];e&&this.dispatchEvent(new Event(e));break}case"onCurrentTime":this.#s=o.value.currentTime,this.#a=o.value.duration,this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("timeupdate"));break;case"onVolumeChange":this.#r=o.value,this.dispatchEvent(new Event("volumechange"));break;case"onMute":this.#o=!!o.value,this.#r=o.value?0:this.#r,this.dispatchEvent(new Event("volumechange"));break;case"onError":this.dispatchEvent(new Event("error"));break;default:console.warn("Unhandled TikTok player message:",o)}};#d(e,t){var o;if(!(null==(o=this.#l)?void 0:o.contentWindow))return;const s={"x-tiktok-player":!0,type:e,...void 0!==t?{value:t}:{}};this.#l.contentWindow.postMessage(s,"*")}async play(){await this.loadComplete,this.#d("play")}async pause(){await this.loadComplete,this.#d("pause")}async#h(e){await this.loadComplete,this.#d("seekTo",Number(e))}async#p(){await this.loadComplete,this.#d("mute")}async#m(){await this.loadComplete,this.#d("unMute")}get volume(){return this.#r/100}set volume(e){console.warn("Volume control is not supported for TikTok videos.")}get currentTime(){return this.#s}set currentTime(e){this.#h(e)}get muted(){return this.#o}set muted(e){this.#o=e,e?this.#p():this.#m()}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(e){this.toggleAttribute("muted",!!e)}get paused(){return this.#n}get duration(){return this.#a}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e??"")}#u(e){if(Object.prototype.hasOwnProperty.call(this,e)){const t=this[e];delete this[e],this[e]=t}}}class d extends Promise{constructor(e=()=>{}){let t,o;super(((s,n)=>{e(s,n),t=s,o=n})),this.resolve=t,this.reject=o}}function h(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/`/g,"&#x60;")}globalThis.customElements&&!globalThis.customElements.get("tiktok-video")&&globalThis.customElements.define("tiktok-video",c);var p=c,m=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),f={className:"class",htmlFor:"for"};function v(e){return e.toLowerCase()}function g(e){return"boolean"==typeof e?e?"":void 0:"function"==typeof e||"object"==typeof e&&null!==e?void 0:e}function y(e,t,o){var s;e[t]=o,null==o&&t in((null==(s=globalThis.HTMLElement)?void 0:s.prototype)??{})&&e.removeAttribute(t)}var w=function({react:e,tagName:t,elementClass:o,events:s,displayName:n,defaultProps:i,toAttributeName:r=v,toAttributeValue:a=g}){const l=Number.parseInt(e.version)>=19,u=e.forwardRef(((n,u)=>{var c,d;const h=e.useRef(null),p=e.useRef(new Map),v={},w={},b={},T={};for(const[e,t]of Object.entries(n)){if(m.has(e)){b[e]=t;continue}const s=r(f[e]??e);if(o.prototype&&e in o.prototype&&!(e in((null==(c=globalThis.HTMLElement)?void 0:c.prototype)??{}))&&!(null==(d=o.observedAttributes)?void 0:d.some((e=>e===s)))){T[e]=t;continue}if(e.startsWith("on")){v[e]=t;continue}const n=a(t);if(s&&null!=n&&(w[s]=String(n),l||(b[s]=n)),s&&l){const e=g(t);b[s]=n!==e?n:t}}if("undefined"!=typeof window){for(const t in v){const o=v[t],n=t.endsWith("Capture"),i=((null==s?void 0:s[t])??t.slice(2).toLowerCase()).slice(0,n?-7:void 0);e.useLayoutEffect((()=>{const e=null==h?void 0:h.current;if(e&&"function"==typeof o)return e.addEventListener(i,o,n),()=>{e.removeEventListener(i,o,n)}}),[null==h?void 0:h.current,o])}e.useLayoutEffect((()=>{if(null===h.current)return;const e=new Map;for(const t in T)y(h.current,t,T[t]),p.current.delete(t),e.set(t,T[t]);for(const[e,t]of p.current)y(h.current,e,void 0);p.current=e}))}if("undefined"==typeof window&&(null==o?void 0:o.getTemplateHTML)&&(null==o?void 0:o.shadowRootOptions)){const{mode:t,delegatesFocus:s}=o.shadowRootOptions,i=e.createElement("template",{shadowrootmode:t,shadowrootdelegatesfocus:s,dangerouslySetInnerHTML:{__html:o.getTemplateHTML(w,n)}});b.children=[i,b.children]}return e.createElement(t,{...i,...b,ref:e.useCallback((e=>{h.current=e,"function"==typeof u?u(e):null!==u&&(u.current=e)}),[u])})}));return u.displayName=n??o.name,u}({react:s,tagName:"tiktok-video",elementClass:p,toAttributeName:e=>"muted"===e?"":"defaultMuted"===e?"muted":v(e)})}}]);