PageSourceSearch

https://untype.ai/static/js/4275.501f4463.chunk.js

js untype.ai collected 2026-10-05 13:10:53 UTC 12,672 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkuntype_exams_demo_app=self.webpackChunkuntype_exams_demo_app||[]).push([[4275],{1251:function(e,t,n){n.d(t,{Z:function(){return L}});var i=n(74165),a=n(15861),r=n(29439),o=n(93433),l=n(47313),u=n(88195),s=n.n(u),d=n(57829),c=n(37762),h=n(15671),v=n(43144);var p=function(){function e(t){var n=t.data,i=t.config,a=t.api,r=t.readOnly;(0,h.Z)(this,e),this.api=a,this.readOnly=r,this._CSS={block:this.api.styles.block,wrapper:"ce-paragraph"},this.readOnly||(this.onKeyUp=this.onKeyUp.bind(this)),this._placeholder=i.placeholder?i.placeholder:e.DEFAULT_PLACEHOLDER,this._data={},this._element=this.drawView(),this._preserveBlank=void 0!==i.preserveBlank&&i.preserveBlank,this.data=n}return(0,v.Z)(e,[{key:"onKeyUp",value:function(e){"Backspace"!==e.code&&"Delete"!==e.code||""===this._element.textContent&&(this._element.innerHTML="")}},{key:"drawView",value:function(){var e=document.createElement("DIV");return e.classList.add(this._CSS.wrapper,this._CSS.block),e.contentEditable=!1,e.dataset.placeholder=this.api.i18n.t(this._placeholder),this.readOnly||(e.contentEditable=!0,e.addEventListener("keyup",this.onKeyUp)),e}},{key:"render",value:function(){return this._element}},{key:"merge",value:function(e){var t={text:this.data.text+e.text};this.data=t}},{key:"validate",value:function(e){return!(""===e.text.trim()&&!this._preserveBlank)}},{key:"findTeX",value:function(e){var t,n=(0,c.Z)(window.MathJax.startup.document.math);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(e===i.typesetRoot)return i.math}}catch(a){n.e(a)}finally{n.f()}}},{key:"save",value:function(e){for(var t,n="",i=0;i<(null===e||void 0===e||null===(a=e.childNodes)||void 0===a?void 0:a.length);i++){var a,r=null===e||void 0===e?void 0:e.childNodes[i];if("#text"===r.nodeName)n+=((t=r.textContent)&&(t=(t=t.replace(/\$\$([^$]*)\$\$/g,(function(e,t){return"\\("+t+"\\)"}))).replace(/\$([^$]*)\$/g,(function(e,t){return"\\("+t+"\\)"}))),t);if("SPAN"===r.nodeName){var o,l=null===(o=r)||void 0===o?void 0:o.children[0];n=n+"\\("+this.findTeX(l)+"\\)"}}return{text:e.innerHTML,raw:n}}},{key:"onPaste",value:function(e){var t={text:e.detail.data.innerHTML};this.data=t}},{key:"data",get:function(){var e=this._element.innerHTML;return this._data.text=e,this._data},set:function(e){this._data=e||{},this._element.innerHTML=this._data.text||""}}],[{key:"DEFAULT_PLACEHOLDER",get:function(){return""}},{key:"conversionConfig",get:function(){return{export:"text",import:"text"}}},{key:"sanitize",get:function(){return{text:{br:!0}}}},{key:"isReadOnlySupported",get:function(){return!0}},{key:"pasteConfig",get:function(){return{plainPatterns:{math:/<math(.|\s)*?>(.|\s)*?<\/math>/g}}}},{key:"toolbox",get:function(){return{icon:'<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AddIcon"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',title:"Question"}}}]),e}(),f=n(1413),g=function(){function e(t){var n=t.data,i=(t.config,t.api),a=t.readOnly;(0,h.Z)(this,e),this.api=i,this.readOnly=a,this.blockIndex=this.api.blocks.getCurrentBlockIndex()+1,this.CSS={baseClass:this.api.styles.block,loading:this.api.styles.loader,input:this.api.styles.input,wrapper:"cdx-simple-image",imageHolder:"cdx-simple-image__picture"},this.nodes={wrapper:null,imageHolder:null,image:null},this.data={url:n.url||"",withBorder:void 0!==n.withBorder&&n.withBorder,withBackground:void 0!==n.withBackground&&n.withBackground,stretched:void 0!==n.stretched&&n.stretched},this.tunes=[]}return(0,v.Z)(e,[{key:"render",value:function(){var e=this,t=this._make("div",[this.CSS.baseClass,this.CSS.wrapper]),n=this._make("div",this.CSS.loading),i=this._make("div",this.CSS.imageHolder),a=this._make("img");return t.appendChild(n),this.data.url&&(a.src=this.data.url),a.onload=function(){t.classList.remove(e.CSS.loading),i.appendChild(a),t.appendChild(i),n.remove(),e._acceptTuneView()},a.onerror=function(e){console.log("Failed to load an image",e)},this.nodes.imageHolder=i,this.nodes.wrapper=t,this.nodes.image=a,t}},{key:"save",value:function(e){var t=e.querySelector("img");return t?Object.assign(this.data,{url:t.src}):this.data}},{key:"onDropHandler",value:function(e){var t=new FileReader;
1return t.readAsDataURL(e),new Promise((function(e){t.onload=function(t){e({url:t.target.result})}}))}},{key:"onPaste",value:function(e){var t=this;switch(e.type){case"tag":var n=e.detail.data;this.data={url:n.src};break;case"pattern":var i=e.detail.data;this.data={url:i};break;case"file":var a=e.detail.file;this.onDropHandler(a).then((function(e){t.data=e}))}}},{key:"data",get:function(){return this._data},set:function(e){this._data=Object.assign({},this.data,e),this.nodes.image&&(this.nodes.image.src=this.data.url)}},{key:"renderSettings",value:function(){var e=this;return this.tunes.map((function(t){return(0,f.Z)((0,f.Z)({},t),{},{label:e.api.i18n.t(t.label),toggle:!0,onActivate:function(){return e._toggleTune(t.name)},isActive:!!e.data[t.name]})}))}},{key:"_make",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=document.createElement(e);Array.isArray(n)?(t=a.classList).add.apply(t,(0,o.Z)(n)):n&&a.classList.add(n);for(var r in i)a[r]=i[r];return a}},{key:"_toggleTune",value:function(e){this.data[e]=!this.data[e],this._acceptTuneView()}},{key:"_acceptTuneView",value:function(){var e=this;this.tunes.forEach((function(t){e.nodes.imageHolder.classList.toggle(e.CSS.imageHolder+"--"+t.name.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})),!!e.data[t.name]),"stretched"===t.name&&e.api.blocks.stretchBlock(e.blockIndex,!!e.data.stretched)}))}}],[{key:"sanitize",get:function(){return{url:{},withBorder:{},withBackground:{},stretched:{}}}},{key:"isReadOnlySupported",get:function(){return!0}},{key:"pasteConfig",get:function(){return{patterns:{image:/https?:\/\/\S+\.(gif|jpe?g|tiff|png|webp)$/i},tags:[{img:{src:!0}}],files:{mimeTypes:["image/*"]}}}}]),e}(),m=n(36287),y=n(60823),k=n.n(y),x=n(35282),w=n(46417),b=function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll("ms -1","ms\\(^{-1}\\)")).replaceAll("ms -2","ms\\(^{-2}\\)")).replaceAll("m/s 2","m/s\\(^{2}\\)")).replaceAll("PT:142","")).replaceAll("PT:143","")).replaceAll("PT:144","")).replaceAll("PT: 142","")).replaceAll("Topic :144","")).replaceAll("Topic:142","")).replaceAll("TOPIC:142","")).replaceAll("T-142","")).replaceAll("T-144","")).replaceAll("T-143","")},_=function(e){var t=[],n=e.split("\n");return null===n||void 0===n||n.forEach((function(e,n){t.push(S(e))})),t},S=function(e){var t=e;return{type:"question",data:{text:t=A(t)}}},C=function(e){return{type:"image",data:{url:e,caption:!1,withBorder:!1,withBackground:!1,stretched:!1}}},T=function(e){var t=[],n=e.split("\n"),i=0;return n.forEach((function(e){var n=e.split("\t"),a=[];n.forEach((function(e){e=A(e),a.push(e)})),(null===n||void 0===n?void 0:n.length)>i&&(i=null===n||void 0===n?void 0:n.length),t.push(a)})),t.forEach((function(e){for(;(null===e||void 0===e?void 0:e.length)<i;)e.push("")})),{type:"table",data:{withHeadings:!1,content:t}}},A=function(e){var t,n,i;return e=null===(t=e)||void 0===t||null===(n=t.replaceAll(">","&gt;"))||void 0===n||null===(i=n.replaceAll("<","&lt;"))||void 0===i?void 0:i.replaceAll("&","&amp;")},E="editorjs",L=function(e){var t=(0,l.useRef)(),n=null!==e&&void 0!==e&&e.backendBaseURL?null===e||void 0===e?void 0:e.backendBaseURL:m.T,u=l.useState(function(e,t){var n,i,a,r=[],l="",u="",s=null===e||void 0===e?void 0:e.question_data;null===s||void 0===s||null===(n=s.question)||void 0===n||n.forEach((function(e,n){if(e[0]){var i,a=b(e[0]);l=(null===(i=l)||void 0===i?void 0:i.trimEnd())+" "+(null===a||void 0===a?void 0:a.trimStart()),l=b(l)}var u;e[1]&&(l&&(r.push.apply(r,(0,o.Z)(_(l))),l=""),e[1].startsWith("/get-table")?r.push(T(null===(u=e[1])||void 0===u?void 0:u.replace("/get-table?data=",""))):r.push(C(t+e[1])))})),r.push.apply(r,(0,o.Z)(_(l))),null===s||void 0===s||null===(i=s.options)||void 0===i||i.forEach((function(e,n){var i,a=(null===e||void 0===e?void 0:e.label)+")";null===e||void 0===e||null===(i=e.content)||void 0===i||i.forEach((function(e,n){if(n%2===0&&e){e.includes("\n")&&(r.push(S(a)),a="");var i,o=b(e);a?(a=(null===(i=a)||void 0===i?void 0:i.trimEnd())+" "+(null===o||void 0===o?void 0:o.trimStart()),a=b(a)):a=o}else 0!=n&&e&&(r.push(S(a)),r.push(C(t+e)),a="")})),a&&r.push(S(a))})),null!==s&&void 0!==s&&s.key&&r.push(S("KEY: "+(null===s||void 0===s?void 0:s.key))),null!==s&&void 0!==s&&s.solution&&(r.push(S("SOLUTION: ")),null===s||void 0===s||null===(a=s.solution)||void 0===a||a.forEach((function(e,n){if(e[0]){var i=b(e[0]);u=b(u=u?u+"\n"+i:i)}var a;e[1]&&(u&&(r.push.apply(r,(0,o.Z)(_(u))),u=""),e[1].startsWith("/get-table")?r.push(T(null===(a=e[1])||void 0===a?void 0:a.replace("/get-table?data=",""))):r.push(C(t+e[1])))})),u&&r.push.apply(r,(0,o.Z)(_(u))));var d=(0,x.rr)(e);return(null===d||void 0===d?void 0:d.length)>0&&r.push(S()),d.forEach((function(e){var t;r.push(S((null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.toUpperCase())+"_TAG: "+(null===e||void 0===e?void 0:e.value)))})),{time:(new Date).getTime(),blocks:r}}(null===e||void 0===e?void 0:e.data,n)),c=(0,r.Z)(u,2),h=c[0],v=c[1];(0,l.useEffect)((function(){return null!==t&&void 0!==t&&t.current||f(),function(){var e;null===t||void 0===t||null===(e=t.current)||void 0===e||e.destroy(),t.current=null}}),[]);var f=function(){var n=new(s())({holder:E+(null===e||void 0===e?void 0:e.qNum),logLevel:"ERROR",data:h,minHeight:0,onReady:function(){t.current=n},onChange:function(){var n=(0,a.Z)((0,i.Z)().mark((function n(a,r){var o;return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.current.saver.save();case 2:o=n.sent,null===e||void 0===e||e.outputData(o),v(o);case 5:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),autofocus:!0,tools:{paragraph:!1,question:p,image:g,table:k()},defaultBlock:"question"})};return(0,w.jsx)(l.Fragment,{children:(0,w.jsx)(d.Z,{sx:{background:"#f1f0ef",height:"fit-content",borderRadius:"5px",py:2,px:2},children:(0,w.jsx)("div",{id:E+(null===e||void 0===e?void 0:e.qNum),children:" "})})})}},21299:function(e,t,n){n.d(t,{Z:function(){return c}});var i=n(29439),a=n(47313),r=n(66835),o=n(57861),l=n(67478),u=n(51629),s=n(24076),d=n(46417);function c(e){var t=a.useState([]),n=(0,i.Z)(t,2),c=n[0],h=n[1];(0,a.useEffect)((function(){if(null!==e&&void 0!==e&&e.data){var t,n=[];(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.split("\n")).forEac
1h((function(e){var t=e.split("\t"),i=[];t.forEach((function(e){i.push(e)})),n.push(i)})),h(n)}}),[null===e||void 0===e?void 0:e.data]),(0,a.useEffect)((function(){(null===c||void 0===c?void 0:c.length)>0&&setTimeout((function(){return v()}),1e3)}),[c]);var v=function(){window.MathJax&&window.MathJax.typesetPromise().then((function(){return console.log("Typeset successful")})).catch((function(e){return console.log("Typeset failed: "+e.message)}))},p=function(e){if(e.includes("\\(")&&e.includes("\\)")&&e.slice(e.indexOf("\\("),e.lastIndexOf("\\(")).includes("\u20b9")){/text.\{(.*?)\}/gm.test(e)||(e=e.replace("\u20b9","\\text{\u20b9}"))}return e};return(0,d.jsx)(u.Z,{sx:{my:2,border:"1px solid #eeeeee",width:"fit-content",maxWidth:"100%"},children:(0,d.jsx)(r.Z,{sx:{width:"fit-content",maxWidth:"100%"},size:"small",children:(0,d.jsx)(o.Z,{children:c.map((function(e,t){return(0,d.jsx)(s.Z,{sx:{"&:last-child td, &:last-child th":{border:0}},children:e.map((function(e,t){return(0,d.jsx)(l.Z,{children:p(e)},t)}))},t)}))})})})}},52145:function(e,t,n){function i(e,t){if(null==e||"string"!==typeof e||!e)return e;var n=e.match(/^\s*(?:[\(\[]\s*([A-Da-d1-4])\s*[\)\]]|([A-Da-d1-4])\s*[\)\]\.\:\-])\s*/);if(!n)return e;var i={1:"A",2:"B",3:"C",4:"D",5:"E"},a=(n[1]||n[2]||"").toUpperCase(),r=i[a]||a;if(null!=t&&String(t).length>0){var o=String(t).trim().toUpperCase().replace(/[).:\\-]/g,"");if(r!==(i[o]||o))return e}var l=e.slice(n[0].length).replace(/^\s+/,"");return l||e}n.d(t,{M:function(){return i}})},35282:function(e,t,n){function i(e){var t=[];e&&["Program","Course","Subject","Chapter","Topic","Concept","Pattern","Level","Source","Others"].forEach((function(n){e[null===n||void 0===n?void 0:n.toLowerCase()]&&t.push({name:n,value:e[null===n||void 0===n?void 0:n.toLowerCase()]})}));return t}function a(){return["Program","Course","Subject","Chapter","Topic","Concept","Pattern","Level","Source","Others"]}n.d(t,{Rr:function(){return a},rr:function(){return i}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.