芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/blog.ycreate.jp/wp-content/themes/swell/build/menu/balloon/index.js
!function(){var e={184:function(e,t){var a;!function(){"use strict";var l={}.hasOwnProperty;function n(){for(var e=[],t=0;t
(()=>{var t={703:(e,t,a)=>{"use strict";var l=a(414);function n(){}function r(){}r.resetWarningCache=n,e.exports=function(){function e(e,t,a,n,r,s){if(s!==l){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:n};return a.PropTypes=a,a}},697:(e,t,a)=>{e.exports=a(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},98:t=>{"use strict";t.exports=e}},a={};function l(e){var n=a[e];if(void 0!==n)return n.exports;var r=a[e]={exports:{}};return t[e](r,r.exports,l),r.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";l.r(n),l.d(n,{default:()=>f});var e=l(98),t=l.n(e),a=l(697),r=l.n(a);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t
1&&void 0!==arguments[1]?arguments[1]:""}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t
0?t-1:void 0,{isPrevious:!0})})),b(_(a),"handleNextPage",(function(e){var t=a.state.selected,l=a.props.pageCount;a.handleClick(e,null,t
3&&void 0!==arguments[3]?arguments[3]:{},r=n.isPrevious,s=void 0!==r&&r,c=n.isNext,i=void 0!==c&&c,o=n.isBreak,d=void 0!==o&&o,p=n.isActive,u=void 0!==p&&p;e.preventDefault?e.preventDefault():e.returnValue=!1;var m=a.state.selected,g=a.props.onClick,v=l;if(g){var _=g({index:t,selected:m,nextSelectedPage:l,event:e,isPrevious:s,isNext:i,isBreak:d,isActive:u});if(!1===_)return;Number.isInteger(_)&&(v=_)}void 0!==v&&a.handlePageChange(v)})),b(_(a),"handleBreakClick",(function(e,t){var l=a.state.selected;a.handleClick(t,e,l
r-n/2?m=n-(g=r-d):d
r-s||v>=d-m&&v<=d+(0===d&&n>1?g-1:g)?b.push({type:"page",index:v,display:h(v)}):c&&b.length>0&&b[b.length-1].display!==_&&(n>0||s>0)&&(_=t().createElement(p,{key:v,breakLabel:c,breakClassName:i,breakLinkClassName:o,breakHandler:a.handleBreakClick.bind(null,v),getEventListener:a.getEventListener}),b.push({type:"break",index:v,display:_}))}b.forEach((function(t,a){var l=t;"break"===t.type&&b[a-1]&&"page"===b[a-1].type&&b[a+1]&&"page"===b[a+1].type&&b[a+1].index-b[a-1].index<=2&&(l={type:"page",index:t.index,display:h(t.index)}),e.push(l.display)}))}return e})),void 0!==e.initialPage&&void 0!==e.forcePage&&console.warn("(react-paginate): Both initialPage (".concat(e.initialPage,") and forcePage (").concat(e.forcePage,") props are provided, which is discouraged.")+" Use exclusively forcePage prop for a controlled component.\nSee https://reactjs.org/docs/forms.html#controlled-components"),l=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,a.state={selected:l},a}return a=c,(l=[{key:"componentDidMount",value:function(){var e=this.props,t=e.initialPage,a=e.disableInitialCallback,l=e.extraAriaContext,n=e.pageCount,r=e.forcePage;void 0===t||a||this.callCallback(t),l&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(n)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(n,"). Did you forget a Math.ceil()?")),void 0!==t&&t>n-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(t," > ").concat(n-1,").")),void 0!==r&&r>n-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(r," > ").concat(n-1,")."))}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&(this.props.forcePage>this.props.pageCount-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(this.props.forcePage," > ").concat(this.props.pageCount-1,").")),this.setState({selected:this.props.forcePage})),Number.isInteger(e.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var e=this.state.selected,t=this.props,a=t.pageCount,l=e+t.pageRangeDisplayed;return l>=a?a-1:l}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"getElementHref",value:function(e){var t=this.props,a=t.hrefBuilder,l=t.pageCount,n=t.hrefAllControls;if(a)return n||e>=0&&e
=0&&e
(a=a||i,React.createElement(React.Fragment,null,React.createElement("fieldset",{className:`swl-colorPicker for-${e}`},t.map((t=>{const n=a===t.value;return React.createElement(o.Button,{key:`${e}_${t.value}`,className:`swl-colorPicker__btn ${c}`,title:t.label,"data-color":t.value,"data-selected":n,onClick:()=>{l(n?"":t.value)}},React.createElement("span",{className:"__track",style:{"--swl--the-color--bg":null==t?void 0:t.bg,"--swl--the-color--border":null==t?void 0:t.border}},React.createElement("svg",{className:"__svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))))}))),r&&React.createElement("div",{className:"swl-helptext"},(0,n.createInterpolateElement)((0,s.__)("
SWELL設定
から色を設定できます。"),{a:React.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer"})})))))),R=a(184),C=a.n(R);function x({id:e,setId:t}){const[a,l]=(0,n.useState)(""),[r,c]=(0,n.useState)(),[p,R]=(0,n.useState)({icon:void 0,name:void 0,shape:"square",type:"speaking",align:"left",border:"none",col:"gray",spVertical:""}),[x,N]=(0,n.useState)(!e),[k,P]=(0,n.useState)(!1),[L,B]=(0,n.useState)(),S=e?(0,s.__)("更新","swell"):(0,s.__)("登録","swell");(0,n.useEffect)((()=>{e&&i()({path:`${z}?id=${e}`,method:"GET"}).then((e=>{l(e.title),R({...p,...e.data}),N(!0)})).catch((()=>{t(),N(!0)}))}),[]);const O=(0,d.addQueryArgs)("admin.php",{page:"swell_settings_editor",tab:"balloon"}),T=(0,d.addQueryArgs)("admin.php",{page:"swell_balloon"}),A=l=>{l.preventDefault(),""!==a?(P(!0),i()({path:z,method:"POST",data:{id:e,title:a,data:p}}).then((e=>{B({status:"updated",text:e.message||(0,s.__)("設定を保存しました。","swell")}),e.insertId&&t(e.insertId),P(!1)})).catch((e=>{B({status:"error",text:e.message||(0,s.__)("エラーが発生しました。","swell")}),P(!1)}))):c({item:"title",message:(0,s.__)("※ ふきだしセットのタイトルを入力してください","swell")})};return React.createElement(React.Fragment,null,L&&!k&&React.createElement("div",{className:`notice is-dismissible ${L.status}`},React.createElement("p",null,L.text,React.createElement("a",{href:T,style:{marginLeft:"8px"}},(0,s.__)("ふきだしセットの一覧に戻る","swell"))),React.createElement(o.Button,{className:"notice-dismiss",onClick:()=>{B()}},React.createElement("span",{className:"screen-reader-text"},(0,s.__)("この通知を非表示にする。","swell")))),x&&React.createElement("div",{className:"swl-setting__body is-edit-balloon"},React.createElement("div",{className:"swl-setting__controls"},React.createElement(o.Button,{disabled:k,isPrimary:!0,onClick:A},S),!!e&&React.createElement(React.Fragment,null,React.createElement(o.Button,{disabled:k,isSecondary:!0,onClick:t=>{t.preventDefault(),window.confirm((0,s.__)("本当に複製しますか?","swell"))&&i()({path:`${z}-copy`,method:"POST",data:{id:e}}).then((e=>{if(P(!1),e.id){const t=(0,d.addQueryArgs)("admin.php",{page:"swell_balloon",id:e.id});window.location.href=t}})).catch((e=>{B({status:"error",text:e.message||(0,s.__)("エラーが発生しました。","swell")}),P(!1)}))}},(0,s.__)("複製","swell")),React.createElement(o.Button,{disabled:k,isDestructive:!0,variant:"secondary",onClick:()=>{e&&window.confirm((0,s.__)("本当に削除してもいいですか?","swell"))&&(P(!0),i()({path:z,method:"DELETE",data:{id:e}}).then((()=>{window.location.href=T})).catch((e=>{B({status:"error",text:e.message||(0,s.__)("エラーが発生しました。","swell")}),P(!1)})))}},(0,s.__)("削除","swell")))),React.createElement("form",{onSubmit:A},React.createElement("div",{className:"swl-setting__editTitle"},React.createElement(o.TextControl,{placeholder:(0,s.__)("ふきだしセットのタイトルを入力…","swell"),value:a,onChange:e=>{l(e)}}),"title"===(null==r?void 0:r.item)&&React.createElement("p",{className:"swl-setting__error"},r.message)),React.createElement("div",{className:"swell_settings_balloon_edit",disabled:k},React.createElement("div",{className:"swell_settings_balloon_edit__inner -left"},React.createElement("div",{className:`c-balloon -bln-${p.align}`,"data-col":p.col||"gray"},React.createElement("div",{className:`c-balloon__icon -${p.shape}`},p.icon&&React.createElement(o.Button,{className:"swell_settings_balloon_edit__iconDelete",isDestructive:!0,variant:"secondary",icon:u,iconSize:12,label:(0,s.__)("アイコン画像を削除","swell"),onClick:()=>{R({...p,icon:void 0})}}),React.createElement(v.MediaUpload,{allowedTypes:"image",onSelect:e=>{const t=e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;R({...p,icon:t})},render:({open:e})=>React.createElement(o.Button,{onClick:e,className:"swell_settings_balloon_edit__iconSelect",label:(0,s.__)("画像を選択","swell"),showTooltip:!1},React.createElement("span",null,(0,s.__)("画像を選択","swell")))}),React.createElement("img",{src:p.icon||D,alt:"",className:"c-balloon__iconImg",width:"80px"}),React.createElement(v.RichText,{className:C()("c-balloon__iconName",{"-empty":v.RichText.isEmpty(p.name)}),value:p.name,placeholder:(0,s.__)("アイコン名をここに入力…","swell"),onChange:e=>{R({...p,name:e})}})),React.createElement("div",{className:`c-balloon__body -${p.type} -border-${p.border}`},React.createElement("div",{className:"c-balloon__text"},(0,s.__)("ふきだしの内容がここに入ります","swell"),React.createElement("span",{className:"c-balloon__shapes"},React.createElement("span",{className:"c-balloon__before"}),React.createElement("span",{className:"c-balloon__after"})))))),React.createElement("div",{className:"swell_settings_balloon_edit__inner -right"},React.createElement("div",{className:"swell_settings_balloon_edit__item"},React.createElement("div",{className:"swell_settings_balloon_edit__subttl"},(0,s.__)("アイコンの丸枠","swell")),React.createElement(o.ButtonGroup,null,h.map((e=>{const t=e.val===p.shape;return React.createElement(o.Button,{text:e.label,icon:_.shape[e.val],isPrimary:t,onClick:()=>{R({...p,shape:e.val})},key:`shape_${e.val}`})})))),React.createElement("div",{className:"swell_settings_balloon_edit__item"},React.createElement("div",{className:"swell_settings_balloon_edit__subttl"},(0,s.__)("ふきだしの形","swell")),React.createElement(o.ButtonGroup,null,b.map((e=>{const t=e.val===p.type;return React.createElement(o.Button,{text:e.label,icon:_.type[e.val],isPrimary:t,onClick:()=>{R({...p,type:e.val})},key:`type_${e.val}`})})))),React.createElement("div",{className:"swell_settings_balloon_edit__item"},React.createElement("div",{className:"swell_settings_balloon_edit__subttl"},(0,s.__)("ふきだしの向き","swell")),React.createElement(o.ButtonGroup,null,w.map((e=>{const t=e.val===p.align;return React.createElement(o.Button,{text:e.label,icon:_.align[e.val],isPrimary:t,onClick:()=>{R({...p,align:e.val})},key:`align_${e.val}`})})))),React.createElement("div",{className:"swell_settings_balloon_edit__item"},React.createElement("div",{className:"swell_settings_balloon_edit__subttl"},(0,s.__)("ふきだしの線","swell")),React.createElement(o.ButtonGroup,null,f.map((e=>{const t=e.val===p.border;return React.createElement(o.Button,{text:e.label,icon:_.border[e.val],isPrimary:t,onClick:()=>{R({...p,border:e.val})},key:`border_${e.val}`})})))),React.createElement("div",{className:"swell_settings_balloon_edit__item -wide"},React.createElement("div",{className:"swell_settings_balloon_edit__subttl"},(0,s.__)("ふきだしの色","swell")),React.createElement(y,{type:"swl-capbox-color",value:p.col||"gray",colors:E,onClick:e=>{R({...p,col:e||""})}}),React.createElement("p",{className:""},(0,n.createInterpolateElement)((0,s.__)("※ ふきだしカラーは「SWELL設定」内の「
エディター設定
」から編集できます。","swell"),{a:React.createElement("a",{href:O,target:"_blank",rel:"noreferrer"})}))),React.createElement("div",{className:"swell_settings_balloon_edit__item -wide"},React.createElement("div",{className:"swell_settings_balloon_edit__subttl"},(0,s.__)("テキストとアイコンの並び","swell")),React.createElement(o.CheckboxControl,{label:(0,s.__)("スマホ表示で縦並びにする","swell"),checked:"1"===p.spVertical,onChange:e=>{R({...p,spVertical:""}),R(!1===e?{...p,spVertical:""}:{...p,spVertical:"1"})}}))))),React.createElement("a",{href:T,className:"swl-setting__backLink"},React.createElement(m,{icon:g}),(0,s.__)("ふきだしセットの一覧に戻る","swell"))))}var N=(0,n.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(p.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),k=(0,n.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(p.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),P=(0,n.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(p.Path,{d:"M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"})),L=(0,n.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(p.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));function B({idx:e,balloonData:t,copyBalloon:a,deleteBalloon:l,swapBallons:r,isFirst:c,isLast:i}){const{id:p,title:g,data:v}=t,[_,h]=(0,n.useState)(!1);(0,n.useEffect)((()=>{h(!1)}),[p,e]);const b=(0,d.addQueryArgs)("admin.php",{page:"swell_balloon",id:p}),w=React.createElement("div",{className:`c-balloon -bln-${v.align}`,"data-col":v.col,"aria-hidden":"true"},v.icon&&React.createElement("div",{className:`c-balloon__icon -${v.shape}`},React.createElement("img",{src:v.icon,alt:"",className:"c-balloon__iconImg",width:"80px"}),React.createElement("span",{className:"c-balloon__iconName"},v.name)),React.createElement("div",{className:`c-balloon__body -${v.type} -border-${v.border}`},React.createElement("div",{className:"c-balloon__text"},(0,s.__)("ふきだしテキスト","swell"),React.createElement("span",{className:"c-balloon__shapes"},React.createElement("span",{className:"c-balloon__before"}),React.createElement("span",{className:"c-balloon__after"})))));return React.createElement("li",{key:e,className:C()("swl-setting-balloon__item",{"show-code":_}),"data-id":p},!c&&React.createElement(o.Button,{className:"swl-setting-balloon__arrow -prev",label:(0,s.__)("前に移動","swell"),onClick:()=>{r(e,"prev")}},React.createElement(m,{icon:N})),!i&&React.createElement(o.Button,{className:"swl-setting-balloon__arrow -next",label:(0,s.__)("次に移動","swell"),onClick:()=>{r(e,"next")}},React.createElement(m,{icon:k})),React.createElement("div",{key:e,className:"swl-setting-balloon__item__inner"},React.createElement("div",{className:"swl-setting-balloon__btns"},React.createElement(o.Button,{label:(0,s.__)("ショートコードを表示する","swell"),className:"swl-setting-balloon__shortCode swl-setting-balloon__btn",icon:_?u:P,onClick:()=>{_?h(!1):(h(!0),setTimeout((function(){document.querySelector(`.swl-setting-balloon__item[data-id="${p}"] .swl-setting__codeCopyBox`).select()}),100))}}),React.createElement(o.Button,{isSecondary:!0,className:"swl-setting-balloon__copy swl-setting-balloon__btn",label:(0,s.__)("このセットを複製する","swell"),icon:L,onClick:()=>{a(p)}}),React.createElement(o.Button,{isDestructive:!0,variant:"secondary",className:"swl-setting-balloon__delete swl-setting-balloon__btn",label:(0,s.__)("このセットを削除する","swell"),icon:u,onClick:()=>{l(p)}})),React.createElement("a",{href:b,className:"swl-setting-balloon__link"},React.createElement("div",{className:"swl-setting-balloon__ttl"},g),w),React.createElement("div",{className:"swl-setting-balloon__code",role:"button",tabIndex:"0",onClick:()=>{h(!1)},onKeyDown:e=>{e.stopPropagation(),13===e.keyCode&&h(!1)}},React.createElement("input",{className:"swl-setting__codeCopyBox code",type:"text",readOnly:!0,value:`[speech_balloon id="${p}"]${(0,s.__)("ふきだしテキストをここに入力","swell")}[/speech_balloon]`,onClick:e=>{e.stopPropagation()},onFocus:e=>{e.stopPropagation(),e.target.select()}}))))}var S=a(358),O=a.n(S);const T=(e,t,a)=>{const l=null!==e,n=null!==t;1===a?(l&&e.classList.add("-to-next"),n&&t.classList.add("-to-prev")):2===a?(l&&e.classList.add("-hide"),n&&t.classList.add("-hide")):3===a?(l&&e.classList.add("-show"),n&&t.classList.add("-show"),l&&e.classList.remove("-hide"),n&&t.classList.remove("-hide")):4===a&&(l&&e.classList.remove("-show"),n&&t.classList.remove("-show"),l&&e.classList.remove("-to-next"),n&&t.classList.remove("-to-prev"))};function A(){const[e,t]=(0,n.useState)(!1),[a,l]=(0,n.useState)(!1),[r,c]=(0,n.useState)(),[p,u]=(0,n.useState)([]),[m,g]=(0,n.useState)([]),[v,_]=(0,n.useState)(""),[h,b]=(0,n.useState)(30),[w,f]=(0,n.useState)(0),E=w*h;(0,n.useEffect)((()=>{i()({path:z,method:"GET"}).then((e=>{t(!0),u(e),g(e)}))}),[]);const y=(0,n.useCallback)((e=>{const t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(t.toLowerCase().trim());g((p||[]).filter((({title:e})=>e.toLowerCase().match(a))))}),[p]);(0,n.useEffect)((()=>{e&&(v?y(v):g(p))}),[p,v]);const R=(0,n.useCallback)((e=>{e&&window.confirm((0,s.__)("本当に複製しますか?","swell"))&&(l(!0),i()({path:`${z}-copy`,method:"POST",data:{id:e}}).then((e=>{u([e,...p]),c({status:"updated",text:e.message||(0,s.__)("複製しました。","swell")}),l(!1)})).catch((e=>{c({status:"error",text:e.message||(0,s.__)("エラーが発生しました。","swell")}),l(!1)})))}),[p]),C=(0,n.useCallback)((e=>{e&&window.confirm((0,s.__)("本当に削除してもいいですか?","swell"))&&(l(!0),i()({path:z,method:"DELETE",data:{id:e}}).then((t=>{const a=p.filter((t=>t.id!==e));u(a),c({status:"updated",text:t.message||(0,s.__)("削除しました。","swell")}),l(!1)})).catch((e=>{c({status:"error",text:e.message||(0,s.__)("エラーが発生しました。","swell")}),l(!1)})))}),[p]),x=(0,n.useCallback)(((e,t)=>{if(void 0===e||!t)return;if("prev"!==t&&"next"!==t)return;const a=e+E,l="prev"===t?m[a-1]:m[a],n="prev"===t?m[a]:m[a+1];if(!l||!n)return;const r=document.querySelector(`.swl-setting-balloon__item[data-id="${l.id}"]`),o=document.querySelector(`.swl-setting-balloon__item[data-id="${n.id}"]`);T(r,o,1),setTimeout((()=>{T(r,o,2),i()({path:`${z}-sort`,method:"POST",data:{balloon1:l,balloon2:n}}).then((e=>{u(e),setTimeout((()=>{T(r,o,3)}),100),setTimeout((()=>{T(r,o,4)}),1100)})).catch((e=>{c({status:"error",text:e.message||(0,s.__)("エラーが発生しました。","swell")})}))}),400)}),[m,E]);if(!e)return null;const N=(0,d.addQueryArgs)("admin.php",{page:"swell_balloon",post_new:null}),k=Math.ceil(m.length/h),P=m.slice(E,E+h);return React.createElement(React.Fragment,null,r&&!a&&React.createElement("div",{className:`notice is-dismissible ${r.status}`},React.createElement("p",null,r.text),React.createElement(o.Button,{className:"notice-dismiss",onClick:()=>{c()}},React.createElement("span",{className:"screen-reader-text"},(0,s.__)("この通知を非表示にする。","swell")))),React.createElement("div",{className:"swl-setting__body swl-setting-balloon",disabled:a},React.createElement("div",{className:"swl-setting__controls"},React.createElement("a",{className:"components-button is-primary swl-setting__new",href:N},(0,s.__)("新規ふきだし追加","swell")),React.createElement("input",{className:"swl-setting__search",type:"text",placeholder:(0,s.__)("ふきだしセットを検索…","swell"),value:v,onChange:e=>{_(e.target.value)}})),m.length?React.createElement(React.Fragment,null,React.createElement("ul",{className:"swl-setting-balloon__list"},P.map(((e,t)=>React.createElement(B,{key:t,isFirst:t+E===0,isLast:t+E===m.length-1,idx:t,balloonData:e,copyBalloon:R,deleteBalloon:C,swapBallons:x})))),React.createElement(O(),{pageCount:k,pageRangeDisplayed:5,marginPagesDisplayed:1,onPageChange:e=>{f(e.selected)},containerClassName:"pagination",pageClassName:"pagination__item",pageLinkClassName:"pagination__link",activeClassName:"active",previousLabel:"<",nextLabel:">",previousClassName:"pagination__item -prev",previousLinkClassName:"pagination__link -prev",nextClassName:"pagination__item -next",nextLinkClassName:"pagination__link -next",breakClassName:"pagination__item -break",breakLinkClassName:"pagination__link -break"})):React.createElement("p",null,(0,s.__)("ふきだしデータがまだありません。","swell"))))}function M(){const[e,t]=(0,n.useState)(!1),[a,l]=(0,n.useState)("");return React.createElement(React.Fragment,null,a&&React.createElement("div",{className:"notice is-dismissible error"},React.createElement("p",null,a)),React.createElement("div",{className:"swl-setting__body swl-setting-balloon",disabled:e},React.createElement("p",null,(0,s.__)("旧バージョンの古いデータが残っています。以下のボタンからデータの変換を行ってください。","swell")),React.createElement(o.Button,{isPrimary:!0,className:"",onClick:()=>{e||window.confirm((0,s.__)("本当にデータを移行してもいいですか?","swell"))&&(t(!0),i()({path:z,method:"PATCH"}).then((e=>{"ok"===e.status?location.reload():l((0,s.__)("データ移行に失敗しました。","swell"))})).catch((e=>{l(e.message)})))}},(0,s.__)("旧データを新データへ移行する","swell")),React.createElement("p",null,(0,s.__)("※データの変換を行うと、SWELLのバージョンをダウングレードした時にふきだしが正常に呼び出せなくなる可能性があります。","swell"),React.createElement("br",null),(0,s.__)("バックアップを取ってから実行してください。","swell"))))}var j=window.wp.mediaUtils;const z="/wp/v2/swell-balloon",D="https://0.gravatar.com/avatar/00000000000000000000000000000000?s=128&d=mp&r=g";(0,r.addFilter)("editor.MediaUpload","core/edit-post/components/media-upload/replace-media-upload",(()=>j.MediaUpload));const V=({isOld:e})=>{const t={};location.search.substring(1).split("&").forEach((e=>{const[a,...l]=e.split("=");""!==a&&(t[a]=decodeURI(l.join("=")))}));const a="post_new"in t,[l,r]=(0,n.useState)(t.id);return e?React.createElement(M,null):l||a?React.createElement(x,{id:l,setId:r}):React.createElement(A,null)};t()((()=>{const e=document.getElementById("swell_setting_page_content"),t=e.getAttribute("data-is-old");!function(e,t){void 0!==n.createRoot?(0,n.createRoot)(e).render(t):(0,n.render)(t,e)}(e,React.createElement(V,{isOld:t}))}))}()}();