Sindbad~EG File Manager
(()=>{var e={942:(e,t)=>{var n;!function(){"use strict";var s={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=l(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)s.call(e,n)&&e[n]&&(t=l(t,n));return t}function l(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(s){var o=t[s];if(void 0!==o)return o.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s),n.d(s,{CheckboxField:()=>o,ColorField:()=>r,CustomSelectField:()=>d,DateField:()=>m,Field:()=>j,FieldContextProvider:()=>R,Fields:()=>b,FieldsContext:()=>B,HtmlField:()=>_,MeasureField:()=>C,MulticheckField:()=>w,NumberField:()=>S,ObjectSelectField:()=>T,RadioField:()=>M,RangeSliderField:()=>N,SelectField:()=>H,TextAreaField:()=>E,TextField:()=>I,TokenSelectField:()=>P,useFields:()=>z});const e=window.wp.components,t=window.ReactJSXRuntime,o=({value:n,onChange:s,label:o,...r})=>(0,t.jsx)(e.CheckboxControl,{...r,label:o,checked:n,onChange:s,__nextHasNoMarginBottom:!0}),r=({value:n="",onChange:s,...o})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.ColorIndicator,{colorValue:n}),(0,t.jsx)(e.ColorPicker,{...o,color:n,onChangeComplete:e=>{var t;return s(null!==(t=e?.hex)&&void 0!==t?t:e)}}),(0,t.jsx)(e.ColorPalette,{value:n,onChange:e=>{s(null!=e?e:"")},colors:[{name:"red",color:"#f00"},{name:"white",color:"#fff"},{name:"blue",color:"#00f"}],clearable:!0})]}),l=window.wp.element,a=window.popupMaker.i18n,i=window.wp.compose,c=window.wp.htmlEntities,u=window.popupMaker.components,p=window.popupMaker.coreData,d=({label:e,value:n,onChange:s,entityType:o,multiple:r=!1,apiEndpoint:d="popup-maker/v2/object-search"})=>{const[m,g]=(0,l.useState)(""),[y,v]=(0,l.useState)({prefill:[],suggestions:[]}),[x,h]=(0,l.useState)(!1),f=(0,i.useDebounce)(e=>{g(e)},300);(0,l.useEffect)(()=>{(async()=>{h(!0);try{let e=`${d}?object_type=custom_entity&entity_type=${o}`;n&&(e+=`&include=${(Array.isArray(n)?n:[n]).join(",")}`),m&&(e+=`&s=${m}`);const t=(await(0,p.fetchFromWPApi)(e)).items.map(e=>({id:e.id,text:e.text}));let s=[];if(n){const e=Array.isArray(n)?n:[n];s=t.filter(t=>e.includes(t.id))}v({prefill:s,suggestions:t})}catch(e){v({prefill:[],suggestions:[]})}finally{h(!1)}})()},[n,m,o,d]);const j=e=>{const t=t=>t.find(t=>t.id===e);return t(y.suggestions)||t(y.prefill)},b=n?"string"==typeof n?[n]:n:[],_=e=>"object"==typeof e?e.value:e;return(0,t.jsx)("div",{className:"pum-custom-entity-select-field",children:(0,t.jsx)(u.SmartTokenControl,{label:e||(0,a.sprintf)(
// translators: %s: entity type.
// translators: %s: entity type.
(0,a.__)("%s(s)","popup-maker"),o.replace(/_/g," ").charAt(0).toUpperCase()+o.replace(/_/g," ").slice(1)),hideLabelFromVision:!0,multiple:r,placeholder:(0,a.sprintf)(
// translators: %s: entity type.
// translators: %s: entity type.
(0,a.__)("Select %s(s)","popup-maker"),o.replace(/_/g," ").toLowerCase()),tokenOnComma:!0,value:b,onInputChange:f,onChange:e=>{const t=e.map(e=>_(e)).filter(e=>null!==e&&""!==e);s(r?t:t[0]||"")},renderToken:e=>{const t=j(_(e));return t?(0,c.decodeEntities)(t.text):_(e)},renderSuggestion:e=>{const n=j(e);return n?(0,t.jsx)(t.Fragment,{children:(0,c.decodeEntities)(n.text)}):e},suggestions:y.suggestions.map(e=>e.id),messages:x?{noSuggestions:(0,a.__)("Searching…","popup-maker")}:void 0})})},m=({value:n,onChange:s,...o})=>(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(e.BaseControl,{...o,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,children:(0,t.jsx)("input",{type:"date",value:n,onChange:e=>s(e.target.value)})})});var g=n(942),y=n.n(g);const v=window.popupMaker.utils,x=e=>"string"==typeof e?e.split(",").map(e=>({label:e,value:e})):Array.isArray(e)||"object"!=typeof e?e.map(e=>"string"==typeof e?{label:e,value:e}:e):Object.entries(e).map(([e,t])=>({label:t,value:e})),h=e=>{var n,s,o,r,l,a,i,c;let u;switch(u=function(e){const t={...e};return!(!t||void 0===t?.std&&void 0===t?.user_roles&&(void 0===t?.type||"userselect"!==t?.type)&&void 0===t?.taxonomy&&void 0===t?.post_type)}(e)?(e=>{var n,s,o,r,l,a,i,c;const u={type:"select2"!==e.type?e.type:"select",default:e.std,id:null!==(n=null!==(s=e.id)&&void 0!==s?s:e.name)&&void 0!==n?n:"",...(0,v.pick)(e,"id","name","label","value","required","dependencies")},p=[];switch(void 0!==e.classes&&("string"==typeof e.classes?p.push(...e.classes.split(" ")):Array.isArray(e.classes)&&p.push(...e.classes)),void 0!==e.class&&p.push(e.class),u.className=y()(p),e.dynamic_desc?u.help=(0,t.jsx)(t.Fragment,{children:e.dynamic_desc}):e.desc&&(u.help=e.desc),u.type){case"checkbox":case"hidden":case"html":case"license_key":return u;case"color":return{...u,default:null!==(o=e.value)&&void 0!==o?o:""};case"customselect":return{...u,entityType:null!==(r=u.entityType)&&void 0!==r?r:"custom"};case"text":case"email":case"tel":case"password":default:return{...u,...u.type===e.type&&{size:e?.size,placeholder:e?.placeholder}};case"radio":case"multicheck":return{...u,options:[],...u.type===e.type&&{options:null!==(l=e.options)&&void 0!==l?l:[]}};case"select":case"multiselect":var d;return u.type!==e.type&&"select2"!==e.type||(u.options=x(null!==(d=e.options)&&void 0!==d?d:[]),u.searchable="select2"===e.type,u.multiple="multiselect"===u.type||e.multiple),{options:[],...u};case"tokenselect":return{value:[],options:{},...u};case"number":case"rangeslider":return{...u,...u.type===e.type&&{size:e?.size,placeholder:e?.placeholder,min:e?.min,max:e?.max,step:e?.step}};case"measure":return{...u,units:{},...u.type===e.type&&{size:e?.size,placeholder:e?.placeholder,min:e?.min,max:e?.max,step:e?.step,units:null!==(a=e?.units)&&void 0!==a?a:{}}};case"objectselect":case"postselect":case"taxonomyselect":case"userselect":var m,g;return u.type="objectselect",u.multiple=null!==(i=e?.multiple)&&void 0!==i&&i,u.placeholder=null!==(c=e?.placeholder)&&void 0!==c?c:"","postselect"===e.type?{...u,entityKind:"postType",entityType:null!==(m=e?.post_type)&&void 0!==m?m:"post"}:"taxonomyselect"===e.type?{...u,entityKind:"taxonomy",entityType:null!==(g=e?.taxonomy)&&void 0!==g?g:"category"}:"userselect"===e.type?{...u,entityKind:"user",entityType:"user"}:{...u,entityKind:"postType",entityType:"post"};case"textarea":return{...u,...u.type===e.type&&{allowHtml:e?.allow_html}}}})(e):e,u.type){case"html":return{...u,content:null!==(n=u.content)&&void 0!==n?n:""};case"checkbox":case"color":case"radio":case"rangeslider":case"number":default:case"email":case"tel":case"hidden":case"text":case"password":case"license_key":case"measure":case"textarea":return{...u};case"customselect":return{...u,entityType:null!==(s=u.entityType)&&void 0!==s?s:"custom"};case"multicheck":return{...u,options:null!==(o=u.options)&&void 0!==o?o:[]};case"select":return{...u,options:null!==(r=u.options)&&void 0!==r?r:[]};case"multiselect":return{...u,options:null!==(l=u.options)&&void 0!==l?l:[],multiple:!0};case"objectselect":case"postselect":case"taxonomyselect":case"userselect":return{...u,entityKind:null!==(a=u.entityKind)&&void 0!==a?a:""};case"tokenselect":return{...u,value:null!==(i=u.value)&&void 0!==i?i:[],options:null!==(c=u.options)&&void 0!==c?c:[]}}},f=e=>{const{type:n}=e;switch(n){case"checkbox":return(0,t.jsx)(o,{...e});case"color":return(0,t.jsx)(r,{...e});case"customselect":return(0,t.jsx)(d,{...e});case"date":return(0,t.jsx)(m,{...e});case"measure":return(0,t.jsx)(C,{...e});case"multicheck":return(0,t.jsx)(w,{...e});case"select":case"multiselect":return(0,t.jsx)(H,{...e});case"objectselect":case"postselect":case"taxonomyselect":case"userselect":return(0,t.jsx)(T,{...e});case"radio":return(0,t.jsx)(M,{...e});case"rangeslider":return(0,t.jsx)(N,{...e});case"number":return(0,t.jsx)(S,{...e});case"email":case"tel":case"hidden":case"text":case"password":return(0,t.jsx)(I,{...e});case"textarea":return(0,t.jsx)(E,{...e});case"tokenselect":return(0,t.jsx)(P,{...e});case"html":return(0,t.jsx)(_,{...e})}return(0,t.jsx)(t.Fragment,{children:(0,a.sprintf)(/* translators: 1. type of field not found. */ /* translators: 1. type of field not found. */
(0,a.__)("Field type `%s` not found","popup-maker"),n)})},j=e=>{const{type:n,className:s,onChange:o}=e;return(0,t.jsx)("div",{className:y()(["pum-field",`pum-field--${n}`,s]),children:(0,t.jsx)(f,{onChange:o,...h(e)})})},b=e=>{const{fields:n}=e;return(0,t.jsx)(t.Fragment,{children:n.map((e,n)=>(0,t.jsx)(j,{...e},n))})},_=({content:e})=>(0,t.jsx)("div",{dangerouslySetInnerHTML:{__html:null!=e?e:""}}),C=({value:n,onChange:s,units:o,...r})=>{var a;const i=n?parseInt(n):"",[c,u]=(0,l.useState)({number:i,unit:null!==(a=n?.replace(`${i}`,""))&&void 0!==a?a:""});(0,l.useEffect)(()=>{s(`${c.number}${c.unit}`)},[c,s]);const p=Object.entries(o).map(([e,t])=>({value:e,label:t}));return(0,t.jsx)(e.__experimentalUnitControl,{...r,value:n,onChange:(e="0")=>u({...c,number:e}),disableUnits:0===p.length,units:p,onUnitChange:(e="")=>u({...c,unit:e}),__nextHasNoMarginBottom:!0})},w=({value:n,onChange:s,...o})=>{const r=null!=n?n:[],l=x(o.options),a=null!=n?n:[],i=()=>(0,t.jsx)(t.Fragment,{children:l.map(({label:n,value:o})=>{const l=r.indexOf(o)>=0;return(0,t.jsx)(e.CheckboxControl,{label:n,checked:l,onChange:()=>s(l?a.filter(e=>o!==e):[...a,o]),__nextHasNoMarginBottom:!0},o)})});return(0,t.jsx)(i,{})},S=({value:n,onChange:s,...o})=>(0,t.jsx)(e.__experimentalNumberControl,{...o,value:n,onChange:(e="0")=>s(parseInt(e,10)),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),k=window.wp.data,F=window.wp.coreData,T=({label:e,value:n,onChange:s,entityKind:o="postType",entityType:r="post",multiple:d=!1})=>{const[m,g]=(0,l.useState)(""),[y,v]=(0,l.useState)(!1),[x,h]=(0,l.useState)({prefill:[],suggestions:[]}),f=(0,i.useDebounce)(e=>{g(e)},300),j=(0,k.useSelect)(e=>{if(y)return x.prefill;if(!n)return[];const t=e(F.store).getEntityRecords(o,r,{context:"view",include:n,per_page:-1});return null!==t||y||"postType"!==o||v(!0),t||[]},[n,o,r,y,x.prefill]),b=(0,k.useSelect)(e=>{if(y)return x.suggestions;if("user"===o)return e(F.store).getUsers({context:"view",search:m,per_page:-1});const t=e(F.store).getEntityRecords(o,r,{context:"view",search:m,per_page:-1});return null!==t||y||"postType"!==o||v(!0),t},[m,o,r,y,x.suggestions]),_=(0,k.useSelect)(e=>!y&&("user"===o?e("core/data").isResolving("core","getUsers",[o,r,{context:"view",search:m,per_page:-1}]):e("core/data").isResolving("core","getEntityRecords",[o,r,{context:"view",search:m,per_page:-1}])),[m,o,r,y,x.suggestions]);(0,l.useEffect)(()=>{y&&(async()=>{try{let e=`popup-maker/v2/object-search?object_type=post_type&object_key=${r}`;n&&(e+=`&include=${(Array.isArray(n)?n:[n]).join(",")}`),m&&(e+=`&s=${m}`);const t=await(0,p.fetchFromWPApi)(e),s=t.items.map(e=>({id:e.id,title:{rendered:e.text}}));let o=[];if(n){const e=Array.isArray(n)?n:[n];o=s.filter(t=>e.includes(t.id))}h({prefill:o,suggestions:s})}catch(e){h({prefill:[],suggestions:[]})}})()},[y,n,m,r]);const C=e=>{const t=t=>t?t.find(t=>t.id.toString()===e.toString()):null;return t(b)||t(j)},w=n?"number"==typeof n||"string"==typeof n?[n]:n:[],S=e=>"object"==typeof e?e.value:e;return(0,t.jsx)("div",{className:"pum-object-search-field",children:(0,t.jsx)(u.SmartTokenControl,{label:e||(0,a.sprintf)(
// translators: %s: entity type.
// translators: %s: entity type.
(0,a.__)("%s(s)","popup-maker"),r.replace(/_/g," ").charAt(0).toUpperCase()+r.replace(/_/g," ").slice(1)),hideLabelFromVision:!0,multiple:d,placeholder:(0,a.sprintf)(
// translators: %s: entity type.
// translators: %s: entity type.
(0,a.__)("Select %s(s)","popup-maker"),r.replace(/_/g," ").toLowerCase()),tokenOnComma:!0,value:w.map(e=>e.toString()),onInputChange:f,onChange:e=>{s(e.map(e=>parseInt(S(e),10)).filter(e=>!isNaN(e)))},renderToken:e=>{const t=C(S(e));return t?"postType"===o?(0,c.decodeEntities)(t.title?.rendered||""):t.name||"":S(e)},renderSuggestion:e=>{var n;const s=C(e);return s?(0,t.jsx)(t.Fragment,{children:"postType"===o?(0,c.decodeEntities)((null!==(n=s.title?.rendered)&&void 0!==n?n:s.title?.raw)||""):s.name||""}):e},suggestions:b?b.map(e=>{var t;return null!==(t=e?.id.toString())&&void 0!==t&&t}):[],messages:_?{noSuggestions:(0,a.__)("Searching…","popup-maker")}:void 0})})},M=({value:n,onChange:s,...o})=>{const r=o.options;return(0,t.jsx)(e.RadioControl,{...o,selected:n?.toString(),options:r,onChange:s,__nextHasNoMarginBottom:!0})},N=({value:n,onChange:s,initialPosition:o=0,...r})=>{const{step:l}=r;return(0,t.jsx)(e.RangeControl,{value:null!=n?n:o,onChange:(e=0)=>s(e),withInputField:!0,__nextHasNoMarginBottom:!0,type:l?"stepper":void 0})},A=e=>Object.entries(e).reduce((e,[t,n])=>!0===e?e:"string"==typeof t&&!(parseInt(t)>=0)&&"object"==typeof n,!1),O=({options:e})=>(0,t.jsx)(t.Fragment,{children:x(e).map(({label:e,value:n})=>(0,t.jsx)("option",{value:n,children:e},n))}),$=({optGroups:e})=>(0,t.jsx)(t.Fragment,{children:Object.entries(e).map(([e,n])=>(0,t.jsx)("optgroup",{label:e,children:(0,t.jsx)(O,{options:n})},e))}),H=({value:n,onChange:s,...o})=>{var r;const{multiple:l=!1}=o,a=null!==(r=o.options)&&void 0!==r?r:{};return(0,t.jsx)(e.SelectControl,{...o,multiple:l,value:l&&"string"==typeof n?n.split(","):n,onChange:s,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:A(a)?(0,t.jsx)($,{optGroups:a}):(0,t.jsx)(O,{options:a})})},E=({value:n,onChange:s,rows:o=5,...r})=>(0,t.jsx)(e.TextareaControl,{...r,value:null!=n?n:"",onChange:s,rows:o,__nextHasNoMarginBottom:!0}),I=({type:n,value:s,onChange:o,...r})=>(0,t.jsx)(e.TextControl,{...r,type:"hidden"!==n?n:void 0,value:null!=s?s:"",onChange:o,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),P=({label:e,value:n,onChange:s,multiple:o=!1,placeholder:r=(0,a.__)("Search","popup-maker"),options:i={}})=>{const[c,p]=(0,l.useState)(""),d=n?"number"==typeof n||"string"==typeof n?[n]:n:[],m=Object.keys(i).filter(e=>!c||"string"==typeof i[e]&&i[e].toLowerCase().includes(c.toLowerCase())),g=e=>{var t;const n="object"==typeof e?e.value:e;return(null!==(t=i[n])&&void 0!==t?t:null)||n};return(0,t.jsx)("div",{className:"pum-token-select-field",children:(0,t.jsx)(u.SmartTokenControl,{label:e,hideLabelFromVision:!0,multiple:o,placeholder:r,value:d.map(e=>e.toString()),onInputChange:p,onChange:e=>s(e),renderToken:g,renderSuggestion:g,suggestions:m})})},V=window.wp.hooks,B=(0,l.createContext)({context:"",fields:[],values:{},setValues:()=>{}}),R=({context:e,fields:n,values:s,setValues:o,children:r})=>(0,t.jsx)(B.Provider,{value:{context:e,fields:n,values:s,setValues:o},children:r}),z=()=>{const{context:e,fields:t=[],values:n,setValues:s}=(0,l.useContext)(B),o=t=>{const s=(0,V.applyFilters)(`${e}.fieldIsVisible`,void 0,t,n);return void 0===s||s};return{context:e,fields:t,values:n,setValues:s,getFields:(n={visible:!0})=>{const s=(null!=t?t:[]).filter(e=>!(n?.tab&&e.tab!==n.tab||n?.section&&e.section!==n.section||n?.panel&&e.panel!==n.panel||n?.visible&&!o(e.id))).sort((e,t)=>e.priority-t.priority).map(t=>{const n=(0,V.applyFilters)(`${e}.renderField`,t.component,t.id,t);return{...t,component:n}});return(0,V.applyFilters)(`${e}.getFields`,s,n)},updateField:(e,t)=>{s({...n,[e]:t})},fieldIsVisible:o}}})(),(window.popupMaker=window.popupMaker||{}).fields=s})();
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists